Commit ed2aeeb8 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Reuse callback trigger logic for empty modules

Instead of hard-coding the logic for empty modules, just re-use the
{TriggerCallbacks} method. This will also ensure that the
{finished_events_} set will be populated correctly, such that callbacks
added later will still receive the events.

R=ahaas@chromium.org

Bug: chromium:1101340
Change-Id: I6641f23dc0459d0b6591bb03cc8c1b99dcaa90ff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2351669Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69368}
parent c374682c
......@@ -2602,18 +2602,7 @@ void CompilationStateImpl::InitializeCompilationProgress(bool lazy_module,
// Trigger callbacks if module needs no baseline or top tier compilation. This
// can be the case for an empty or fully lazy module.
if (outstanding_baseline_units_ == 0) {
for (auto& callback : callbacks_) {
callback(CompilationEvent::kFinishedBaselineCompilation);
}
if (outstanding_top_tier_functions_ == 0) {
for (auto& callback : callbacks_) {
callback(CompilationEvent::kFinishedTopTierCompilation);
}
// Clear the callbacks because no more events will be delivered.
callbacks_.clear();
}
}
TriggerCallbacks();
}
void CompilationStateImpl::InitializeRecompilation(
......
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