From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- js/src/jit-test/tests/gc/bug-1651001-1.js | 9 +++++ js/src/jit-test/tests/gc/bug-1651001-2.js | 6 +++ js/src/jit-test/tests/gc/bug-1890670.js | 12 ++++++ js/src/jit-test/tests/gc/bug-1892564.js | 50 ++++++++++++++++++++++++ js/src/jit-test/tests/gc/bug-1893984.js | 3 ++ js/src/jit-test/tests/gc/bug-1894025.js | 15 +++++++ js/src/jit-test/tests/gc/bug-1894442.js | 6 +++ js/src/jit-test/tests/gc/bug-1894547.js | 14 +++++++ js/src/jit-test/tests/gc/bug-1895842.js | 5 +++ js/src/jit-test/tests/gc/marking-thread-count.js | 20 ++++++---- 10 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 js/src/jit-test/tests/gc/bug-1651001-1.js create mode 100644 js/src/jit-test/tests/gc/bug-1651001-2.js create mode 100644 js/src/jit-test/tests/gc/bug-1890670.js create mode 100644 js/src/jit-test/tests/gc/bug-1892564.js create mode 100644 js/src/jit-test/tests/gc/bug-1893984.js create mode 100644 js/src/jit-test/tests/gc/bug-1894025.js create mode 100644 js/src/jit-test/tests/gc/bug-1894442.js create mode 100644 js/src/jit-test/tests/gc/bug-1894547.js create mode 100644 js/src/jit-test/tests/gc/bug-1895842.js (limited to 'js/src/jit-test/tests/gc') diff --git a/js/src/jit-test/tests/gc/bug-1651001-1.js b/js/src/jit-test/tests/gc/bug-1651001-1.js new file mode 100644 index 0000000000..889ab4a5b9 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1651001-1.js @@ -0,0 +1,9 @@ +gczeal(0); +try { + v2 = (x = []); + g1 = newGlobal({ sameZoneAs: x }); + enableShellAllocationMetadataBuilder(); + g1.Uint8ClampedArray.prototype = b1; +} catch(e) {} +startgc(9); +recomputeWrappers(); diff --git a/js/src/jit-test/tests/gc/bug-1651001-2.js b/js/src/jit-test/tests/gc/bug-1651001-2.js new file mode 100644 index 0000000000..ad093ddb22 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1651001-2.js @@ -0,0 +1,6 @@ +gczeal(0); +g1 = newGlobal({ sameZoneAs: this }); +enableShellAllocationMetadataBuilder(); +g1.Object; +startgc(1); +recomputeWrappers(); diff --git a/js/src/jit-test/tests/gc/bug-1890670.js b/js/src/jit-test/tests/gc/bug-1890670.js new file mode 100644 index 0000000000..e73c5a99e6 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1890670.js @@ -0,0 +1,12 @@ +// |jit-test| --enable-symbols-as-weakmap-keys; skip-if: getBuildConfiguration("release_or_beta") + +gczeal(0); +let wm = new WeakMap(); +let s = Symbol(); +wm.set(s, new WeakMap()); +let ss = Symbol(); +wm.get(s).set(this, ss); +let wm2 = new WeakMap(); +wm2.set(ss, "test"); +ss = null; +gc(); diff --git a/js/src/jit-test/tests/gc/bug-1892564.js b/js/src/jit-test/tests/gc/bug-1892564.js new file mode 100644 index 0000000000..c834615b91 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1892564.js @@ -0,0 +1,50 @@ +try { evalInWorker(` +gczeal(0); +try { + Object.defineProperty(this, "x", { + value:{ + parseInt: parseInt, + } + }); +} catch(exc) {} +function dummyAssertCallFunction(f) {} +try { evaluate(\` +(function(global) { + var ObjectCreate = global.Object.create; + var ObjectDefineProperty = global.Object.defineProperty; + function ArrayPush(arr, val) { + var desc = ObjectCreate(null); + desc.value = val; + desc.enumerable = true; + desc.configurable = true; + desc.writable = true; + ObjectDefineProperty(arr, arr.length, desc); + } + var testCasesArray = []; + function TestCase(d, e, a, r) { + this.description = d; + ArrayPush(testCasesArray, this); + } + global.TestCase = TestCase; +})(this); +(function f42(x99) { + new TestCase(new ArrayBuffer()); + f42(x99) + function t9() {} +})(); +\`); } catch(exc) {} +try { evaluate(\` +gczeal(14); +(function(global) { + global.makeIterator = function makeIterator(overrides) { + global.assertThrowsValue = function assertThrowsValue(f, val, msg) {}; + } + global.assertDeepEq = (function(){ + var call = Function.prototype.call, + Symbol_description = call.bind(Object.getOwnPropertyDescriptor(Symbol.prototype, "description").get), + Map_has = call.bind(Map.prototype.has), + Object_getOwnPropertyNames = Object.getOwnPropertyNames; + })(); +})(this); +\`); } catch(exc) {} +`); throw "x"; } catch(exc) {} diff --git a/js/src/jit-test/tests/gc/bug-1893984.js b/js/src/jit-test/tests/gc/bug-1893984.js new file mode 100644 index 0000000000..743be86f4e --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1893984.js @@ -0,0 +1,3 @@ +gczeal(4, 0) +a = /b/ +Object.defineProperty(a, this + this, {}) diff --git a/js/src/jit-test/tests/gc/bug-1894025.js b/js/src/jit-test/tests/gc/bug-1894025.js new file mode 100644 index 0000000000..06ebd8ceb6 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1894025.js @@ -0,0 +1,15 @@ +gczeal(0); + +var ex; +function makeExtensibleStrFrom() { + strstrstr; +} +a = makeExtensibleStrFrom; +b = newDependentString(a, 0, 50, { tenured: false }) +var exc; +try { + c = newDependentString(b, 0, { tenured: true }) +} catch (e) { + exc = e; +} +assertEq(Boolean(exc), true, "b and c required to be in different heaps but are the same"); diff --git a/js/src/jit-test/tests/gc/bug-1894442.js b/js/src/jit-test/tests/gc/bug-1894442.js new file mode 100644 index 0000000000..93bedb74de --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1894442.js @@ -0,0 +1,6 @@ +// |jit-test| --enable-symbols-as-weakmap-keys; skip-if: helperThreadCount() === 0 || getBuildConfiguration("release_or_beta") +evalInWorker(` + a = new WeakSet + a.add(Symbol.hasInstance) + gczeal(14)(0 .b) +`) diff --git a/js/src/jit-test/tests/gc/bug-1894547.js b/js/src/jit-test/tests/gc/bug-1894547.js new file mode 100644 index 0000000000..78a3cff036 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1894547.js @@ -0,0 +1,14 @@ +// |jit-test| --enable-symbols-as-weakmap-keys; skip-if: getBuildConfiguration("release_or_beta") + +gczeal(0); +let wm = new WeakMap(); +let s = {}; +wm.set(s, new WeakMap()); +let ss = {x: Symbol()}; +wm.get(s).set(this, ss); +let wm2 = new WeakMap(); +wm2.set(ss, "test"); +ss = null; + +// Collect only this zone and not the zone containing the symbol. +gc({}); diff --git a/js/src/jit-test/tests/gc/bug-1895842.js b/js/src/jit-test/tests/gc/bug-1895842.js new file mode 100644 index 0000000000..3f41d10020 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1895842.js @@ -0,0 +1,5 @@ +// |jit-test| skip-if: helperThreadCount() === 0 +evalInWorker(` + enqueueMark("drain") + startgc() +`) diff --git a/js/src/jit-test/tests/gc/marking-thread-count.js b/js/src/jit-test/tests/gc/marking-thread-count.js index 5b90e14186..3c2f7ed30d 100644 --- a/js/src/jit-test/tests/gc/marking-thread-count.js +++ b/js/src/jit-test/tests/gc/marking-thread-count.js @@ -1,12 +1,18 @@ // |jit-test| skip-if: helperThreadCount() === 0 -let initialGCHelperThreadCount = gcparam('helperThreadCount'); +// Allow maximum number of helper threads +gcparam('maxHelperThreads', 8); +gcparam('helperThreadRatio', 100); + +check(); -let prevHelperThreadCount = helperThreadCount(); for (let i of [0, 1, 4, 8, 4, 0]) { - gcparam('markingThreadCount', i); - assertEq(gcparam('markingThreadCount'), i); - assertEq(gcparam('helperThreadCount'), initialGCHelperThreadCount); - assertEq(true, helperThreadCount() >= Math.max(prevHelperThreadCount, i)); - prevHelperThreadCount = helperThreadCount(); + gcparam('maxMarkingThreads', i); + assertEq(gcparam('maxMarkingThreads'), i); + check(); +} + +function check() { + assertEq(gcparam('markingThreadCount') <= gcparam('maxMarkingThreads'), true); + assertEq(gcparam('markingThreadCount') < gcparam('helperThreadCount'), true); } -- cgit v1.2.3