quickjs 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/quickjsrb/quickjs/cutils.h +56 -0
- data/ext/quickjsrb/quickjs/libregexp-opcode.h +11 -1
- data/ext/quickjsrb/quickjs/libregexp.c +883 -132
- data/ext/quickjsrb/quickjs/libregexp.h +1 -0
- data/ext/quickjsrb/quickjs/libunicode-table.h +420 -1
- data/ext/quickjsrb/quickjs/libunicode.c +224 -11
- data/ext/quickjsrb/quickjs/libunicode.h +9 -5
- data/ext/quickjsrb/quickjs/qjs.c +1 -1
- data/ext/quickjsrb/quickjs/qjsc.c +81 -26
- data/ext/quickjsrb/quickjs/quickjs-atom.h +7 -0
- data/ext/quickjsrb/quickjs/quickjs-libc.c +254 -65
- data/ext/quickjsrb/quickjs/quickjs-libc.h +7 -1
- data/ext/quickjsrb/quickjs/quickjs-opcode.h +2 -2
- data/ext/quickjsrb/quickjs/quickjs.c +2021 -686
- data/ext/quickjsrb/quickjs/quickjs.h +52 -8
- data/ext/quickjsrb/quickjs/run-test262.c +109 -32
- data/ext/quickjsrb/quickjs/unicode_gen.c +541 -5
- data/ext/quickjsrb/quickjs/unicode_gen_def.h +15 -0
- data/ext/quickjsrb/quickjsrb.c +1 -1
- data/lib/quickjs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e79081c82cb9b414f3c77b44883c6e025558aea6c3000f204b7da4df411642e4
|
4
|
+
data.tar.gz: 8d0be576f2b301e793e767f8f3a9c7529856e6694d2655beaf14efeb85aab043
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12404c2ffe3dbc5021eefbf6b8b42bdb9a74d2aa649b55eeb57ad92dbb9330c2d95834401af7a8a8471bc85db0adeebd3d877c5d46b421bc0320b356671253b3
|
7
|
+
data.tar.gz: 387ef0a683d6169e113a3488208c8a75d7409e574eddecc416c059cf9d0d0282b1c3a0c267c54b5b74a2065bb843da5a90070db9c33b34ddc86b9919e7161990
|
@@ -364,4 +364,60 @@ static inline double uint64_as_float64(uint64_t u64)
|
|
364
364
|
return u.d;
|
365
365
|
}
|
366
366
|
|
367
|
+
static inline double fromfp16(uint16_t v)
|
368
|
+
{
|
369
|
+
double d;
|
370
|
+
uint32_t v1;
|
371
|
+
v1 = v & 0x7fff;
|
372
|
+
if (unlikely(v1 >= 0x7c00))
|
373
|
+
v1 += 0x1f8000; /* NaN or infinity */
|
374
|
+
d = uint64_as_float64(((uint64_t)(v >> 15) << 63) | ((uint64_t)v1 << (52 - 10)));
|
375
|
+
return d * 0x1p1008;
|
376
|
+
}
|
377
|
+
|
378
|
+
static inline uint16_t tofp16(double d)
|
379
|
+
{
|
380
|
+
uint64_t a, addend;
|
381
|
+
uint32_t v, sgn;
|
382
|
+
int shift;
|
383
|
+
|
384
|
+
a = float64_as_uint64(d);
|
385
|
+
sgn = a >> 63;
|
386
|
+
a = a & 0x7fffffffffffffff;
|
387
|
+
if (unlikely(a > 0x7ff0000000000000)) {
|
388
|
+
/* nan */
|
389
|
+
v = 0x7c01;
|
390
|
+
} else if (a < 0x3f10000000000000) { /* 0x1p-14 */
|
391
|
+
/* subnormal f16 number or zero */
|
392
|
+
if (a <= 0x3e60000000000000) { /* 0x1p-25 */
|
393
|
+
v = 0x0000; /* zero */
|
394
|
+
} else {
|
395
|
+
shift = 1051 - (a >> 52);
|
396
|
+
a = ((uint64_t)1 << 52) | (a & (((uint64_t)1 << 52) - 1));
|
397
|
+
addend = ((a >> shift) & 1) + (((uint64_t)1 << (shift - 1)) - 1);
|
398
|
+
v = (a + addend) >> shift;
|
399
|
+
}
|
400
|
+
} else {
|
401
|
+
/* normal number or infinity */
|
402
|
+
a -= 0x3f00000000000000; /* adjust the exponent */
|
403
|
+
/* round */
|
404
|
+
addend = ((a >> (52 - 10)) & 1) + (((uint64_t)1 << (52 - 11)) - 1);
|
405
|
+
v = (a + addend) >> (52 - 10);
|
406
|
+
/* overflow ? */
|
407
|
+
if (unlikely(v > 0x7c00))
|
408
|
+
v = 0x7c00;
|
409
|
+
}
|
410
|
+
return v | (sgn << 15);
|
411
|
+
}
|
412
|
+
|
413
|
+
static inline int isfp16nan(uint16_t v)
|
414
|
+
{
|
415
|
+
return (v & 0x7FFF) > 0x7C00;
|
416
|
+
}
|
417
|
+
|
418
|
+
static inline int isfp16zero(uint16_t v)
|
419
|
+
{
|
420
|
+
return (v & 0x7FFF) == 0;
|
421
|
+
}
|
422
|
+
|
367
423
|
#endif /* CUTILS_H */
|
@@ -26,11 +26,15 @@
|
|
26
26
|
|
27
27
|
DEF(invalid, 1) /* never used */
|
28
28
|
DEF(char, 3)
|
29
|
+
DEF(char_i, 3)
|
29
30
|
DEF(char32, 5)
|
31
|
+
DEF(char32_i, 5)
|
30
32
|
DEF(dot, 1)
|
31
33
|
DEF(any, 1) /* same as dot but match any character including line terminator */
|
32
34
|
DEF(line_start, 1)
|
35
|
+
DEF(line_start_m, 1)
|
33
36
|
DEF(line_end, 1)
|
37
|
+
DEF(line_end_m, 1)
|
34
38
|
DEF(goto, 5)
|
35
39
|
DEF(split_goto_first, 5)
|
36
40
|
DEF(split_next_first, 5)
|
@@ -42,11 +46,17 @@ DEF(loop, 5) /* decrement the top the stack and goto if != 0 */
|
|
42
46
|
DEF(push_i32, 5) /* push integer on the stack */
|
43
47
|
DEF(drop, 1)
|
44
48
|
DEF(word_boundary, 1)
|
49
|
+
DEF(word_boundary_i, 1)
|
45
50
|
DEF(not_word_boundary, 1)
|
51
|
+
DEF(not_word_boundary_i, 1)
|
46
52
|
DEF(back_reference, 2)
|
47
|
-
DEF(
|
53
|
+
DEF(back_reference_i, 2) /* must come after */
|
54
|
+
DEF(backward_back_reference, 2) /* must come after */
|
55
|
+
DEF(backward_back_reference_i, 2) /* must come after */
|
48
56
|
DEF(range, 3) /* variable length */
|
57
|
+
DEF(range_i, 3) /* variable length */
|
49
58
|
DEF(range32, 3) /* variable length */
|
59
|
+
DEF(range32_i, 3) /* variable length */
|
50
60
|
DEF(lookahead, 5)
|
51
61
|
DEF(negative_lookahead, 5)
|
52
62
|
DEF(push_char_pos, 1) /* push the character position on the stack */
|