From 2f9a815e148bdc7a532aa86c1df0de734e3619c7 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 9 Jan 2025 11:42:30 +0100 Subject: [PATCH] Replace gc() calls in staging/sm/ Ref. #4376 --- .../sm/extensions/ArrayBuffer-slice-arguments-detaching.js | 4 ++-- .../sm/extensions/DataView-construct-arguments-detaching.js | 4 ++-- .../sm/extensions/DataView-set-arguments-detaching.js | 4 ++-- test/staging/sm/extensions/dataview.js | 2 +- test/staging/sm/extensions/recursion.js | 2 +- test/staging/sm/extensions/regress-650753.js | 2 +- test/staging/sm/extensions/typedarray-set-detach.js | 2 +- test/staging/sm/extensions/weakmap.js | 4 ++-- test/staging/sm/generators/gen-with-call-obj.js | 6 +++--- test/staging/sm/generators/iteration.js | 2 +- test/staging/sm/object/clear-dictionary-accessor-getset.js | 2 +- test/staging/sm/regress/regress-1507322-deep-weakmap.js | 2 +- test/staging/sm/regress/regress-592556-c35.js | 2 +- test/staging/sm/regress/regress-596103.js | 4 ++-- .../sm/statements/for-in-with-gc-and-unvisited-deletion.js | 6 +++--- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/staging/sm/extensions/ArrayBuffer-slice-arguments-detaching.js b/test/staging/sm/extensions/ArrayBuffer-slice-arguments-detaching.js index 698303c08d7..d7f1f427e4e 100644 --- a/test/staging/sm/extensions/ArrayBuffer-slice-arguments-detaching.js +++ b/test/staging/sm/extensions/ArrayBuffer-slice-arguments-detaching.js @@ -33,7 +33,7 @@ function testStart() valueOf: function() { $262.detachArrayBuffer(ab); - gc(); + $262.gc(); return 0x800; } }; @@ -61,7 +61,7 @@ function testEnd() valueOf: function() { $262.detachArrayBuffer(ab); - gc(); + $262.gc(); return 0x1000; } }; diff --git a/test/staging/sm/extensions/DataView-construct-arguments-detaching.js b/test/staging/sm/extensions/DataView-construct-arguments-detaching.js index a5f9d93a64a..b74b411f1ef 100644 --- a/test/staging/sm/extensions/DataView-construct-arguments-detaching.js +++ b/test/staging/sm/extensions/DataView-construct-arguments-detaching.js @@ -33,7 +33,7 @@ function testByteOffset() valueOf: function() { $262.detachArrayBuffer(ab); - gc(); + $262.gc(); return 0x800; } }; @@ -61,7 +61,7 @@ function testByteLength() valueOf: function() { $262.detachArrayBuffer(ab); - gc(); + $262.gc(); return 0x800; } }; diff --git a/test/staging/sm/extensions/DataView-set-arguments-detaching.js b/test/staging/sm/extensions/DataView-set-arguments-detaching.js index f44775b359b..c008df36dea 100644 --- a/test/staging/sm/extensions/DataView-set-arguments-detaching.js +++ b/test/staging/sm/extensions/DataView-set-arguments-detaching.js @@ -35,7 +35,7 @@ function testIndex() valueOf: function() { $262.detachArrayBuffer(ab); - gc(); + $262.gc(); return 0xFFF; } }; @@ -65,7 +65,7 @@ function testValue() valueOf: function() { $262.detachArrayBuffer(ab); - gc(); + $262.gc(); return 0x42; } }; diff --git a/test/staging/sm/extensions/dataview.js b/test/staging/sm/extensions/dataview.js index a55a8891d7d..a13bedfc17c 100644 --- a/test/staging/sm/extensions/dataview.js +++ b/test/staging/sm/extensions/dataview.js @@ -1637,7 +1637,7 @@ function test(sharedMem) { var ab = new ArrayBuffer(4); var dv = new DataView(ab); dv = 1; - gc(); + $262.gc(); // Bug 1438569. dv = new DataView(new ArrayBuffer(20 * 1024 * 1024)); diff --git a/test/staging/sm/extensions/recursion.js b/test/staging/sm/extensions/recursion.js index 2e60b28a5a5..9c1718ab04e 100644 --- a/test/staging/sm/extensions/recursion.js +++ b/test/staging/sm/extensions/recursion.js @@ -51,7 +51,7 @@ function test() } catch (e) { - gc(); + $262.gc(); } } foopy(); diff --git a/test/staging/sm/extensions/regress-650753.js b/test/staging/sm/extensions/regress-650753.js index 30b8013e74e..d15bf92d78c 100644 --- a/test/staging/sm/extensions/regress-650753.js +++ b/test/staging/sm/extensions/regress-650753.js @@ -13,5 +13,5 @@ esid: pending ---*/ var x = {}, h = new WeakMap; h.set(x, null); -gc(); +$262.gc(); diff --git a/test/staging/sm/extensions/typedarray-set-detach.js b/test/staging/sm/extensions/typedarray-set-detach.js index 39722d78048..f9b7738e065 100644 --- a/test/staging/sm/extensions/typedarray-set-detach.js +++ b/test/staging/sm/extensions/typedarray-set-detach.js @@ -40,7 +40,7 @@ var src = [ 10, 20, 30, 40, Object.defineProperty(src, 4, { get: function () { $262.detachArrayBuffer(ab); - gc(); + $262.gc(); return 200; } }); diff --git a/test/staging/sm/extensions/weakmap.js b/test/staging/sm/extensions/weakmap.js index 797ac5896cf..a88a08e4a2d 100644 --- a/test/staging/sm/extensions/weakmap.js +++ b/test/staging/sm/extensions/weakmap.js @@ -94,7 +94,7 @@ function test() check(() => typeof map.get({}) == "undefined"); check(() => map.get({}, "foo") == undefined); - gc(); gc(); gc(); + $262.gc(); $262.gc(); $262.gc(); check(() => map.get(key) == 42); check(() => map.delete(key) == true); @@ -107,7 +107,7 @@ function test() var value = { }; check(() => map.set(new Object(), value) === map); - gc(); gc(); gc(); + $262.gc(); $262.gc(); $262.gc(); check(() => map.has("non-object key") == false); check(() => map.has() == false); diff --git a/test/staging/sm/generators/gen-with-call-obj.js b/test/staging/sm/generators/gen-with-call-obj.js index 878ed6f3839..7855d63a15b 100644 --- a/test/staging/sm/generators/gen-with-call-obj.js +++ b/test/staging/sm/generators/gen-with-call-obj.js @@ -37,10 +37,10 @@ f2(10); // now observe gen's call object (which should have been put) -gc(); +$262.gc(); assert.sameValue(foo(), 10); -gc(); +$262.gc(); assert.sameValue(foo(), 11); -gc(); +$262.gc(); assert.sameValue(foo(), 12); diff --git a/test/staging/sm/generators/iteration.js b/test/staging/sm/generators/iteration.js index 06ee0b416f9..788bc94fa05 100644 --- a/test/staging/sm/generators/iteration.js +++ b/test/staging/sm/generators/iteration.js @@ -213,7 +213,7 @@ TestGenerator( // GC. if (typeof gc == 'function') { - TestGenerator(function* g16() { yield "baz"; gc(); yield "qux"; }, + TestGenerator(function* g16() { yield "baz"; $262.gc(); yield "qux"; }, ["baz", "qux", undefined], "foo", ["baz", "qux", undefined]); diff --git a/test/staging/sm/object/clear-dictionary-accessor-getset.js b/test/staging/sm/object/clear-dictionary-accessor-getset.js index 71d1eb9f6b1..5dc0e0c5e95 100644 --- a/test/staging/sm/object/clear-dictionary-accessor-getset.js +++ b/test/staging/sm/object/clear-dictionary-accessor-getset.js @@ -49,7 +49,7 @@ function test(field) } inner(); - gc(); // In unfixed code, this crashes trying to mark a null [[field]]. + $262.gc(); // In unfixed code, this crashes trying to mark a null [[field]]. } test("get"); diff --git a/test/staging/sm/regress/regress-1507322-deep-weakmap.js b/test/staging/sm/regress/regress-1507322-deep-weakmap.js index aa7e3a309e3..7f8b42cbb4a 100644 --- a/test/staging/sm/regress/regress-1507322-deep-weakmap.js +++ b/test/staging/sm/regress/regress-1507322-deep-weakmap.js @@ -14,7 +14,7 @@ function TestGC2(m) { for (key = head, i = 0; i < 99999; i++, key = m.get(key)) { m.set(key, new Object); } - gc(); + $262.gc(); for (key = head; key != undefined; key = m.get(key)) {} } TestGC2(new WeakMap); diff --git a/test/staging/sm/regress/regress-592556-c35.js b/test/staging/sm/regress/regress-592556-c35.js index 845e098e79e..da8cd8700fc 100644 --- a/test/staging/sm/regress/regress-592556-c35.js +++ b/test/staging/sm/regress/regress-592556-c35.js @@ -23,7 +23,7 @@ for (var i = 3; i < 20; i++) delete obj.g; // must update lastProp->freeslot, to avoid assertion // extra junk to try to hit the assertion, if freeslot is not updated -gc(); +$262.gc(); obj.d = 3; obj.e = 4; diff --git a/test/staging/sm/regress/regress-596103.js b/test/staging/sm/regress/regress-596103.js index 51ed963220f..bec8f392f72 100644 --- a/test/staging/sm/regress/regress-596103.js +++ b/test/staging/sm/regress/regress-596103.js @@ -14,8 +14,8 @@ esid: pending for (var u = 0; u < 3; ++u) { var y = []; Object.create(y); - gc(); + $262.gc(); y.t = 3; - gc(); + $262.gc(); } diff --git a/test/staging/sm/statements/for-in-with-gc-and-unvisited-deletion.js b/test/staging/sm/statements/for-in-with-gc-and-unvisited-deletion.js index 16aa5620de0..3879c713df3 100644 --- a/test/staging/sm/statements/for-in-with-gc-and-unvisited-deletion.js +++ b/test/staging/sm/statements/for-in-with-gc-and-unvisited-deletion.js @@ -34,7 +34,7 @@ function testOneDeletion() for (var i in o) { - gc(); + $262.gc(); delete o.s; } } @@ -51,7 +51,7 @@ function testTwoDeletions() for (var i in o) { - gc(); + $262.gc(); delete o.t; delete o.s; } @@ -70,7 +70,7 @@ function testThreeDeletions() for (var i in o) { - gc(); + $262.gc(); delete o.x; delete o.t; delete o.s;