diff --git a/implementation-contributed/curation_logs/javascriptcore.json b/implementation-contributed/curation_logs/javascriptcore.json index bbcb6a547fd8227f3da9c3fa09e179a9f8767f06..237c971e9b0fc3a0d25a4734b66376d5fcefe8ab 100644 --- a/implementation-contributed/curation_logs/javascriptcore.json +++ b/implementation-contributed/curation_logs/javascriptcore.json @@ -1,6 +1,6 @@ { - "sourceRevisionAtLastExport": "5ec2ecf1e4", - "targetRevisionAtLastExport": "81663e4556", + "sourceRevisionAtLastExport": "b85a66fba6", + "targetRevisionAtLastExport": "6059c1c526", "curatedFiles": { "/stress/Number-isNaN-basics.js": "DELETED_IN_TARGET", "/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js": "DELETED_IN_TARGET", diff --git a/implementation-contributed/javascriptcore/stress/big-int-negate-jit.js b/implementation-contributed/javascriptcore/stress/big-int-negate-jit.js new file mode 100644 index 0000000000000000000000000000000000000000..6baa8e7ba0f06f92aa283523d249fe4717e8ea27 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/big-int-negate-jit.js @@ -0,0 +1,48 @@ +//@ skip if not $jitTests +//@ runBigIntEnabled + +function assert(a, b) { + if (a !== b) + throw new Error("Bad!"); +} + +function negateBigInt(n) { + return -n; +} +noInline(negateBigInt); + +for (let i = 0; i < 100000; i++) { + assert(negateBigInt(100n), -100n); + assert(negateBigInt(-0x1fffffffffffff01n), 0x1fffffffffffff01n); +} + +if (numberOfDFGCompiles(negateBigInt) > 1) + throw "Failed negateBigInt(). We should have compiled a single negate for the BigInt type."; + +function negateBigIntSpecializedToInt(n) { + return -n; +} +noInline(negateBigIntSpecializedToInt); + +for (let i = 0; i < 100000; i++) { + negateBigIntSpecializedToInt(100); +} + +assert(negateBigIntSpecializedToInt(100n), -100n); + +// Testing case mixing int and BigInt speculations +function mixedSpeculationNegateBigInt(n, arr) { + return -(-(-n)); +} +noInline(mixedSpeculationNegateBigInt); + +for (let i = 0; i < 100000; i++) { + if (i % 2) + assert(mixedSpeculationNegateBigInt(100), -100); + else + assert(mixedSpeculationNegateBigInt(-0x1fffffffffffff01n), 0x1fffffffffffff01n); +} + +if (numberOfDFGCompiles(mixedSpeculationNegateBigInt) > 1) + throw "Failed mixedSpeculationNegateBigInt(). We should have compiled a single negate for the BigInt type."; + diff --git a/implementation-contributed/javascriptcore/stress/value-add-big-int-and-string.js b/implementation-contributed/javascriptcore/stress/value-add-big-int-and-string.js new file mode 100644 index 0000000000000000000000000000000000000000..eb0a4ead0c1d0307aff9e5f8fca89a5c32b57523 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/value-add-big-int-and-string.js @@ -0,0 +1,18 @@ +//@ runBigIntEnabled + +function assert(v, e) { + if (v !== e) + throw new Error("Expected value: " + e + " but got: " + v) +} + +function bigIntOperations(a, b) { + let c = a + b; + return a + c; +} +noInline(bigIntOperations); + +for (let i = 0; i < 100000; i++) { + let out = bigIntOperations(0b1111n, "16"); + assert(out, "151516"); +} + diff --git a/implementation-contributed/javascriptcore/stress/value-add-big-int-prediction-propagation.js b/implementation-contributed/javascriptcore/stress/value-add-big-int-prediction-propagation.js new file mode 100644 index 0000000000000000000000000000000000000000..4463711c98035cde03fe49fabe7aac1e1df40897 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/value-add-big-int-prediction-propagation.js @@ -0,0 +1,18 @@ +//@ runBigIntEnabled + +function assert(v, e) { + if (v !== e) + throw new Error("Expected value: " + e + " but got: " + v) +} + +function bigIntPropagation(a, b) { + let c = a + b; + return c + 0n; +} +noInline(bigIntPropagation); + +for (let i = 0; i < 100000; i++) { + let out = bigIntPropagation(0xffffffffffffffffffffffffffffffn, 0x1n); + assert(out, 0x1000000000000000000000000000000n) +} + diff --git a/implementation-contributed/javascriptcore/stress/value-add-big-int-untyped.js b/implementation-contributed/javascriptcore/stress/value-add-big-int-untyped.js new file mode 100644 index 0000000000000000000000000000000000000000..02a66d3b8cd7db42019d5b7546d44b5cd176fa8c --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/value-add-big-int-untyped.js @@ -0,0 +1,26 @@ +//@ runBigIntEnabled + +function assert(v, e) { + if (v !== e) + throw new Error("Expected value: " + e + " but got: " + v) +} + +function bigIntOperations(a, b) { + let c = a + b; + return a + c; +} +noInline(bigIntOperations); + +c = 0; +let o = { valueOf: function () { + c++; + return 0b1111n; +}}; + +for (let i = 0; i < 100000; i++) { + let out = bigIntOperations(o, 0b1010n); + assert(out, 40n); +} + +assert(c, 200000); +