Commit 0f8fb0c2 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Reduce calls to {TriggerCallbacks}

Each run of {OnFinishedUnits} can only trigger baseline completion or
top tier completion at most once, so we can pull the call out of the
loop.

R=ahaas@chromium.org

Change-Id: I7eaf42addbbaa9600cb9bf95dce76399be683971
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1889879Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64653}
parent 05918654
......@@ -2372,13 +2372,13 @@ void CompilationStateImpl::OnFinishedUnits(Vector<WasmCode*> code_vector) {
DCHECK_EQ(compilation_progress_.size(),
native_module_->module()->num_declared_functions);
bool completes_baseline_compilation = false;
bool completes_top_tier_compilation = false;
for (WasmCode* code : code_vector) {
DCHECK_NOT_NULL(code);
DCHECK_LT(code->index(), native_module_->num_functions());
bool completes_baseline_compilation = false;
bool completes_top_tier_compilation = false;
if (code->index() < native_module_->num_imported_functions()) {
// Import wrapper.
DCHECK_EQ(code->tier(), ExecutionTier::kTurbofan);
......@@ -2429,10 +2429,10 @@ void CompilationStateImpl::OnFinishedUnits(Vector<WasmCode*> code_vector) {
}
DCHECK_LE(0, outstanding_baseline_units_);
}
TriggerCallbacks(completes_baseline_compilation,
completes_top_tier_compilation);
}
TriggerCallbacks(completes_baseline_compilation,
completes_top_tier_compilation);
}
void CompilationStateImpl::OnFinishedJSToWasmWrapperUnits(int num) {
......
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