Commit 46cc15b1 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[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/1451820Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59335}
parent b364ceb1
...@@ -218,11 +218,6 @@ class CompilationStateImpl { ...@@ -218,11 +218,6 @@ class CompilationStateImpl {
NativeModule* const native_module_; NativeModule* const native_module_;
const std::shared_ptr<BackgroundCompileToken> background_compile_token_; const std::shared_ptr<BackgroundCompileToken> background_compile_token_;
const CompileMode compile_mode_; 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). // Compilation error, atomically updated, but at most once (nullptr -> error).
// Uses acquire-release semantics (acquire on load, release on update). // Uses acquire-release semantics (acquire on load, release on update).
...@@ -1474,7 +1469,6 @@ CompilationStateImpl::CompilationStateImpl(internal::Isolate* isolate, ...@@ -1474,7 +1469,6 @@ CompilationStateImpl::CompilationStateImpl(internal::Isolate* isolate,
native_module->module()->origin == kWasmOrigin native_module->module()->origin == kWasmOrigin
? CompileMode::kTiering ? CompileMode::kTiering
: CompileMode::kRegular), : CompileMode::kRegular),
should_log_code_(WasmCode::ShouldBeLogged(isolate)),
max_background_tasks_(std::max( max_background_tasks_(std::max(
1, std::min(FLAG_wasm_num_compilation_tasks, 1, std::min(FLAG_wasm_num_compilation_tasks,
V8::GetCurrentPlatform()->NumberOfWorkerThreads()))) { V8::GetCurrentPlatform()->NumberOfWorkerThreads()))) {
...@@ -1589,9 +1583,7 @@ void CompilationStateImpl::OnFinishedUnit(ExecutionTier tier, WasmCode* code) { ...@@ -1589,9 +1583,7 @@ void CompilationStateImpl::OnFinishedUnit(ExecutionTier tier, WasmCode* code) {
} }
} }
if (should_log_code_ && code != nullptr) { if (code != nullptr) engine_->LogCode(code);
engine_->LogCode(code);
}
} }
void CompilationStateImpl::RestartBackgroundCompileTask() { void CompilationStateImpl::RestartBackgroundCompileTask() {
......
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