summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/gc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/jit-test/tests/gc
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/gc')
-rw-r--r--js/src/jit-test/tests/gc/bug-1651001-1.js9
-rw-r--r--js/src/jit-test/tests/gc/bug-1651001-2.js6
-rw-r--r--js/src/jit-test/tests/gc/bug-1890670.js12
-rw-r--r--js/src/jit-test/tests/gc/bug-1892564.js50
-rw-r--r--js/src/jit-test/tests/gc/bug-1893984.js3
-rw-r--r--js/src/jit-test/tests/gc/bug-1894025.js15
-rw-r--r--js/src/jit-test/tests/gc/bug-1894442.js6
-rw-r--r--js/src/jit-test/tests/gc/bug-1894547.js14
-rw-r--r--js/src/jit-test/tests/gc/bug-1895842.js5
-rw-r--r--js/src/jit-test/tests/gc/marking-thread-count.js20
10 files changed, 133 insertions, 7 deletions
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);
}