[wasm] Do not cache {should_log_code} in compilation state

The compilation state is isolate-independent, so it should not cache
the isolate-specific {should_log_code} flag.
Instead, we log via the WasmEngine every time. If this turns out to be
too expensive, we should introduce an atomic flag in the WasmEngine.

R=mstarzinger@chromium.org

Bug: v8:8050
Change-Id: I913ada4f86af4c6fa9cd9c5adc8d4e250f6eb7f1
Reviewed-on: https://chromium-review.googlesource.com/c/1451820
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59335}
This commit is contained in:
Clemens Hammacher 2019-02-04 12:09:42 +01:00 committed by Commit Bot
parent b364ceb10c
commit 46cc15b190

View File

@ -218,11 +218,6 @@ class CompilationStateImpl {
NativeModule* const native_module_;
const std::shared_ptr<BackgroundCompileToken> background_compile_token_;
const CompileMode compile_mode_;
// Store the value of {WasmCode::ShouldBeLogged()} at creation time of the
// compilation state.
// TODO(wasm): We might lose log events if logging is enabled while
// compilation is running.
bool const should_log_code_;
// Compilation error, atomically updated, but at most once (nullptr -> error).
// Uses acquire-release semantics (acquire on load, release on update).
@ -1474,7 +1469,6 @@ CompilationStateImpl::CompilationStateImpl(internal::Isolate* isolate,
native_module->module()->origin == kWasmOrigin
? CompileMode::kTiering
: CompileMode::kRegular),
should_log_code_(WasmCode::ShouldBeLogged(isolate)),
max_background_tasks_(std::max(
1, std::min(FLAG_wasm_num_compilation_tasks,
V8::GetCurrentPlatform()->NumberOfWorkerThreads()))) {
@ -1589,9 +1583,7 @@ void CompilationStateImpl::OnFinishedUnit(ExecutionTier tier, WasmCode* code) {
}
}
if (should_log_code_ && code != nullptr) {
engine_->LogCode(code);
}
if (code != nullptr) engine_->LogCode(code);
}
void CompilationStateImpl::RestartBackgroundCompileTask() {