Commit 1904dd69 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[wasm] Fix background compilation thread in predictable mode

GetMaxBackgroundTasks should return 0 in predictable mode, since
compilation is done in the foreground.

R=clemensh@chromium.org

Change-Id: I4a617cadb53ca91ee21e40c46a93d54e2a1ceb8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1789301
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63600}
parent ffa9f163
...@@ -2209,11 +2209,9 @@ bool AsyncStreamingProcessor::Deserialize(Vector<const uint8_t> module_bytes, ...@@ -2209,11 +2209,9 @@ bool AsyncStreamingProcessor::Deserialize(Vector<const uint8_t> module_bytes,
} }
int GetMaxBackgroundTasks() { int GetMaxBackgroundTasks() {
if (NeedsDeterministicCompile()) return 1; if (NeedsDeterministicCompile()) return 0;
int num_worker_threads = V8::GetCurrentPlatform()->NumberOfWorkerThreads(); int num_worker_threads = V8::GetCurrentPlatform()->NumberOfWorkerThreads();
int num_compile_tasks = return std::min(FLAG_wasm_num_compilation_tasks, num_worker_threads);
std::min(FLAG_wasm_num_compilation_tasks, num_worker_threads);
return std::max(1, num_compile_tasks);
} }
CompilationStateImpl::CompilationStateImpl( CompilationStateImpl::CompilationStateImpl(
...@@ -2227,7 +2225,7 @@ CompilationStateImpl::CompilationStateImpl( ...@@ -2227,7 +2225,7 @@ CompilationStateImpl::CompilationStateImpl(
? CompileMode::kTiering ? CompileMode::kTiering
: CompileMode::kRegular), : CompileMode::kRegular),
async_counters_(std::move(async_counters)), async_counters_(std::move(async_counters)),
max_background_tasks_(GetMaxBackgroundTasks()), max_background_tasks_(std::max(GetMaxBackgroundTasks(), 1)),
compilation_unit_queues_(max_background_tasks_), compilation_unit_queues_(max_background_tasks_),
available_task_ids_(max_background_tasks_) { available_task_ids_(max_background_tasks_) {
for (int i = 0; i < max_background_tasks_; ++i) { for (int i = 0; i < max_background_tasks_; ++i) {
......
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