Skip to content

Commit

Permalink
Replace gc() calls in staging/sm/
Browse files Browse the repository at this point in the history
Ref. #4376
  • Loading branch information
Ms2ger committed Jan 15, 2025
1 parent a37cb9c commit 2f9a815
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function testStart()
valueOf: function()
{
$262.detachArrayBuffer(ab);
gc();
$262.gc();
return 0x800;
}
};
Expand Down Expand Up @@ -61,7 +61,7 @@ function testEnd()
valueOf: function()
{
$262.detachArrayBuffer(ab);
gc();
$262.gc();
return 0x1000;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function testByteOffset()
valueOf: function()
{
$262.detachArrayBuffer(ab);
gc();
$262.gc();
return 0x800;
}
};
Expand Down Expand Up @@ -61,7 +61,7 @@ function testByteLength()
valueOf: function()
{
$262.detachArrayBuffer(ab);
gc();
$262.gc();
return 0x800;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function testIndex()
valueOf: function()
{
$262.detachArrayBuffer(ab);
gc();
$262.gc();
return 0xFFF;
}
};
Expand Down Expand Up @@ -65,7 +65,7 @@ function testValue()
valueOf: function()
{
$262.detachArrayBuffer(ab);
gc();
$262.gc();
return 0x42;
}
};
Expand Down
2 changes: 1 addition & 1 deletion test/staging/sm/extensions/dataview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion test/staging/sm/extensions/recursion.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function test()
}
catch (e)
{
gc();
$262.gc();
}
}
foopy();
Expand Down
2 changes: 1 addition & 1 deletion test/staging/sm/extensions/regress-650753.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ esid: pending
---*/
var x = {}, h = new WeakMap;
h.set(x, null);
gc();
$262.gc();

2 changes: 1 addition & 1 deletion test/staging/sm/extensions/typedarray-set-detach.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var src = [ 10, 20, 30, 40,
Object.defineProperty(src, 4, {
get: function () {
$262.detachArrayBuffer(ab);
gc();
$262.gc();
return 200;
}
});
Expand Down
4 changes: 2 additions & 2 deletions test/staging/sm/extensions/weakmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions test/staging/sm/generators/gen-with-call-obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

2 changes: 1 addition & 1 deletion test/staging/sm/generators/iteration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion test/staging/sm/object/clear-dictionary-accessor-getset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion test/staging/sm/regress/regress-1507322-deep-weakmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/staging/sm/regress/regress-592556-c35.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

4 changes: 2 additions & 2 deletions test/staging/sm/regress/regress-596103.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function testOneDeletion()

for (var i in o)
{
gc();
$262.gc();
delete o.s;
}
}
Expand All @@ -51,7 +51,7 @@ function testTwoDeletions()

for (var i in o)
{
gc();
$262.gc();
delete o.t;
delete o.s;
}
Expand All @@ -70,7 +70,7 @@ function testThreeDeletions()

for (var i in o)
{
gc();
$262.gc();
delete o.x;
delete o.t;
delete o.s;
Expand Down

0 comments on commit 2f9a815

Please sign in to comment.