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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b0f7b93421f8d498ef54349c10303cce4dac56dd7621114e6adb2052094543b
|
4
|
+
data.tar.gz: 386c695359fcae7e509f95bf119dc83f9bb3e31cc52a813f4b5d879c6244969a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 680bea2776529098fd013737f6dfdd7567b09e377fa6aa71f37b96267c54521f99b6b58c239e9c8f29bf1abacba40c6d94846bf156191d89ec0ba60218c32797
|
7
|
+
data.tar.gz: 40c2b79014162dca0302fc8756874489db654b1128a9dafb259866c4845c45da458606dd2e45c29b5d3ea252c1efd18f1bf5d52b9acf0f2670dc973797ce5cd5
|
@@ -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
|
-
|
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
|
-
|
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"));
|
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.
|
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:
|
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.
|
142
|
-
documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.3.1.0.
|
143
|
-
source_code_uri: https://github.com/discourse/mini_racer/tree/v0.3.1.0.
|
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.
|
160
|
+
rubygems_version: 3.2.3
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Minimal embedded v8 for Ruby
|