diff --git a/implementation-contributed/curation_logs/javascriptcore.json b/implementation-contributed/curation_logs/javascriptcore.json index face9658cde9e220d3fb9159fe0053489bb2d9b1..27203617a905ccf722c8170cfeb1dc86049917ec 100644 --- a/implementation-contributed/curation_logs/javascriptcore.json +++ b/implementation-contributed/curation_logs/javascriptcore.json @@ -1,6 +1,6 @@ { - "sourceRevisionAtLastExport": "205489c4f0", - "targetRevisionAtLastExport": "cab19d71a6", + "sourceRevisionAtLastExport": "2b233fa3c0", + "targetRevisionAtLastExport": "8e3c6d0484", "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-branch-usage.js b/implementation-contributed/javascriptcore/stress/big-int-branch-usage.js new file mode 100644 index 0000000000000000000000000000000000000000..fa6125f0dbe318551d1429dc91140a5e62e94fa7 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/big-int-branch-usage.js @@ -0,0 +1,23 @@ +//@ runBigIntEnabled + +function assert(a, e) { + if (a !== e) { + throw new Error("Bad!"); + } +} + +function branchTest(a) { + if (a) + return a; + else + return false; +} +noInline(branchTest); + +for (let i = 0; i < 100000; i++) { + assert(branchTest(10n), 10n); + assert(branchTest(1n), 1n); + assert(branchTest(0n), false); + assert(branchTest(-1n), -1n); +} + diff --git a/implementation-contributed/javascriptcore/stress/big-int-logical-and.js b/implementation-contributed/javascriptcore/stress/big-int-logical-and.js new file mode 100644 index 0000000000000000000000000000000000000000..619b866ea8cda3a005f773d9c98db57ca72637ef --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/big-int-logical-and.js @@ -0,0 +1,20 @@ +//@ runBigIntEnabled + +function assert(a, e) { + if (a !== e) { + throw new Error("Bad!"); + } +} + +function logicalAnd(a, b) { + return a && b; +} +noInline(logicalAnd); + +for (let i = 0; i < 100000; i++) { + assert(logicalAnd(1n, 10n), 10n); + assert(logicalAnd(1n, 1n), 1n); + assert(logicalAnd(1n, 0n), 0n); + assert(logicalAnd(1n, -1n), -1n); +} + diff --git a/implementation-contributed/javascriptcore/stress/big-int-logical-not.js b/implementation-contributed/javascriptcore/stress/big-int-logical-not.js new file mode 100644 index 0000000000000000000000000000000000000000..af28a72b1c3548af6044c1a82e48c4d7788595f4 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/big-int-logical-not.js @@ -0,0 +1,20 @@ +//@ runBigIntEnabled + +function assert(a, e) { + if (a !== e) { + throw new Error("Bad!"); + } +} + +function logicalNot(a) { + return !a; +} +noInline(logicalNot); + +for (let i = 0; i < 100000; i++) { + assert(logicalNot(10n), false); + assert(logicalNot(1n), false); + assert(logicalNot(0n), true); + assert(logicalNot(-1n), false); +} + diff --git a/implementation-contributed/javascriptcore/stress/big-int-logical-or.js b/implementation-contributed/javascriptcore/stress/big-int-logical-or.js new file mode 100644 index 0000000000000000000000000000000000000000..36a2d344562933a03ef2e04ce40c67da67da4139 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/big-int-logical-or.js @@ -0,0 +1,20 @@ +//@ runBigIntEnabled + +function assert(a, e) { + if (a !== e) { + throw new Error("Bad!"); + } +} + +function logicalOr(a, b) { + return a || b; +} +noInline(logicalOr); + +for (let i = 0; i < 100000; i++) { + assert(logicalOr(10n, "abc"), 10n); + assert(logicalOr(1n, "abc"), 1n); + assert(logicalOr(0n, "abc"), "abc"); + assert(logicalOr(-1n, "abc"), -1n); +} + diff --git a/implementation-contributed/javascriptcore/stress/big-wasm-memory-grow-no-max.js b/implementation-contributed/javascriptcore/stress/big-wasm-memory-grow-no-max.js index 66d12c8c2ea6ae53eafdfd43be7ad64dc5196e8a..5b80dca1822ec2c14da4de44621dc20ce5d46ddd 100644 --- a/implementation-contributed/javascriptcore/stress/big-wasm-memory-grow-no-max.js +++ b/implementation-contributed/javascriptcore/stress/big-wasm-memory-grow-no-max.js @@ -1,34 +1,45 @@ //@ skip if $memoryLimited -let bigArray = new Array(0x7000000); -bigArray[0] = 1.1; -bigArray[1] = 1.2; -function foo(array) { - var index = array.length; - if (index >= bigArray.length || (index - 0x1ffdc01) < 0) +function test() { + + // We don't support WebAssembly everywhere, so check for its existance before doing anything else. + if (!this.WebAssembly) return; - return bigArray[index - 0x1ffdc01]; -} -noInline(foo); + let bigArray = new Array(0x7000000); + bigArray[0] = 1.1; + bigArray[1] = 1.2; + + function foo(array) { + var index = array.length; + if (index >= bigArray.length || (index - 0x1ffdc01) < 0) + return; + return bigArray[index - 0x1ffdc01]; + } + + noInline(foo); + + var okArray = new Uint8Array(0x1ffdc02); + + for (var i = 0; i < 10000; ++i) + foo(okArray); -var okArray = new Uint8Array(0x1ffdc02); + var ok = false; + try { + var memory = new WebAssembly.Memory({ initial: 0x1000 }); + memory.grow(0x7000); + var result = foo(new Uint8Array(memory.buffer)); + if (result !== void 0) + throw "Error: bad result at end: " + result; + ok = true; + } catch (e) { + if (e.toString() != "Error: Out of memory") + throw e; + } -for (var i = 0; i < 10000; ++i) - foo(okArray); + if (ok) + throw "Error: did not throw error"; -var ok = false; -try { - var memory = new WebAssembly.Memory({ initial: 0x1000 }); - memory.grow(0x7000); - var result = foo(new Uint8Array(memory.buffer)); - if (result !== void 0) - throw "Error: bad result at end: " + result; - ok = true; -} catch (e) { - if (e.toString() != "Error: Out of memory") - throw e; } -if (ok) - throw "Error: did not throw error"; +test(); diff --git a/implementation-contributed/javascriptcore/stress/big-wasm-memory-grow.js b/implementation-contributed/javascriptcore/stress/big-wasm-memory-grow.js index 418557a47a0ba8a9565da59160203fbe7ccb9dab..0e43577332e68887b94caed3c2db36e52876324e 100644 --- a/implementation-contributed/javascriptcore/stress/big-wasm-memory-grow.js +++ b/implementation-contributed/javascriptcore/stress/big-wasm-memory-grow.js @@ -1,34 +1,45 @@ //@ skip if $memoryLimited -let bigArray = new Array(0x7000000); -bigArray[0] = 1.1; -bigArray[1] = 1.2; -function foo(array) { - var index = array.length; - if (index >= bigArray.length || (index - 0x1ffdc01) < 0) +function test() { + + // We don't support WebAssembly everywhere, so check for its existance before doing anything else. + if (!this.WebAssembly) return; - return bigArray[index - 0x1ffdc01]; -} -noInline(foo); + let bigArray = new Array(0x7000000); + bigArray[0] = 1.1; + bigArray[1] = 1.2; + + function foo(array) { + var index = array.length; + if (index >= bigArray.length || (index - 0x1ffdc01) < 0) + return; + return bigArray[index - 0x1ffdc01]; + } + + noInline(foo); + + var okArray = new Uint8Array(0x1ffdc02); + + for (var i = 0; i < 10000; ++i) + foo(okArray); -var okArray = new Uint8Array(0x1ffdc02); + var ok = false; + try { + var memory = new WebAssembly.Memory({ initial: 0x1000, maximum: 0x8000 }); + memory.grow(0x7000); + var result = foo(new Uint8Array(memory.buffer)); + if (result !== void 0) + throw "Error: bad result at end: " + result; + ok = true; + } catch (e) { + if (e.toString() != "Error: Out of memory") + throw e; + } -for (var i = 0; i < 10000; ++i) - foo(okArray); + if (ok) + throw "Error: did not throw error"; -var ok = false; -try { - var memory = new WebAssembly.Memory({ initial: 0x1000, maximum: 0x8000 }); - memory.grow(0x7000); - var result = foo(new Uint8Array(memory.buffer)); - if (result !== void 0) - throw "Error: bad result at end: " + result; - ok = true; -} catch (e) { - if (e.toString() != "Error: Out of memory") - throw e; } -if (ok) - throw "Error: did not throw error"; +test(); diff --git a/implementation-contributed/javascriptcore/stress/big-wasm-memory.js b/implementation-contributed/javascriptcore/stress/big-wasm-memory.js index d4deda4d38e0b7e32c72afdc24f5a1cd0ea42622..1afad7aedc6b8d0516852063ad9cb4bd4e442caf 100644 --- a/implementation-contributed/javascriptcore/stress/big-wasm-memory.js +++ b/implementation-contributed/javascriptcore/stress/big-wasm-memory.js @@ -1,32 +1,43 @@ //@ skip if $memoryLimited -let bigArray = new Array(0x7000000); -bigArray[0] = 1.1; -bigArray[1] = 1.2; -function foo(array) { - var index = array.length; - if (index >= bigArray.length || (index - 0x1ffdc01) < 0) +function test() { + + // We don't support WebAssembly everywhere, so check for its existance before doing anything else. + if (!this.WebAssembly) return; - return bigArray[index - 0x1ffdc01]; -} -noInline(foo); + let bigArray = new Array(0x7000000); + bigArray[0] = 1.1; + bigArray[1] = 1.2; + + function foo(array) { + var index = array.length; + if (index >= bigArray.length || (index - 0x1ffdc01) < 0) + return; + return bigArray[index - 0x1ffdc01]; + } + + noInline(foo); + + var okArray = new Uint8Array(0x1ffdc02); + + for (var i = 0; i < 10000; ++i) + foo(okArray); -var okArray = new Uint8Array(0x1ffdc02); + var ok = false; + try { + var result = foo(new Uint8Array(new WebAssembly.Memory({ initial: 0x8000, maximum: 0x8000 }).buffer)); + if (result !== void 0) + throw "Error: bad result at end: " + result; + ok = true; + } catch (e) { + if (e.toString() != "Error: Out of memory") + throw e; + } -for (var i = 0; i < 10000; ++i) - foo(okArray); + if (ok) + throw "Error: did not throw error"; -var ok = false; -try { - var result = foo(new Uint8Array(new WebAssembly.Memory({ initial: 0x8000, maximum: 0x8000 }).buffer)); - if (result !== void 0) - throw "Error: bad result at end: " + result; - ok = true; -} catch (e) { - if (e.toString() != "Error: Out of memory") - throw e; } -if (ok) - throw "Error: did not throw error"; +test(); diff --git a/implementation-contributed/javascriptcore/stress/regress-192386.js b/implementation-contributed/javascriptcore/stress/regress-192386.js new file mode 100644 index 0000000000000000000000000000000000000000..26276e053e35aa4c7309a2482c8074a6e23cf8a6 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/regress-192386.js @@ -0,0 +1,12 @@ +//@ requireOptions("--jitPolicyScale=0") + +function foo(x) { + try { + new x(); + } catch { + } +} + +foo(function() {}); +for (let i = 0; i < 10000; ++i) + foo(() => undefined); diff --git a/implementation-contributed/javascriptcore/stress/regress-192441.js b/implementation-contributed/javascriptcore/stress/regress-192441.js new file mode 100644 index 0000000000000000000000000000000000000000..e56d11a4d22287211377a21eb12a0985aed21fb4 --- /dev/null +++ b/implementation-contributed/javascriptcore/stress/regress-192441.js @@ -0,0 +1,12 @@ +//@ requireOptions("--jitPolicyScale=0") + +// This test passes if it does not crash. + +let x = {} +let enUS = ['en', 'US'].join('-') +for (let i=0; i<100; i++) { + Intl.NumberFormat(enUS) +} +for (let i=0; i<10000; i++) { + x[enUS] +};