Bug 1518753 part 2 - Fix some jit-tests to work with same-compartment realms. r=jorendorff
authorJan de Mooij <jdemooij@mozilla.com>
Sat, 12 Jan 2019 10:48:23 +0000
changeset 453628 92f0cf276198
parent 453627 450b8f0cbb4e
child 453629 b32c2548fa6b
push id35362
push userncsoregi@mozilla.com
push dateSat, 12 Jan 2019 21:35:38 +0000
treeherdermozilla-central@877169d8ef49 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1518753
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518753 part 2 - Fix some jit-tests to work with same-compartment realms. r=jorendorff Differential Revision: https://phabricator.services.mozilla.com/D16167
js/src/jit-test/lib/assert-offset-columns.js
js/src/jit-test/lib/bytecode-cache.js
js/src/jit-test/lib/evalInFrame.js
js/src/jit-test/lib/stepping.js
js/src/jit-test/lib/wasm.js
js/src/jit-test/tests/cacheir/nukedCCW.js
js/src/jit-test/tests/debug/Debugger-debuggees-29.js
js/src/jit-test/tests/debug/Debugger-debuggees-30.js
js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-15.js
js/src/jit-test/tests/debug/Object-unwrap-03.js
js/src/jit-test/tests/debug/Source-displayURL-deprecated.js
js/src/jit-test/tests/debug/Source-displayURL.js
js/src/jit-test/tests/debug/Source-elementAttributeName.js
js/src/jit-test/tests/debug/Source-invisible.js
js/src/jit-test/tests/debug/bug-1103813.js
js/src/jit-test/tests/debug/makeGlobalObjectReference-03.js
js/src/jit-test/tests/debug/wasm-06.js
js/src/jit-test/tests/debug/wasm-09.js
js/src/jit-test/tests/debug/wasm-breakpoint.js
js/src/jit-test/tests/debug/wasm-getAllColumnOffsets.js
js/src/jit-test/tests/parser/bug-1263355-30.js
js/src/jit-test/tests/realms/basic.js
js/src/jit-test/tests/regexp/bug1445907.js
js/src/jit-test/tests/typedarray/bug1518764.js
js/src/jit-test/tests/wasm/regress/bug1440512.js
js/src/jit-test/tests/xdr/debug-lazy.js
js/src/jit-test/tests/xdr/lazy.js
js/src/jit-test/tests/xdr/relazify.js
--- a/js/src/jit-test/lib/assert-offset-columns.js
+++ b/js/src/jit-test/lib/assert-offset-columns.js
@@ -10,17 +10,17 @@
 // additional items into this string using items.push("!").
 function assertOffsetColumns(code, expectedBpts, expectedOrdering = null) {
     if (expectedOrdering === null) {
         // The default ordering simply runs the breakpoints in order.
         expectedOrdering = Array.from(expectedBpts.match(/\^/g), (_, i) => i).join(" ");
     }
 
     // Define the function `f` in a new global.
-    const global = newGlobal();
+    const global = newGlobal({newCompartment: true});
 
     const lines = code.split(/\r?\n|\r]/g);
     const initCode = lines.slice(0, -1).join("\n");
     const execCode = lines[lines.length - 1];
 
     // Treat everything but the last line as initialization code.
     global.eval(initCode);
 
--- a/js/src/jit-test/lib/bytecode-cache.js
+++ b/js/src/jit-test/lib/bytecode-cache.js
@@ -6,17 +6,18 @@ function evalWithCache(code, ctx) {
     lineNumber: { value: 0 }
   });
   code = code instanceof Object ? code : cacheEntry(code);
 
   var incremental = ctx.incremental || false;
 
   // We create a new global ...
   if (!("global" in ctx))
-    ctx.global = newGlobal({ cloneSingletons: !incremental });
+      ctx.global = newGlobal({cloneSingletons: !incremental,
+                              newCompartment: ctx.newCompartment});
 
   if (!("isRunOnce" in ctx))
     ctx.isRunOnce = true;
 
   var ctx_save;
   if (incremental)
     ctx_save = Object.create(ctx, {saveIncrementalBytecode: { value: true } });
   else
--- a/js/src/jit-test/lib/evalInFrame.js
+++ b/js/src/jit-test/lib/evalInFrame.js
@@ -1,10 +1,10 @@
 var evalInFrame = (function (global) {
-  var dbgGlobal = newGlobal();
+  var dbgGlobal = newGlobal({newCompartment: true});
   var dbg = new dbgGlobal.Debugger();
 
   return function evalInFrame(upCount, code) {
     dbg.addDebuggee(global);
 
     // Skip ourself.
     var frame = dbg.getNewestFrame().older;
     for (var i = 0; i < upCount; i++) {
--- a/js/src/jit-test/lib/stepping.js
+++ b/js/src/jit-test/lib/stepping.js
@@ -1,14 +1,14 @@
 // Test that stepping through a function stops at the expected lines.
 // `script` is a string, some JS code that evaluates to a function.
 // `expected` is the array of line numbers where stepping is expected to stop
 // when we call the function.
 function testStepping(script, expected) {
-    let g = newGlobal();
+    let g = newGlobal({newCompartment: true});
     let f = g.eval(script);
 
     let log = [];
     function maybePause(frame) {
         let previousLine = log[log.length - 1]; // note: may be undefined
         let line = frame.script.getOffsetLocation(frame.offset).lineNumber;
         if (line !== previousLine)
             log.push(line);
--- a/js/src/jit-test/lib/wasm.js
+++ b/js/src/jit-test/lib/wasm.js
@@ -124,17 +124,17 @@ function wasmFullPassI64(text, expected,
     assertEq(WebAssembly.validate(binary), true, "Must validate.");
 
     let augmentedSrc = _augmentSrc(text, [ { type: 'i64', func: '$run', args, expected } ]);
     let augmentedBinary = wasmTextToBinary(augmentedSrc);
     new WebAssembly.Instance(new WebAssembly.Module(augmentedBinary), maybeImports).exports.assert_0();
 }
 
 function wasmRunWithDebugger(wast, lib, init, done) {
-    let g = newGlobal('');
+    let g = newGlobal({newCompartment: true});
     let dbg = new Debugger(g);
 
     g.eval(`
 var wasm = wasmTextToBinary('${wast}');
 var lib = ${lib || 'undefined'};
 var m = new WebAssembly.Instance(new WebAssembly.Module(wasm), lib);`);
 
     var wasmScript = dbg.findScripts().filter(s => s.format == 'wasm')[0];
--- a/js/src/jit-test/tests/cacheir/nukedCCW.js
+++ b/js/src/jit-test/tests/cacheir/nukedCCW.js
@@ -1,10 +1,11 @@
 function testNuke() {
-    var wrapper = evaluate("({a: 15, b: {c: 42}})", {global: newGlobal({sameZoneAs: this})});
+    var wrapper = evaluate("({a: 15, b: {c: 42}})",
+                           {global: newGlobal({newCompartment: true, sameZoneAs: this})});
 
     var i, error;
     try {
         for (i = 0; i < 150; i++) {
             assertEq(wrapper.b.c, 42);
             assertEq(wrapper.a, 15);
 
             if (i == 142) {
@@ -16,17 +17,18 @@ function testNuke() {
         error = e;
     }
 
     assertEq(error.message.includes("dead object"), true);
     assertEq(i, 143);
 }
 
 function testSweep() {
-    var wrapper = evaluate("({a: 15, b: {c: 42}})", {global: newGlobal({})});
+    var wrapper = evaluate("({a: 15, b: {c: 42}})",
+                           {global: newGlobal({newCompartment: true})});
     var error;
     nukeCCW(wrapper);
     gczeal(8, 1); // Sweep zones separately
     try {
       // Next access to wrapper.b should throw.
       wrapper.x = 4;
     } catch (e) {
         error = e;
--- a/js/src/jit-test/tests/debug/Debugger-debuggees-29.js
+++ b/js/src/jit-test/tests/debug/Debugger-debuggees-29.js
@@ -1,6 +1,6 @@
 // Debugger.prototype.addDebuggee should not accept invisible-to-debugger globals.
 load(libdir + 'asserts.js');
 
-var g = newGlobal({ invisibleToDebugger: true });
+var g = newGlobal({ newCompartment: true, invisibleToDebugger: true });
 
 assertThrowsInstanceOf(() => { new Debugger(g); }, TypeError);
--- a/js/src/jit-test/tests/debug/Debugger-debuggees-30.js
+++ b/js/src/jit-test/tests/debug/Debugger-debuggees-30.js
@@ -16,17 +16,17 @@ function testAddDebuggee() {
                            "debugger and debuggee must be in different compartments");
 }
 testAddDebuggee();
 
 function testAddAllGlobalsAsDebuggees() {
     var g1 = newGlobal({sameCompartmentAs: this});
     var g2 = newGlobal();
     var g3 = newGlobal({sameCompartmentAs: g2});
-    var g4 = newGlobal({sameZoneAs: this});
+    var g4 = newGlobal({newCompartment: true, sameZoneAs: this});
     var dbg = new Debugger();
     dbg.addAllGlobalsAsDebuggees();
     assertEq(dbg.hasDebuggee(g1), false);
     assertEq(dbg.hasDebuggee(g2), true);
     assertEq(dbg.hasDebuggee(g3), true);
     assertEq(dbg.hasDebuggee(g4), true);
 }
 testAddAllGlobalsAsDebuggees();
--- a/js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-15.js
+++ b/js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-15.js
@@ -8,17 +8,18 @@ dbg.onNewGlobalObject = function (global
   log += 'n';
 }
 
 assertEq(typeof newGlobal(), "object");
 assertEq(typeof newGlobal({invisibleToDebugger: false}), "object");
 assertEq(log, 'nn');
 
 log = '';
-assertEq(typeof newGlobal({invisibleToDebugger: true}), "object");
+assertEq(typeof newGlobal({newCompartment: true, invisibleToDebugger: true}), "object");
 assertEq(log, '');
 
-assertThrowsInstanceOf(() => dbg.addDebuggee(newGlobal({invisibleToDebugger: true})), Error);
+assertThrowsInstanceOf(() => dbg.addDebuggee(newGlobal({newCompartment: true, invisibleToDebugger: true})),
+                       Error);
 
-var glob = newGlobal({invisibleToDebugger: true});
+var glob = newGlobal({newCompartment: true, invisibleToDebugger: true});
 dbg.addAllGlobalsAsDebuggees();
 dbg.onDebuggerStatement = function (frame) { assertEq(true, false); };
 glob.eval('debugger');
--- a/js/src/jit-test/tests/debug/Object-unwrap-03.js
+++ b/js/src/jit-test/tests/debug/Object-unwrap-03.js
@@ -1,14 +1,14 @@
 // Debugger.Object.prototype.unwrap should not let us see things in
 // invisible-to-Debugger compartments.
 
 load(libdir + 'asserts.js');
 
-var g = newGlobal({ invisibleToDebugger: true });
+var g = newGlobal({ newCompartment: true, invisibleToDebugger: true });
 
 var dbg = new Debugger;
 
 // Create a wrapper in our compartment for the global.
 // Note that makeGlobalObjectReference won't do: it tries to dereference as far
 // as it can go.
 var /* yo */ DOwg = dbg.makeGlobalObjectReference(this).makeDebuggeeValue(g);
 
--- a/js/src/jit-test/tests/debug/Source-displayURL-deprecated.js
+++ b/js/src/jit-test/tests/debug/Source-displayURL-deprecated.js
@@ -1,12 +1,12 @@
 /* -*- js-indent-level: 4; indent-tabs-mode: nil -*- */
 // Source.prototype.displayURL can be a string or null.
 
-let g = newGlobal('new-compartment');
+let g = newGlobal({newCompartment: true});
 let dbg = new Debugger;
 let gw = dbg.addDebuggee(g);
 
 function getDisplayURL() {
     let fw = gw.makeDebuggeeValue(g.f);
     return fw.script.source.displayURL;
 }
 
--- a/js/src/jit-test/tests/debug/Source-displayURL.js
+++ b/js/src/jit-test/tests/debug/Source-displayURL.js
@@ -1,12 +1,12 @@
 /* -*- js-indent-level: 4; indent-tabs-mode: nil -*- */
 // Source.prototype.displayURL can be a string or null.
 
-let g = newGlobal('new-compartment');
+let g = newGlobal({newCompartment: true});
 let dbg = new Debugger;
 let gw = dbg.addDebuggee(g);
 
 function getDisplayURL() {
     let fw = gw.makeDebuggeeValue(g.f);
     return fw.script.source.displayURL;
 }
 
--- a/js/src/jit-test/tests/debug/Source-elementAttributeName.js
+++ b/js/src/jit-test/tests/debug/Source-elementAttributeName.js
@@ -1,11 +1,11 @@
 // Source.prototype.elementAttributeName can be a string or undefined.
 
-var g = newGlobal('new-compartment');
+var g = newGlobal({newCompartment: true});
 var dbg = new Debugger;
 var gw = dbg.addDebuggee(g);
 g.evaluate("function f(x) { return 2*x; }", {elementAttributeName: "src"});
 var fw = gw.getOwnPropertyDescriptor('f').value;
 assertEq(fw.script.source.elementAttributeName, "src");
 g.evaluate("function f(x) { return 2*x; }");
 var fw = gw.getOwnPropertyDescriptor('f').value;
 assertEq(fw.script.source.elementAttributeName, undefined);
--- a/js/src/jit-test/tests/debug/Source-invisible.js
+++ b/js/src/jit-test/tests/debug/Source-invisible.js
@@ -1,11 +1,11 @@
 // Looking at ScriptSourceObjects in invisible-to-debugger compartments is okay.
 
-var gi = newGlobal({ invisibleToDebugger: true });
+var gi = newGlobal({ newCompartment: true, invisibleToDebugger: true });
 gi.eval('function f() {}');
 
 var gv = newGlobal();
 gv.f = gi.f;
 gv.eval('f = clone(f);');
 
 var dbg = new Debugger;
 var gvw = dbg.addDebuggee(gv);
--- a/js/src/jit-test/tests/debug/bug-1103813.js
+++ b/js/src/jit-test/tests/debug/bug-1103813.js
@@ -1,6 +1,7 @@
 // Random chosen test: js/src/jit-test/tests/debug/Source-invisible.js
 newGlobal({
+    newCompartment: true,
     invisibleToDebugger: true
 })
 // Random chosen test: js/src/jit-test/tests/debug/Debugger-findObjects-05.js
 x = (new Debugger).findObjects()
--- a/js/src/jit-test/tests/debug/makeGlobalObjectReference-03.js
+++ b/js/src/jit-test/tests/debug/makeGlobalObjectReference-03.js
@@ -1,8 +1,8 @@
 // Debugger.prototype.makeGlobalObjectReference should not accept invisible-to-debugger globals.
 load(libdir + 'asserts.js');
 
-var g = newGlobal({ invisibleToDebugger: true });
+var g = newGlobal({ newCompartment: true, invisibleToDebugger: true });
 
 assertThrowsInstanceOf(function () {
   (new Debugger).makeGlobalObjectReference(g)
 }, TypeError);
--- a/js/src/jit-test/tests/debug/wasm-06.js
+++ b/js/src/jit-test/tests/debug/wasm-06.js
@@ -1,15 +1,15 @@
 // |jit-test| test-also-no-wasm-baseline; error: TestComplete; skip-if: !wasmDebuggingIsSupported()
 // Tests that wasm module scripts raises onEnterFrame and onLeaveFrame events.
 
 load(libdir + "asserts.js");
 
 function runWasmWithDebugger(wast, lib, init, done) {
-    let g = newGlobal('');
+    let g = newGlobal({newCompartment: true});
     let dbg = new Debugger(g);
 
     g.eval(`
 var wasm = wasmTextToBinary('${wast}');
 var lib = ${lib || 'undefined'};
 var m = new WebAssembly.Instance(new WebAssembly.Module(wasm), lib);`);
 
     init(dbg, g);
--- a/js/src/jit-test/tests/debug/wasm-09.js
+++ b/js/src/jit-test/tests/debug/wasm-09.js
@@ -1,17 +1,17 @@
 // |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
 // Tests debugEnabled state of wasm when allowUnobservedAsmJS == true.
 
 load(libdir + "asserts.js");
 
 // Checking that there are no offsets are present in a wasm instance script for
 // which debug mode was not enabled.
 function getWasmScriptWithoutAllowUnobservedAsmJS(wast) {
-    var sandbox = newGlobal('');
+    var sandbox = newGlobal({newCompartment: true});
     var dbg = new Debugger();
     dbg.allowUnobservedAsmJS = true;
     dbg.addDebuggee(sandbox);
     sandbox.eval(`
         var wasm = wasmTextToBinary('${wast}');
         var m = new WebAssembly.Instance(new WebAssembly.Module(wasm));
     `);
     // Attaching after wasm instance is created.
--- a/js/src/jit-test/tests/debug/wasm-breakpoint.js
+++ b/js/src/jit-test/tests/debug/wasm-breakpoint.js
@@ -1,15 +1,15 @@
 // |jit-test| test-also-no-wasm-baseline; skip-if: !wasmDebuggingIsSupported()
 // Tests that wasm module scripts handles basic breakpoint operations.
 
 load(libdir + "wasm.js");
 
 function runTest(wast, initFunc, doneFunc) {
-    let g = newGlobal('');
+    let g = newGlobal({newCompartment: true});
     let dbg = new Debugger(g);
 
     g.eval(`
 var { binary, offsets } = wasmTextToBinary('${wast}', /* offsets */ true);
 var m = new WebAssembly.Instance(new WebAssembly.Module(binary));`);
 
     var { offsets } = g;
 
--- a/js/src/jit-test/tests/debug/wasm-getAllColumnOffsets.js
+++ b/js/src/jit-test/tests/debug/wasm-getAllColumnOffsets.js
@@ -3,17 +3,17 @@
 // Tests that wasm module scripts have column and line to bytecode offset
 // information when source text is generated.
 
 load(libdir + "asserts.js");
 
 // Checking if experimental format generates internal source map to binary file
 // by querying debugger scripts getAllColumnOffsets.
 function getAllOffsets(wast) {
-  var sandbox = newGlobal('');
+  var sandbox = newGlobal({newCompartment: true});
   var dbg = new Debugger();
   dbg.addDebuggee(sandbox);
   dbg.allowWasmBinarySource = true;
   sandbox.eval(`
     var wasm = wasmTextToBinary('${wast}');
     var m = new WebAssembly.Instance(new WebAssembly.Module(wasm));
   `);
   var wasmScript = dbg.findScripts().filter(s => s.format == 'wasm')[0];
--- a/js/src/jit-test/tests/parser/bug-1263355-30.js
+++ b/js/src/jit-test/tests/parser/bug-1263355-30.js
@@ -1,11 +1,11 @@
 // |jit-test| error: ReferenceError
 
-var g = newGlobal("same-compartment");
+var g = newGlobal({newCompartment: true});
 var dbg = new Debugger;
 g.toggle = function toggle(d) {
     if (d) {
         dbg.addDebuggee(g);
         frame1.onPop = function() {
             onPopExecuted = setJitCompilerOption('offthread-compilation.enable', 0) >> toggle('#2: x = null; x ^= true; x === 1. Actual: ' + (getObjectMetadata)) + (this);
         };
     }
--- a/js/src/jit-test/tests/realms/basic.js
+++ b/js/src/jit-test/tests/realms/basic.js
@@ -21,17 +21,17 @@ function testCrossRealmProto() {
         assertEq(Array.isArray(a), true);
         assertEq(objectGlobal(a), this);
         assertEq(a.__proto__, g.Object.prototype);
     }
 }
 testCrossRealmProto();
 
 function testSystemNonSystemRealms() {
-    var systemRealm = newGlobal({systemPrincipal: true});
+    var systemRealm = newGlobal({newCompartment: true, systemPrincipal: true});
     var ex;
     try {
         var nonSystemRealm = newGlobal({sameCompartmentAs: systemRealm, principal: 10});
     } catch(e) {
         ex = e;
     }
     assertEq(ex.toString().includes("non-system realms"), true);
     ex = null;
--- a/js/src/jit-test/tests/regexp/bug1445907.js
+++ b/js/src/jit-test/tests/regexp/bug1445907.js
@@ -1,14 +1,14 @@
 // |jit-test| skip-if: !wasmIsSupported()
 
 // On ARM64, we failed to save x28 properly when generating code for the regexp
 // matcher.
 //
 // There's wasm and Debugger code here because the combination forces the use of
 // x28 and exposes the bug when running on the simulator.
 
-var g = newGlobal('');
+var g = newGlobal({newCompartment: true});
 var dbg = new Debugger(g);
 g.eval(`var m = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary('(module (func (export "test")))')))`);
 var re = /./;
 dbg.onEnterFrame = function(frame) { re.exec("x") };
 result = g.eval("m.exports.test()");
--- a/js/src/jit-test/tests/typedarray/bug1518764.js
+++ b/js/src/jit-test/tests/typedarray/bug1518764.js
@@ -1,8 +1,8 @@
 // |jit-test| error:dead object
 
-var g = newGlobal();
+var g = newGlobal({newCompartment: true});
 var ta = new g.Int32Array(1);
 Int32Array.prototype.filter.call(ta, function() {
     nukeAllCCWs();
     return true;
 });
--- a/js/src/jit-test/tests/wasm/regress/bug1440512.js
+++ b/js/src/jit-test/tests/wasm/regress/bug1440512.js
@@ -1,9 +1,9 @@
-var g = newGlobal(() => newGlobal(verifyprebarriers, "rem_s", [7, -3]));
+var g = newGlobal({newCompartment: true});
 var dbg = new g.Debugger(this);
 var dbg = new Debugger;
 var kWasmH0 = 0;
 var kWasmH1 = 0x61;
 var kWasmH2 = 0x73;
 var kWasmH3 = 0x6d;
 var kWasmV0 = 0x1;
 var kWasmV1 = 0;
--- a/js/src/jit-test/tests/xdr/debug-lazy.js
+++ b/js/src/jit-test/tests/xdr/debug-lazy.js
@@ -11,9 +11,9 @@ function checkAfter(ctx) {
     assertEq(allScripts.length == 0, false);
 }
 
 test = `
   function f() { return true; };
   f();
   `
 evalWithCache(test, { assertEqBytecode: true, assertEqResult: true,
-		      checkAfter: checkAfter });
+		      checkAfter: checkAfter, newCompartment: true});
--- a/js/src/jit-test/tests/xdr/lazy.js
+++ b/js/src/jit-test/tests/xdr/lazy.js
@@ -106,34 +106,34 @@ evalWithCache(test, { assertEqBytecode: 
 // record its value by throwing away JIT code for the function.
 gczeal(0);
 
 // Ensure that decoded functions can be relazified.
 test = "function f() { }; f();"
      + "assertEq(isLazyFunction(f), false);"
      + "var expect = isRelazifiableFunction(f);";
 checkAfter = function (ctx) {
-  gc(ctx.global.f, "shrinking"); // relazify f, if possible.
+  relazifyFunctions(); // relazify f, if possible.
   evaluate("assertEq(isLazyFunction(f), expect);", ctx);
 };
 evalWithCache(test, {
   assertEqBytecode: true,  // Check that we re-encode the same thing.
   assertEqResult: true,    // The function should remain relazifiable, if it was
                            // during the first run.
   checkAfter: checkAfter   // Check that relazifying the restored function works
                            // if the original was relazifiable.
 });
 
 // Ensure that decoded functions can be relazified, even if they have free
 // variables.
 test = "function f() { return isRelazifiableFunction(f) }; var expect = f();"
      + "assertEq(isLazyFunction(f), false);"
      + "expect";
 checkAfter = function (ctx) {
-  gc(ctx.global.f, "shrinking"); // relazify f, if possible.
+  relazifyFunctions(); // relazify f, if possible.
   evaluate("assertEq(isLazyFunction(f), expect);", ctx);
 };
 evalWithCache(test, {
   assertEqBytecode: true,  // Check that we re-encode the same thing.
   assertEqResult: true,    // The function should remain relazifiable, if it was
                            // during the first run.
   checkAfter: checkAfter   // Check that relazifying the restored function works
                            // if the original was relazifiable.
--- a/js/src/jit-test/tests/xdr/relazify.js
+++ b/js/src/jit-test/tests/xdr/relazify.js
@@ -10,20 +10,20 @@ test = `
   function f() { return 1; };
   assertEq(isLazyFunction(f), generation == 0 || generation == 3);
   f();
   expect = isRelazifiableFunction(f);
   assertEq(isLazyFunction(f), false);
 `;
 evalWithCache(test, {
   checkAfter: function (ctx) {
-    gc(ctx.global.f, "shrinking"); // relazify f, if possible.
+    relazifyFunctions(); // relazify f, if possible.
     evaluate("assertEq(isLazyFunction(f), expect);", ctx);
   }
 });
 
 evalWithCache(test, {
   incremental: true,
   checkAfter: function (ctx) {
-    gc(ctx.global.f, "shrinking"); // relazify f, if possible.
+    relazifyFunctions(); // relazify f, if possible.
     evaluate("assertEq(isLazyFunction(f), expect);", ctx);
   }
 });