sq_mini_racer 0.3.1.0.2 → 0.3.1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e68f36f6b57f07077c1f7914e2e902c6e824ee2de5d00008a5f5df50acee72b7
4
- data.tar.gz: f7cf237de4ca9714d8588d3d8fc88afdc3a5eaf561b5ba96e78f7f2acfd10e3f
3
+ metadata.gz: 3b0f7b93421f8d498ef54349c10303cce4dac56dd7621114e6adb2052094543b
4
+ data.tar.gz: 386c695359fcae7e509f95bf119dc83f9bb3e31cc52a813f4b5d879c6244969a
5
5
  SHA512:
6
- metadata.gz: 63227b1b45f9d20020553c96b3dda2e8e5d679ad92720131e7f5feea1055a08093270c1f8eef8cd6e1b0860fb2bdb17e004aac33c5a1000cdc0f3bbca0b66563
7
- data.tar.gz: ec0c9d009c94031a1a1dd3857bede44239fe657ea4999a167ee75e2f57873107870d7c8db77721ef088cc7fe6c9b8e88aacca3c32a127aafc692e886b4c86155
6
+ metadata.gz: 680bea2776529098fd013737f6dfdd7567b09e377fa6aa71f37b96267c54521f99b6b58c239e9c8f29bf1abacba40c6d94846bf156191d89ec0ba60218c32797
7
+ data.tar.gz: 40c2b79014162dca0302fc8756874489db654b1128a9dafb259866c4845c45da458606dd2e45c29b5d3ea252c1efd18f1bf5d52b9acf0f2670dc973797ce5cd5
@@ -30,7 +30,7 @@ def libv8_gem_name
30
30
  end
31
31
 
32
32
  def libv8_requirement
33
- '~> 14.14.0.0.beta1'
33
+ '~> 15.5.1.0.beta1'
34
34
  end
35
35
 
36
36
  def libv8_basename(version)
@@ -34,7 +34,9 @@
34
34
  #include <atomic>
35
35
  #include <math.h>
36
36
  #include "compat.hpp"
37
+ #ifdef __x86_64__
37
38
  #include "simdutf8check.h"
39
+ #endif
38
40
 
39
41
  #include <time.h>
40
42
 
@@ -564,11 +566,13 @@ static inline Local<Value> convert_ruby_str_to_v8(
564
566
  static const rb_encoding *usascii_enc = rb_usascii_encoding();
565
567
  static const rb_encoding *latin1_enc = rb_enc_find("ISO-8859-1");
566
568
  assert(latin1_enc != nullptr);
569
+ #ifdef __x86_64__
567
570
  #ifndef __AVX2__
568
571
  # define validate_utf8 validate_utf8_fast
569
572
  #else
570
573
  static const (*validate_utf8)(const char *, size_t) =
571
574
  best_utf8_validate_func();
575
+ #endif
572
576
  #endif
573
577
 
574
578
  rb_encoding *enc = rb_enc_get(value);
@@ -577,8 +581,12 @@ static inline Local<Value> convert_ruby_str_to_v8(
577
581
  if (len < 0 || len > INT_MAX) {
578
582
  return Null(isolate);
579
583
  }
584
+ #ifdef __x86_64__
580
585
  bool is_valid_utf8 = enc == utf8_enc &&
581
586
  validate_utf8(str, static_cast<size_t>(len));
587
+ #else
588
+ bool is_valid_utf8 = false;
589
+ #endif
582
590
 
583
591
  MaybeLocal<String> v8str;
584
592
  int int_len = static_cast<int>(len);
@@ -641,7 +649,11 @@ static Local<Value> convert_ruby_to_v8(Isolate* isolate, Local<Context> context,
641
649
  case T_FLOAT:
642
650
  return scope.Escape(Number::New(isolate, NUM2DBL(value)));
643
651
  case T_STRING:
644
- return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
652
+ //#ifndef __x86_64__
653
+ // return scope.Escape(String::NewFromUtf8(isolate, RSTRING_PTR(value), NewStringType::kNormal, (int)RSTRING_LEN(value)).ToLocalChecked());
654
+ //#else
655
+ return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
656
+ //#endif
645
657
  case T_NIL:
646
658
  return scope.Escape(Null(isolate));
647
659
  case T_TRUE:
@@ -672,7 +684,11 @@ static Local<Value> convert_ruby_to_v8(Isolate* isolate, Local<Context> context,
672
684
  case T_SYMBOL:
673
685
  {
674
686
  value = rb_funcall(value, rb_intern("to_s"), 0);
675
- return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
687
+ //#ifndef __x86_64__
688
+ // return scope.Escape(String::NewFromUtf8(isolate, RSTRING_PTR(value), NewStringType::kNormal, (int)RSTRING_LEN(value)).ToLocalChecked());
689
+ //#else
690
+ return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
691
+ //#endif
676
692
  }
677
693
  case T_DATA:
678
694
  {
@@ -704,7 +720,11 @@ static Local<Value> convert_ruby_to_v8(Isolate* isolate, Local<Context> context,
704
720
  if (rb_respond_to(value, rb_intern("to_s"))) {
705
721
  // TODO: if this throws we're screwed
706
722
  value = rb_funcall(value, rb_intern("to_s"), 0);
723
+ //#ifndef __x86_64__
724
+ // return scope.Escape(String::NewFromUtf8(isolate, RSTRING_PTR(value), NewStringType::kNormal, (int)RSTRING_LEN(value)).ToLocalChecked());
725
+ //#else
707
726
  return scope.Escape(convert_ruby_str_to_v8(scope, isolate, value));
727
+ //#endif
708
728
  }
709
729
  return scope.Escape(
710
730
  String::NewFromUtf8Literal(isolate, "Undefined Conversion"));
@@ -2,6 +2,6 @@ module Sqreen
2
2
  module MiniRacer
3
3
  # first three numbers is the upstream version
4
4
  # that we last merged with
5
- VERSION = "0.3.1.0.2"
5
+ VERSION = "0.3.1.0.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sq_mini_racer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.0.2
4
+ version: 0.3.1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-16 00:00:00.000000000 Z
11
+ date: 2021-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -138,9 +138,9 @@ licenses:
138
138
  - MIT
139
139
  metadata:
140
140
  bug_tracker_uri: https://github.com/discourse/mini_racer/issues
141
- changelog_uri: https://github.com/discourse/mini_racer/blob/v0.3.1.0.2/CHANGELOG
142
- documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.3.1.0.2
143
- source_code_uri: https://github.com/discourse/mini_racer/tree/v0.3.1.0.2
141
+ changelog_uri: https://github.com/discourse/mini_racer/blob/v0.3.1.0.3/CHANGELOG
142
+ documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.3.1.0.3
143
+ source_code_uri: https://github.com/discourse/mini_racer/tree/v0.3.1.0.3
144
144
  post_install_message:
145
145
  rdoc_options: []
146
146
  require_paths:
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
159
  requirements: []
160
- rubygems_version: 3.1.3
160
+ rubygems_version: 3.2.3
161
161
  signing_key:
162
162
  specification_version: 4
163
163
  summary: Minimal embedded v8 for Ruby