diff --git a/src/runtime/runtime-promise.cc b/src/runtime/runtime-promise.cc index 1bc7eaa68c..4743a2d71d 100644 --- a/src/runtime/runtime-promise.cc +++ b/src/runtime/runtime-promise.cc @@ -80,10 +80,10 @@ RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { return ReadOnlyRoots(isolate).undefined_value(); } -RUNTIME_FUNCTION(Runtime_RunMicrotasks) { +RUNTIME_FUNCTION(Runtime_PerformMicrotaskCheckpoint) { HandleScope scope(isolate); DCHECK_EQ(0, args.length()); - isolate->RunMicrotasks(); + MicrotasksScope::PerformCheckpoint(reinterpret_cast(isolate)); return ReadOnlyRoots(isolate).undefined_value(); } diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index fc8820ec80..53987e181a 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -230,7 +230,7 @@ namespace internal { F(ReportMessage, 1, 1) \ F(ReThrow, 1, 1) \ F(RunMicrotaskCallback, 2, 1) \ - F(RunMicrotasks, 0, 1) \ + F(PerformMicrotaskCheckpoint, 0, 1) \ F(StackGuard, 0, 1) \ F(Throw, 1, 1) \ F(ThrowApplyNonFunction, 1, 1) \ diff --git a/test/debugger/debug/es6/debug-promises/evaluate-across-microtasks.js b/test/debugger/debug/es6/debug-promises/evaluate-across-microtasks.js index 71b07476d3..ec3555d22b 100644 --- a/test/debugger/debug/es6/debug-promises/evaluate-across-microtasks.js +++ b/test/debugger/debug/es6/debug-promises/evaluate-across-microtasks.js @@ -51,7 +51,7 @@ LogX("start")(); // Make sure that the debug event listener was invoked. assertTrue(listenerComplete); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); var expectation = [ "[0] debugger", "[1] start", "[1] then 1", diff --git a/test/debugger/debug/es6/debug-promises/proxy-as-promise.js b/test/debugger/debug/es6/debug-promises/proxy-as-promise.js index 3bd1fead08..431837ceba 100644 --- a/test/debugger/debug/es6/debug-promises/proxy-as-promise.js +++ b/test/debugger/debug/es6/debug-promises/proxy-as-promise.js @@ -39,4 +39,4 @@ function listener(event, exec_state, event_data, data) {} Debug.setBreakOnUncaughtException(); Debug.setListener(listener); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); diff --git a/test/debugger/debug/es6/debug-promises/reject-in-constructor-opt.js b/test/debugger/debug/es6/debug-promises/reject-in-constructor-opt.js index 6b7abde111..2b8ebb1c0b 100644 --- a/test/debugger/debug/es6/debug-promises/reject-in-constructor-opt.js +++ b/test/debugger/debug/es6/debug-promises/reject-in-constructor-opt.js @@ -40,22 +40,22 @@ function bar(a,b) { } foo(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); foo(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); %OptimizeFunctionOnNextCall(foo); // bar likely gets inlined into foo. foo(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); %NeverOptimizeFunction(bar); %OptimizeFunctionOnNextCall(foo); // bar does not get inlined into foo. foo(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(0, expected_events); diff --git a/test/debugger/debug/es8/async-debug-builtin-predictions.js b/test/debugger/debug/es8/async-debug-builtin-predictions.js index 70f1b57e7e..bcd990896b 100644 --- a/test/debugger/debug/es8/async-debug-builtin-predictions.js +++ b/test/debugger/debug/es8/async-debug-builtin-predictions.js @@ -57,7 +57,7 @@ async function foo() { foo(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); Debug.setListener(null); Debug.clearBreakOnException(); diff --git a/test/debugger/debug/es8/async-debug-caught-exception-cases.js b/test/debugger/debug/es8/async-debug-caught-exception-cases.js index f5c1ed98a8..24cf598439 100644 --- a/test/debugger/debug/es8/async-debug-caught-exception-cases.js +++ b/test/debugger/debug/es8/async-debug-caught-exception-cases.js @@ -197,7 +197,7 @@ function runPart(n) { events = 0; consumer(producer); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); Debug.setListener(null); if (caught) { diff --git a/test/debugger/debug/es8/async-debug-caught-exception.js b/test/debugger/debug/es8/async-debug-caught-exception.js index 2feecc067f..de0c4e9c5b 100644 --- a/test/debugger/debug/es8/async-debug-caught-exception.js +++ b/test/debugger/debug/es8/async-debug-caught-exception.js @@ -37,7 +37,7 @@ log = []; Debug.setListener(listener); Debug.setBreakOnException(); caught_throw(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); Debug.setListener(null); Debug.clearBreakOnException(); assertEquals(["a"], log); @@ -48,7 +48,7 @@ log = []; Debug.setListener(listener); Debug.setBreakOnUncaughtException(); caught_throw(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); Debug.setListener(null); Debug.clearBreakOnUncaughtException(); assertEquals([], log); @@ -69,7 +69,7 @@ log = []; Debug.setListener(listener); Debug.setBreakOnException(); caught_reject(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); Debug.setListener(null); Debug.clearBreakOnException(); assertEquals([], log); @@ -80,7 +80,7 @@ log = []; Debug.setListener(listener); Debug.setBreakOnUncaughtException(); caught_reject(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); Debug.setListener(null); Debug.clearBreakOnUncaughtException(); assertEquals([], log); @@ -95,7 +95,7 @@ async function propagate_inner() { return thrower(); } async function propagate_outer() { return propagate_inner(); } propagate_outer(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(["a"], log); assertNull(exception); @@ -104,7 +104,7 @@ log = []; async function propagate_await() { await 1; return thrower(); } async function propagate_await_outer() { return propagate_await(); } propagate_await_outer(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(["a"], log); assertNull(exception); @@ -113,7 +113,7 @@ Debug.setBreakOnUncaughtException(); log = []; Promise.resolve().then(() => Promise.reject()).catch(() => log.push("d")); // Exception c -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(["d"], log); assertNull(exception); diff --git a/test/debugger/debug/es8/async-debug-step-abort-at-break.js b/test/debugger/debug/es8/async-debug-step-abort-at-break.js index 85232b075b..47605cea16 100644 --- a/test/debugger/debug/es8/async-debug-step-abort-at-break.js +++ b/test/debugger/debug/es8/async-debug-step-abort-at-break.js @@ -48,6 +48,6 @@ debugger; // B3 StepNext late_resolve(3); // B4 Continue -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(5, step_count); diff --git a/test/debugger/debug/es8/async-debug-step-continue-at-break.js b/test/debugger/debug/es8/async-debug-step-continue-at-break.js index 60ea859ae3..79dcad6b1e 100644 --- a/test/debugger/debug/es8/async-debug-step-continue-at-break.js +++ b/test/debugger/debug/es8/async-debug-step-continue-at-break.js @@ -48,6 +48,6 @@ debugger; // B3 Continue late_resolve(3); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(5, step_count); diff --git a/test/debugger/debug/es8/async-debug-step-in-and-out.js b/test/debugger/debug/es8/async-debug-step-in-and-out.js index 737fced01a..5d64e5a10e 100644 --- a/test/debugger/debug/es8/async-debug-step-in-and-out.js +++ b/test/debugger/debug/es8/async-debug-step-in-and-out.js @@ -44,6 +44,6 @@ f(); late_resolve(3); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(4, step_count); diff --git a/test/debugger/debug/es8/async-debug-step-in-out-out.js b/test/debugger/debug/es8/async-debug-step-in-out-out.js index c1d8fd71be..7702742f58 100644 --- a/test/debugger/debug/es8/async-debug-step-in-out-out.js +++ b/test/debugger/debug/es8/async-debug-step-in-out-out.js @@ -44,6 +44,6 @@ f(); late_resolve(3); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(4, step_count); diff --git a/test/debugger/debug/es8/async-debug-step-in.js b/test/debugger/debug/es8/async-debug-step-in.js index d66714bc6c..fe84e4b9ba 100644 --- a/test/debugger/debug/es8/async-debug-step-in.js +++ b/test/debugger/debug/es8/async-debug-step-in.js @@ -44,6 +44,6 @@ f().then(value => assertEquals(4, value)); late_resolve(3); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(7, step_count); diff --git a/test/debugger/debug/es8/async-debug-step-nested.js b/test/debugger/debug/es8/async-debug-step-nested.js index f06da202f2..74432a6f52 100644 --- a/test/debugger/debug/es8/async-debug-step-nested.js +++ b/test/debugger/debug/es8/async-debug-step-nested.js @@ -51,6 +51,6 @@ f1(); late_resolve(3); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(6, step_count); diff --git a/test/debugger/debug/es8/async-debug-step-next-constant.js b/test/debugger/debug/es8/async-debug-step-next-constant.js index 4f4a154c9b..2b432632fa 100644 --- a/test/debugger/debug/es8/async-debug-step-next-constant.js +++ b/test/debugger/debug/es8/async-debug-step-next-constant.js @@ -32,6 +32,6 @@ async function f() { f(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(3, step_count); diff --git a/test/debugger/debug/es8/async-debug-step-next.js b/test/debugger/debug/es8/async-debug-step-next.js index 833bfc9c0d..0fdbd73f05 100644 --- a/test/debugger/debug/es8/async-debug-step-next.js +++ b/test/debugger/debug/es8/async-debug-step-next.js @@ -44,6 +44,6 @@ f(); late_resolve(3); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(3, step_count); diff --git a/test/debugger/debug/es8/async-debug-step-out.js b/test/debugger/debug/es8/async-debug-step-out.js index 3ec6dd3490..d37ce5893e 100644 --- a/test/debugger/debug/es8/async-debug-step-out.js +++ b/test/debugger/debug/es8/async-debug-step-out.js @@ -42,6 +42,6 @@ f(); late_resolve(3); // B2 Continue -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(3, step_count); diff --git a/test/debugger/debug/es8/debug-async-break-on-stack.js b/test/debugger/debug/es8/debug-async-break-on-stack.js index df389f33d9..124cbabb8e 100644 --- a/test/debugger/debug/es8/debug-async-break-on-stack.js +++ b/test/debugger/debug/es8/debug-async-break-on-stack.js @@ -21,7 +21,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; @@ -67,7 +67,7 @@ function setbreaks() { f(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEqualsAsync(2, async () => break_count); assertEqualsAsync(null, async () => exception); diff --git a/test/debugger/debug/es8/debug-async-break.js b/test/debugger/debug/es8/debug-async-break.js index 3e07ba9344..8a2982045a 100644 --- a/test/debugger/debug/es8/debug-async-break.js +++ b/test/debugger/debug/es8/debug-async-break.js @@ -21,7 +21,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; @@ -65,7 +65,7 @@ Debug.setBreakPoint(f, 5); f(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEqualsAsync(3, async () => break_count); assertEqualsAsync(null, async () => exception); diff --git a/test/debugger/debug/es8/debug-async-liveedit.js b/test/debugger/debug/es8/debug-async-liveedit.js index 723a40f478..e85cbe3896 100644 --- a/test/debugger/debug/es8/debug-async-liveedit.js +++ b/test/debugger/debug/es8/debug-async-liveedit.js @@ -94,7 +94,7 @@ function patch(fun, from, to) { assertPromiseValue("Cat", promise); assertTrue(patch_attempted); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); // At this point one iterator is live, but closed, so the patch will succeed. patch(asyncfn, "'Cat'", "'Capybara'"); @@ -143,4 +143,4 @@ function patch(fun, from, to) { })); })(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); diff --git a/test/debugger/debug/es8/promise-finally.js b/test/debugger/debug/es8/promise-finally.js index 6923e64f64..dc7833e6e8 100644 --- a/test/debugger/debug/es8/promise-finally.js +++ b/test/debugger/debug/es8/promise-finally.js @@ -35,7 +35,7 @@ Promise.resolve() .finally(() => thenable) .catch(e => caughtException = e); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); Debug.setListener(null); Debug.clearBreakOnException(); diff --git a/test/js-perf-test/AsyncAwait/baseline-babel-es2017.js b/test/js-perf-test/AsyncAwait/baseline-babel-es2017.js index 1be3074f3b..37709d739b 100644 --- a/test/js-perf-test/AsyncAwait/baseline-babel-es2017.js +++ b/test/js-perf-test/AsyncAwait/baseline-babel-es2017.js @@ -160,10 +160,10 @@ function Setup() { return a; })(); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); } function Basic() { a(); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); } diff --git a/test/js-perf-test/AsyncAwait/baseline-naive-promises.js b/test/js-perf-test/AsyncAwait/baseline-naive-promises.js index f59ae86194..9b9c091a13 100644 --- a/test/js-perf-test/AsyncAwait/baseline-naive-promises.js +++ b/test/js-perf-test/AsyncAwait/baseline-naive-promises.js @@ -34,7 +34,7 @@ function Setup() { b = function b(p) { return p; }; a = function a(p) { return p; }; - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); } function Basic() { @@ -48,5 +48,5 @@ function Basic() { .then(c) .then(b) .then(a); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); } diff --git a/test/js-perf-test/AsyncAwait/native.js b/test/js-perf-test/AsyncAwait/native.js index 7979d2f4db..e9504c3a19 100644 --- a/test/js-perf-test/AsyncAwait/native.js +++ b/test/js-perf-test/AsyncAwait/native.js @@ -34,10 +34,10 @@ function Setup() { b = async function b() { return c(); }; a = async function a() { return b(); }; - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); } function Basic() { a(); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); } diff --git a/test/js-perf-test/Inspector/debugger.js b/test/js-perf-test/Inspector/debugger.js index 8e44aa7710..e9c862563b 100644 --- a/test/js-perf-test/Inspector/debugger.js +++ b/test/js-perf-test/Inspector/debugger.js @@ -69,7 +69,7 @@ function AsyncStacksInstrumentation() { p = p.then(nopCallback); } p = p.then(() => done = true); - while (!done) %RunMicrotasks(); + while (!done) %PerformMicrotaskCheckpoint(); } })(); diff --git a/test/js-perf-test/Modules/run.js b/test/js-perf-test/Modules/run.js index e5f91e1aa9..4c038801a9 100644 --- a/test/js-perf-test/Modules/run.js +++ b/test/js-perf-test/Modules/run.js @@ -23,21 +23,21 @@ const iterations = 10000; function BasicExport() { let success = false; import("basic-export.js").then(m => { m.bench(); success = true; }); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (!success) throw new Error(666); } function BasicImport() { let success = false; import("basic-import.js").then(m => { m.bench(); success = true; }); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (!success) throw new Error(666); } function BasicNamespace() { let success = false; import("basic-namespace.js").then(m => { m.bench(); success = true; }); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (!success) throw new Error(666); } diff --git a/test/mjsunit/code-coverage-block.js b/test/mjsunit/code-coverage-block.js index 8cbb2969f7..bdba90cd1e 100644 --- a/test/mjsunit/code-coverage-block.js +++ b/test/mjsunit/code-coverage-block.js @@ -213,7 +213,7 @@ TestCoverage( nop(); // 0100 } // 0150 }(); // 0200 -%RunMicrotasks(); // 0250 +%PerformMicrotaskCheckpoint(); // 0250 `, [{"start":0,"end":299,"count":1}, {"start":1,"end":201,"count":6}, // TODO(jgruber): Invocation count is off. @@ -662,7 +662,7 @@ async function f() { // 0000 await 42; // 0100 }; // 0150 f(); // 0200 -%RunMicrotasks(); // 0250 +%PerformMicrotaskCheckpoint(); // 0250 `, [{"start":0,"end":299,"count":1}, {"start":0,"end":151,"count":3}, diff --git a/test/mjsunit/es6/microtask-delivery.js b/test/mjsunit/es6/microtask-delivery.js index 6b239bea47..96035164f2 100644 --- a/test/mjsunit/es6/microtask-delivery.js +++ b/test/mjsunit/es6/microtask-delivery.js @@ -40,7 +40,7 @@ function assertArrayValues(expected, actual) { } function assertOrdering(expected) { - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertArrayValues(expected, ordering); } diff --git a/test/mjsunit/es8/async-arrow-lexical-arguments.js b/test/mjsunit/es8/async-arrow-lexical-arguments.js index b29f17fce0..720770ef49 100644 --- a/test/mjsunit/es8/async-arrow-lexical-arguments.js +++ b/test/mjsunit/es8/async-arrow-lexical-arguments.js @@ -21,7 +21,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; diff --git a/test/mjsunit/es8/async-arrow-lexical-new.target.js b/test/mjsunit/es8/async-arrow-lexical-new.target.js index 943267e9d8..7d016281f8 100644 --- a/test/mjsunit/es8/async-arrow-lexical-new.target.js +++ b/test/mjsunit/es8/async-arrow-lexical-new.target.js @@ -21,7 +21,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; diff --git a/test/mjsunit/es8/async-arrow-lexical-super.js b/test/mjsunit/es8/async-arrow-lexical-super.js index b15a3834db..b175ac5ae1 100644 --- a/test/mjsunit/es8/async-arrow-lexical-super.js +++ b/test/mjsunit/es8/async-arrow-lexical-super.js @@ -21,7 +21,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; diff --git a/test/mjsunit/es8/async-arrow-lexical-this.js b/test/mjsunit/es8/async-arrow-lexical-this.js index 38bdddc2c7..a21978d1a0 100644 --- a/test/mjsunit/es8/async-arrow-lexical-this.js +++ b/test/mjsunit/es8/async-arrow-lexical-this.js @@ -21,7 +21,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; diff --git a/test/mjsunit/es8/async-await-basic.js b/test/mjsunit/es8/async-await-basic.js index 6e9ee02ffe..1c7b2ac601 100644 --- a/test/mjsunit/es8/async-await-basic.js +++ b/test/mjsunit/es8/async-await-basic.js @@ -23,7 +23,7 @@ function assertThrowsAsync(run, errorType, message) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (!hadError) { throw new MjsUnitAssertionError( @@ -57,7 +57,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; @@ -402,7 +402,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["b", "a", "c"], log); } @@ -416,7 +416,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["b", "a", "c"], log); } @@ -430,7 +430,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["a", "b", "c"], log); } @@ -445,7 +445,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["b", "c", "a"], log); } @@ -459,7 +459,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["b", "a", "c"], log); } @@ -473,7 +473,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["a", "b", "c"], log); } @@ -488,7 +488,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["b", "a", "c"], log); } @@ -502,7 +502,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["b", "a", "c"], log); } @@ -516,7 +516,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["a", "b", "c"], log); } @@ -531,7 +531,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["b", "c", "a"], log); } @@ -545,7 +545,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["b", "c", "a"], log); } @@ -559,7 +559,7 @@ assertDoesNotThrow(gaga); } } foo().then(() => log.push("c")); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(["a", "b", "c"], log); } @@ -585,7 +585,7 @@ assertDoesNotThrow(gaga); var ans; f2().then(x => ans = x).catch(e => ans = e); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals([0], ans); } diff --git a/test/mjsunit/es8/async-await-no-constructor.js b/test/mjsunit/es8/async-await-no-constructor.js index e954e2ac57..5e4780a6ef 100644 --- a/test/mjsunit/es8/async-await-no-constructor.js +++ b/test/mjsunit/es8/async-await-no-constructor.js @@ -23,5 +23,5 @@ async function bar() { foo(); bar(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(2, count); diff --git a/test/mjsunit/es8/async-await-species.js b/test/mjsunit/es8/async-await-species.js index b3e925433a..3fc46fd230 100644 --- a/test/mjsunit/es8/async-await-species.js +++ b/test/mjsunit/es8/async-await-species.js @@ -21,7 +21,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; diff --git a/test/mjsunit/es8/async-destructuring.js b/test/mjsunit/es8/async-destructuring.js index 1fbac5a072..d5e90eb057 100644 --- a/test/mjsunit/es8/async-destructuring.js +++ b/test/mjsunit/es8/async-destructuring.js @@ -21,7 +21,7 @@ function assertThrowsAsync(run, errorType, message) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (!hadError) { throw new MjsUnitAssertionError( @@ -55,7 +55,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; @@ -77,7 +77,7 @@ function assertEqualsAsync(expected, run, msg) { assertEquals(1, y); assertEquals(1, z); assertEquals(0, w); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(1, y); assertEquals(1, z); assertEquals(1, w); diff --git a/test/mjsunit/es8/async-function-try-finally.js b/test/mjsunit/es8/async-function-try-finally.js index 9ba07eb427..43badc480a 100644 --- a/test/mjsunit/es8/async-function-try-finally.js +++ b/test/mjsunit/es8/async-function-try-finally.js @@ -21,7 +21,7 @@ function assertThrowsAsync(run, errorType, message) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (!hadError) { throw new MjsUnitAssertionError( @@ -55,7 +55,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; diff --git a/test/mjsunit/harmony/async-from-sync-iterator.js b/test/mjsunit/harmony/async-from-sync-iterator.js index 2d6be098a2..e9dfe5d322 100644 --- a/test/mjsunit/harmony/async-from-sync-iterator.js +++ b/test/mjsunit/harmony/async-from-sync-iterator.js @@ -24,7 +24,7 @@ function assertThrowsAsync(run, errorType, message) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (!hadError) { throw new MjsUnitAssertionError( @@ -185,7 +185,7 @@ class MyError extends Error {}; testFailure = error; }); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); if (testFailed) { throw testFailure; } @@ -619,7 +619,7 @@ if (testFailed) { testFailure = error; }); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); if (testFailed) { throw testFailure; } @@ -663,7 +663,7 @@ if (testFailed) { // Cycle through `f` to extract iterator methods f().catch(function() { %AbortJS("No error should have occurred"); }); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assertEquals(typeof extractedNext, "function"); assertThrowsAsync(() => extractedNext.call(undefined), TypeError); diff --git a/test/mjsunit/harmony/async-generators-basic.js b/test/mjsunit/harmony/async-generators-basic.js index cf21d9a8c8..5ff7d25eea 100644 --- a/test/mjsunit/harmony/async-generators-basic.js +++ b/test/mjsunit/harmony/async-generators-basic.js @@ -21,7 +21,7 @@ function assertThrowsAsync(run, errorType, message) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (!hadError) { throw new MjsUnitAssertionError( @@ -55,7 +55,7 @@ function assertEqualsAsync(expected, run, msg) { assertFalse(hadValue || hadError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (hadError) throw actual; @@ -448,7 +448,7 @@ async function* asyncGeneratorForNestedResumeNext() { } it = asyncGeneratorForNestedResumeNext(); it.next().then(logIterResult, AbortUnreachable); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: "rootbeer", done: false }, { value: "float", done: false }, @@ -464,7 +464,7 @@ let asyncGeneratorExprForNestedResumeNext = async function*() { }; it = asyncGeneratorExprForNestedResumeNext(); it.next().then(logIterResult, AbortUnreachable); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: "first", done: false }, { value: "second", done: false }, @@ -482,7 +482,7 @@ let asyncGeneratorMethodForNestedResumeNext = ({ }).method; it = asyncGeneratorMethodForNestedResumeNext(); it.next().then(logIterResult, AbortUnreachable); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: "remember", done: false }, { value: "the cant!", done: false }, @@ -498,7 +498,7 @@ let asyncGeneratorCallEvalForNestedResumeNext = yield await Resolver("rainbow!");`); it = asyncGeneratorCallEvalForNestedResumeNext(); it.next().then(logIterResult, AbortUnreachable); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: "reading", done: false }, { value: "rainbow!", done: false }, @@ -514,7 +514,7 @@ let asyncGeneratorNewEvalForNestedResumeNext = yield await Resolver("BB!");`); it = asyncGeneratorNewEvalForNestedResumeNext(); it.next().then(logIterResult, AbortUnreachable); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: 731, done: false }, { value: "BB!", done: false }, @@ -536,7 +536,7 @@ async function* asyncGeneratorForNestedResumeThrow() { } it = asyncGeneratorForNestedResumeThrow(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ "throw1", "throw2", @@ -556,7 +556,7 @@ let asyncGeneratorExprForNestedResumeThrow = async function*() { }; it = asyncGeneratorExprForNestedResumeThrow(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ "throw3", "throw4", @@ -578,7 +578,7 @@ let asyncGeneratorMethodForNestedResumeThrow = ({ }).method; it = asyncGeneratorMethodForNestedResumeThrow(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ "throw5", "throw6", @@ -598,7 +598,7 @@ let asyncGeneratorCallEvalForNestedResumeThrow = AbortUnreachable();`); it = asyncGeneratorCallEvalForNestedResumeThrow(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ "throw7", "throw8", @@ -618,7 +618,7 @@ let asyncGeneratorNewEvalForNestedResumeThrow = AbortUnreachable();`); it = asyncGeneratorNewEvalForNestedResumeThrow(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ "throw9", "throw10", @@ -636,7 +636,7 @@ async function* asyncGeneratorForNestedResumeReturn() { } it = asyncGeneratorForNestedResumeReturn(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: "step1", done: false }, { value: "step2", done: true }, @@ -651,7 +651,7 @@ let asyncGeneratorExprForNestedResumeReturn = async function*() { }; it = asyncGeneratorExprForNestedResumeReturn(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: "step3", done: false }, { value: "step4", done: true }, @@ -668,7 +668,7 @@ let asyncGeneratorMethodForNestedResumeReturn = ({ }).method; it = asyncGeneratorMethodForNestedResumeReturn(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: "step5", done: false }, { value: "step6", done: true }, @@ -683,7 +683,7 @@ let asyncGeneratorCallEvalForNestedResumeReturn = yield "step7";`); it = asyncGeneratorCallEvalForNestedResumeReturn(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: "step7", done: false }, { value: "step8", done: true }, @@ -698,7 +698,7 @@ let asyncGeneratorNewEvalForNestedResumeReturn = yield "step9";`); it = asyncGeneratorNewEvalForNestedResumeReturn(); it.next().then(logIterResult, logError); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals([ { value: "step9", done: false }, { value: "step10", done: true }, diff --git a/test/mjsunit/harmony/for-await-of.js b/test/mjsunit/harmony/for-await-of.js index e23758a5e1..1b4fcd701a 100644 --- a/test/mjsunit/harmony/for-await-of.js +++ b/test/mjsunit/harmony/for-await-of.js @@ -1257,7 +1257,7 @@ let testFailure; testFailure = error; }); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); if (testFailed) { throw testFailure; diff --git a/test/mjsunit/harmony/import-from-compilation-errored.js b/test/mjsunit/harmony/import-from-compilation-errored.js index 3c99498d0e..49570b51de 100644 --- a/test/mjsunit/harmony/import-from-compilation-errored.js +++ b/test/mjsunit/harmony/import-from-compilation-errored.js @@ -7,7 +7,7 @@ var error1, error2; import('modules-skip-12.js').catch(e => error1 = e); import('modules-skip-12.js').catch(e => error2 = e); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(error1, error2); assertInstanceof(error1, SyntaxError); diff --git a/test/mjsunit/harmony/import-from-evaluation-errored.js b/test/mjsunit/harmony/import-from-evaluation-errored.js index 3623091777..87dbc0a6aa 100644 --- a/test/mjsunit/harmony/import-from-evaluation-errored.js +++ b/test/mjsunit/harmony/import-from-evaluation-errored.js @@ -7,7 +7,7 @@ var error1, error2; import('modules-skip-11.js').catch(e => error1 = e); import('modules-skip-11.js').catch(e => error2 = e); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(error1, error2); assertEquals(typeof error1, "symbol"); diff --git a/test/mjsunit/harmony/import-from-fetch-errored.js b/test/mjsunit/harmony/import-from-fetch-errored.js index f3db881eb2..6d6510fcde 100644 --- a/test/mjsunit/harmony/import-from-fetch-errored.js +++ b/test/mjsunit/harmony/import-from-fetch-errored.js @@ -7,7 +7,7 @@ var error1, error2; import('no-such-file').catch(e => error1 = e); import('no-such-file').catch(e => error2 = e); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(error1, error2); assertEquals(typeof error1, "string"); diff --git a/test/mjsunit/harmony/import-from-instantiation-errored.js b/test/mjsunit/harmony/import-from-instantiation-errored.js index 2a481d5965..2cdbaaea32 100644 --- a/test/mjsunit/harmony/import-from-instantiation-errored.js +++ b/test/mjsunit/harmony/import-from-instantiation-errored.js @@ -7,7 +7,7 @@ var error1, error2; import('modules-skip-10.js').catch(e => error1 = e); import('modules-skip-10.js').catch(e => error2 = e); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(error1, error2); assertInstanceof(error1, SyntaxError); diff --git a/test/mjsunit/harmony/modules-import-1.js b/test/mjsunit/harmony/modules-import-1.js index 7fd567f56f..f62d4d7b32 100644 --- a/test/mjsunit/harmony/modules-import-1.js +++ b/test/mjsunit/harmony/modules-import-1.js @@ -7,6 +7,6 @@ var life; import('modules-skip-1.js').then(namespace => life = namespace.life()); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(42, life); diff --git a/test/mjsunit/harmony/modules-import-10.js b/test/mjsunit/harmony/modules-import-10.js index 68e000a131..eda4aaf7f9 100644 --- a/test/mjsunit/harmony/modules-import-10.js +++ b/test/mjsunit/harmony/modules-import-10.js @@ -9,7 +9,7 @@ import('modules-skip-6.js').then(namespace => life = namespace.life); assertEquals(undefined, Object.life); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(42, Object.life); assertEquals("42", life); diff --git a/test/mjsunit/harmony/modules-import-11.js b/test/mjsunit/harmony/modules-import-11.js index a5afa10048..ffba6a0722 100644 --- a/test/mjsunit/harmony/modules-import-11.js +++ b/test/mjsunit/harmony/modules-import-11.js @@ -18,5 +18,5 @@ async function test() { } test(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-12.js b/test/mjsunit/harmony/modules-import-12.js index bcb8569221..d898c984ad 100644 --- a/test/mjsunit/harmony/modules-import-12.js +++ b/test/mjsunit/harmony/modules-import-12.js @@ -15,5 +15,5 @@ async function test() { } test(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-13.js b/test/mjsunit/harmony/modules-import-13.js index 1cec1cce61..52518350ba 100644 --- a/test/mjsunit/harmony/modules-import-13.js +++ b/test/mjsunit/harmony/modules-import-13.js @@ -19,7 +19,7 @@ async function test1() { } test1(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); ran = false; @@ -36,5 +36,5 @@ async function test2() { } test2(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-14.js b/test/mjsunit/harmony/modules-import-14.js index 3849c54c59..32b307eb3b 100644 --- a/test/mjsunit/harmony/modules-import-14.js +++ b/test/mjsunit/harmony/modules-import-14.js @@ -22,5 +22,5 @@ async function test() { } test(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-15.js b/test/mjsunit/harmony/modules-import-15.js index 32255ce980..d041add3db 100644 --- a/test/mjsunit/harmony/modules-import-15.js +++ b/test/mjsunit/harmony/modules-import-15.js @@ -17,7 +17,7 @@ async function test1() { } test1(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); ran = false; @@ -37,7 +37,7 @@ async function test2() { } test2(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); ran = false; @@ -53,5 +53,5 @@ async function test3() { } test3(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-16.js b/test/mjsunit/harmony/modules-import-16.js index 94510d48fc..18ad445a84 100644 --- a/test/mjsunit/harmony/modules-import-16.js +++ b/test/mjsunit/harmony/modules-import-16.js @@ -12,7 +12,7 @@ var body = "import('modules-skip-1.js').then(ns => { x = ns.life();" + var func = new Function(body); func(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(42, x); assertTrue(ran); @@ -21,7 +21,7 @@ var body = "import('modules-skip-1.js').then(ns => { x = ns.life();" + " ran = true;} ).catch(err => %AbortJS(err))" eval("var func = new Function(body); func();"); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(42, x); assertTrue(ran); @@ -31,6 +31,6 @@ var body = "eval(import('modules-skip-1.js').then(ns => { x = ns.life();" + var func = new Function(body); func(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(42, x); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-17.js b/test/mjsunit/harmony/modules-import-17.js index f73aa68f3b..606ebcd385 100644 --- a/test/mjsunit/harmony/modules-import-17.js +++ b/test/mjsunit/harmony/modules-import-17.js @@ -6,6 +6,6 @@ var ns; import('modules-skip-13.js').then(x => ns = x); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(42, ns.default); assertEquals(ns, ns.self); diff --git a/test/mjsunit/harmony/modules-import-2.js b/test/mjsunit/harmony/modules-import-2.js index f50a5c8c53..a3fe0bc601 100644 --- a/test/mjsunit/harmony/modules-import-2.js +++ b/test/mjsunit/harmony/modules-import-2.js @@ -12,7 +12,7 @@ import('modules-skip-2.js').catch(err => msg = err.message); assertEquals(undefined, life); assertEquals(undefined, msg); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(42, life); assertEquals('42 is not the answer', msg); diff --git a/test/mjsunit/harmony/modules-import-3.js b/test/mjsunit/harmony/modules-import-3.js index 669f820fd7..d8cbe2a228 100644 --- a/test/mjsunit/harmony/modules-import-3.js +++ b/test/mjsunit/harmony/modules-import-3.js @@ -17,6 +17,6 @@ async function foo () { foo(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-5.js b/test/mjsunit/harmony/modules-import-5.js index d9237828fe..c868a0c63f 100644 --- a/test/mjsunit/harmony/modules-import-5.js +++ b/test/mjsunit/harmony/modules-import-5.js @@ -9,5 +9,5 @@ let x = 'modules-skip-1.js'; import(x).then(namespace => life = namespace.life()); x = 'modules-skip-2.js'; -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(42, life); diff --git a/test/mjsunit/harmony/modules-import-6.js b/test/mjsunit/harmony/modules-import-6.js index 6a5b7c8b5b..02fdf1b5fa 100644 --- a/test/mjsunit/harmony/modules-import-6.js +++ b/test/mjsunit/harmony/modules-import-6.js @@ -25,5 +25,5 @@ async function test() { test(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-7.js b/test/mjsunit/harmony/modules-import-7.js index d0105112f4..8df8ddcdb2 100644 --- a/test/mjsunit/harmony/modules-import-7.js +++ b/test/mjsunit/harmony/modules-import-7.js @@ -19,6 +19,6 @@ async function test() { test(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-8.js b/test/mjsunit/harmony/modules-import-8.js index 4417f0eb78..ac21a8c9e9 100644 --- a/test/mjsunit/harmony/modules-import-8.js +++ b/test/mjsunit/harmony/modules-import-8.js @@ -43,7 +43,7 @@ async function test1() { test1(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); @@ -66,7 +66,7 @@ async function test2() { test2(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); @@ -86,6 +86,6 @@ async function test3() { test3(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/modules-import-9.js b/test/mjsunit/harmony/modules-import-9.js index 6794311305..664416f0eb 100644 --- a/test/mjsunit/harmony/modules-import-9.js +++ b/test/mjsunit/harmony/modules-import-9.js @@ -18,5 +18,5 @@ async function test() { } test(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(ran); diff --git a/test/mjsunit/harmony/weakrefs/cleanupsome-dereffed-and-cleared-weakref.js b/test/mjsunit/harmony/weakrefs/cleanupsome-dereffed-and-cleared-weakref.js index a7105771b3..66058e8bcd 100644 --- a/test/mjsunit/harmony/weakrefs/cleanupsome-dereffed-and-cleared-weakref.js +++ b/test/mjsunit/harmony/weakrefs/cleanupsome-dereffed-and-cleared-weakref.js @@ -25,7 +25,7 @@ let weak_ref; })(); // Clear the KeepDuringJob set. -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); weak_ref.deref(); o = null; @@ -37,7 +37,7 @@ gc(); wf.cleanupSome(); assertEquals(0, cleanup_count); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. // This GC detects the WeakRef as dirty. diff --git a/test/mjsunit/harmony/weakrefs/cleanupsome-dereffed-weakref.js b/test/mjsunit/harmony/weakrefs/cleanupsome-dereffed-weakref.js index fb113bef0d..d6d9373094 100644 --- a/test/mjsunit/harmony/weakrefs/cleanupsome-dereffed-weakref.js +++ b/test/mjsunit/harmony/weakrefs/cleanupsome-dereffed-weakref.js @@ -25,7 +25,7 @@ let weak_ref; })(); // Clear the KeepDuringJob set. -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); weak_ref.deref(); o = null; @@ -37,7 +37,7 @@ gc(); wf.cleanupSome(); assertEquals(0, cleanup_count); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. // Now the WeakRef can be cleared. @@ -51,7 +51,7 @@ assertEquals(weak_ref, cleanup_cells[0]); // The cleanup task is not executed again since all WeakCells have been // processed. -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. assertEquals(1, cleanup_count); diff --git a/test/mjsunit/harmony/weakrefs/cleanupsome-weakref.js b/test/mjsunit/harmony/weakrefs/cleanupsome-weakref.js index ab1e7ebe19..d478aaab8c 100644 --- a/test/mjsunit/harmony/weakrefs/cleanupsome-weakref.js +++ b/test/mjsunit/harmony/weakrefs/cleanupsome-weakref.js @@ -31,7 +31,7 @@ gc(); wf.cleanupSome(); assertEquals(0, cleanup_count); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. // Now the WeakRef can be cleared. diff --git a/test/mjsunit/harmony/weakrefs/clear-after-deref.js b/test/mjsunit/harmony/weakrefs/clear-after-deref.js index e76ff0011f..9577f48b05 100644 --- a/test/mjsunit/harmony/weakrefs/clear-after-deref.js +++ b/test/mjsunit/harmony/weakrefs/clear-after-deref.js @@ -28,7 +28,7 @@ let wr; gc(); assertNotEquals(undefined, wr.deref()); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // New turn. let o = wr.deref(); diff --git a/test/mjsunit/harmony/weakrefs/two-weakrefs.js b/test/mjsunit/harmony/weakrefs/two-weakrefs.js index 067578f29b..7109d51fde 100644 --- a/test/mjsunit/harmony/weakrefs/two-weakrefs.js +++ b/test/mjsunit/harmony/weakrefs/two-weakrefs.js @@ -38,7 +38,7 @@ gc(); assertNotEquals(undefined, wr2.deref()); })(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // New turn. assertEquals(0, cleanup_count); @@ -47,7 +47,7 @@ wr1.deref(); o1 = null; gc(); // deref makes sure we don't clean up wr1 -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // New turn. assertEquals(0, cleanup_count); @@ -56,7 +56,7 @@ wr2.deref(); o2 = null; gc(); // deref makes sure we don't clean up wr2 -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // New turn. assertEquals(1, cleanup_count); @@ -64,7 +64,7 @@ assertEquals(wr1, cleared_cells1[0]); gc(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // New turn. assertEquals(2, cleanup_count); diff --git a/test/mjsunit/harmony/weakrefs/weakcell-and-weakref.js b/test/mjsunit/harmony/weakrefs/weakcell-and-weakref.js index 4e5eec018b..fc400169d0 100644 --- a/test/mjsunit/harmony/weakrefs/weakcell-and-weakref.js +++ b/test/mjsunit/harmony/weakrefs/weakcell-and-weakref.js @@ -34,12 +34,12 @@ gc(); assertNotEquals(undefined, weak_ref.deref()); })(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. gc(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. assertTrue(cleanup_called); diff --git a/test/mjsunit/harmony/weakrefs/weakref-creation-keeps-alive.js b/test/mjsunit/harmony/weakrefs/weakref-creation-keeps-alive.js index fd22345104..02313fe761 100644 --- a/test/mjsunit/harmony/weakrefs/weakref-creation-keeps-alive.js +++ b/test/mjsunit/harmony/weakrefs/weakref-creation-keeps-alive.js @@ -33,14 +33,14 @@ gc(); assertNotEquals(undefined, wr.deref()); })(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. assertFalse(cleanup_called); gc(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. assertTrue(cleanup_called); diff --git a/test/mjsunit/harmony/weakrefs/weakref-deref-keeps-alive.js b/test/mjsunit/harmony/weakrefs/weakref-deref-keeps-alive.js index c67dc0a11b..05917c5261 100644 --- a/test/mjsunit/harmony/weakrefs/weakref-deref-keeps-alive.js +++ b/test/mjsunit/harmony/weakrefs/weakref-deref-keeps-alive.js @@ -29,12 +29,12 @@ let strong = {a: wr.deref(), b: wr_control.deref()}; gc(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. gc(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. // We have a strong reference to the objects, so the WeakRefs are not cleared yet. @@ -57,7 +57,7 @@ gc(); assertEquals(undefined, wr_control.deref()); })(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. assertEquals(1, cleanup_count); @@ -66,7 +66,7 @@ assertEquals(wc, cleanup_cells[0]); gc(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); // Next turn. assertEquals(2, cleanup_count); diff --git a/test/mjsunit/regress/regress-5405.js b/test/mjsunit/regress/regress-5405.js index eeab479384..e21818c880 100644 --- a/test/mjsunit/regress/regress-5405.js +++ b/test/mjsunit/regress/regress-5405.js @@ -11,7 +11,7 @@ let log = []; return 10; } })(); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); (function() { with ({get ['.new.target']() { log.push('new.target') }}) { diff --git a/test/mjsunit/regress/regress-5691.js b/test/mjsunit/regress/regress-5691.js index 6cda92ca79..b460ac4b99 100644 --- a/test/mjsunit/regress/regress-5691.js +++ b/test/mjsunit/regress/regress-5691.js @@ -18,6 +18,6 @@ Promise.resolve(Promise.resolve()).then(() => log += "|fast-resolve"); (class extends Promise {}).resolve(Promise.resolve()).then(() => log += "|slow-resolve"); log += "|start"; - %RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals("|start|turn1|fast-resolve|turn2|turn3|slow-resolve|turn4\n\ |start|turn1|fast-resolve|turn2|turn3|slow-resolve|turn4", result); diff --git a/test/mjsunit/regress/regress-682349.js b/test/mjsunit/regress/regress-682349.js index d94e0691d6..f82f242f03 100644 --- a/test/mjsunit/regress/regress-682349.js +++ b/test/mjsunit/regress/regress-682349.js @@ -9,5 +9,5 @@ function f() { success = (f.caller === null); } Promise.resolve().then(f); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(success); diff --git a/test/mjsunit/regress/regress-740694.js b/test/mjsunit/regress/regress-740694.js index f07eb1b3a7..6f31fef0c7 100644 --- a/test/mjsunit/regress/regress-740694.js +++ b/test/mjsunit/regress/regress-740694.js @@ -17,6 +17,6 @@ var error; var promise = __f_0(); promise.then(assertUnreachable, err => { done = true; error = err }); -%RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertTrue(error.startsWith('Error reading')); assertTrue(done); diff --git a/test/mjsunit/regress/regress-797581.js b/test/mjsunit/regress/regress-797581.js index eb87e67128..3dfad4c463 100644 --- a/test/mjsunit/regress/regress-797581.js +++ b/test/mjsunit/regress/regress-797581.js @@ -17,7 +17,7 @@ function TryToLoadModule(filename, expect_error, token) { } import(filename).catch(SetError); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); if (expect_error) { assertTrue(caught_error instanceof SyntaxError); diff --git a/test/mjsunit/regress/regress-800651.js b/test/mjsunit/regress/regress-800651.js index c6410f702e..05e31fe4ca 100644 --- a/test/mjsunit/regress/regress-800651.js +++ b/test/mjsunit/regress/regress-800651.js @@ -27,5 +27,5 @@ function g() { let namespace = Promise.resolve().then(importUndefined); } g(); - %RunMicrotasks(); +%PerformMicrotaskCheckpoint(); assertEquals(list, [1,2]); diff --git a/test/mjsunit/test-async.js b/test/mjsunit/test-async.js index d4fee9bfb9..8f7b553988 100644 --- a/test/mjsunit/test-async.js +++ b/test/mjsunit/test-async.js @@ -80,7 +80,7 @@ var testAsync; } drainMicrotasks() { - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); } done_() { @@ -111,7 +111,7 @@ var testAsync; testAsync = function(test, name) { let assert = new AsyncAssertion(test, name); test(assert); - %RunMicrotasks(); + %PerformMicrotaskCheckpoint(); assert.done_(); } })();