Commit 5ef33ea5 authored by Kim-Anh Tran's avatar Kim-Anh Tran Committed by Commit Bot

[wasm] Update counters after tier-up

Statistics need to be updated after top-tier code is added to
the native module.

Change-Id: Ie3a76caf233a2c3929b40fd0371c3069724b5289
Reviewed-on: https://chromium-review.googlesource.com/1027854Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@google.com>
Cr-Commit-Position: refs/heads/master@{#52787}
parent 76cab5ff
......@@ -1520,9 +1520,14 @@ class FinishCompileTask : public CancelableTask {
// directly be used by Liftoff-compiled code. Therefore we need
// to patch the compiled Turbofan function directly after finishing it.
DCHECK_EQ(CompileMode::kTiering, compilation_state_->compile_mode());
DCHECK(!result->is_liftoff());
CodeSpecialization code_specialization;
code_specialization.RelocateDirectCalls(native_module);
code_specialization.ApplyToWasmCode(result);
// Update the counters to include the top-tier code.
RecordStats(result,
compilation_state_->isolate()->async_counters().get());
}
// Update the compilation state, and possibly notify
......@@ -3116,6 +3121,7 @@ class AsyncCompileJob::FinishModule : public CompileStep {
class AsyncCompileJob::UpdateToTopTierCompiledCode : public CompileStep {
void RunInForeground() override {
TRACE_COMPILE("(7) Update native module to use optimized code...\n");
UpdateAllCompiledModulesWithTopTierCode(job_->compiled_module_);
job_->isolate_->wasm_engine()->compilation_manager()->RemoveJob(job_);
}
......
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