Commit 12066fc5 authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[d8] Pump message when waiting for TLA Promise

We might have to wait for background tasks to complete (e.g. when
awaiting ax  WebAssembly.instantiate) and not just other promises.

Bug: v8:12568
Change-Id: Ibf99074d7a3c924b77b7959006087a05d39ffd3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3423777Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78871}
parent 498264f4
......@@ -1401,11 +1401,9 @@ bool Shell::ExecuteModule(Isolate* isolate, const char* file_name) {
}
// Loop until module execution finishes
// TODO(cbruni): This is a bit wonky. "Real" engines would not be
// able to just busy loop waiting for execution to finish.
Local<Promise> result_promise(result.As<Promise>());
while (result_promise->State() == Promise::kPending) {
isolate->PerformMicrotaskCheckpoint();
Shell::CompleteMessageLoop(isolate);
}
if (result_promise->State() == Promise::kRejected) {
......
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