Commit 184e8fb8 authored by tzik's avatar tzik Committed by Commit Bot

Avoid nested RunMicrotasks on d8

%RunMicrotasks() call used to cause a nested RunMicrotasks if it's
called from a microtask, and that breaks its invariants.
This CL fixes it by disabling the nested loop.

Change-Id: I2f4a81be0dbf0554abf6eb41b62c25465338f29a
Reviewed-on: https://chromium-review.googlesource.com/c/1358036Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58026}
parent 9583858e
......@@ -3013,7 +3013,7 @@ bool ProcessMessages(
SealHandleScope shs(isolate);
while (v8::platform::PumpMessageLoop(g_default_platform, isolate,
behavior())) {
isolate->RunMicrotasks();
MicrotasksScope::PerformCheckpoint(isolate);
}
if (g_default_platform->IdleTasksEnabled(isolate)) {
v8::platform::RunIdleTasks(g_default_platform, isolate,
......
......@@ -4310,6 +4310,8 @@ void Isolate::EnqueueMicrotask(Handle<Microtask> microtask) {
void Isolate::RunMicrotasks() {
DCHECK(!is_running_microtasks_);
// TODO(tzik): Move the suppression, |is_running_microtask_|, and the
// completion callbacks into MicrotaskQueue.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment