[wasm] Remove fixed limit on number of background tasks

After fixing https://crbug.com/v8/8916, background compilation scales
far beyond 10 threads, especially for TurboFan (where much more work is
parallelizable). Thus, remove the limit of 10 background compilation
tasks, and use all available threads instead.

R=mstarzinger@chromium.org

Bug: v8:8916
Change-Id: I13c30777e3c85b2de7901b5eac3e6a41457a56f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1893348
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64724}
This commit is contained in:
Clemens Backes 2019-11-04 10:35:27 +01:00 committed by Commit Bot
parent 148e5e8679
commit 54379af9b0
2 changed files with 8 additions and 3 deletions

View File

@ -641,8 +641,9 @@ DEFINE_BOOL(assume_asmjs_origin, false,
"force wasm decoder to assume input is internal asm-wasm format")
DEFINE_BOOL(wasm_disable_structured_cloning, false,
"disable wasm structured cloning")
DEFINE_INT(wasm_num_compilation_tasks, 10,
"number of parallel compilation tasks for wasm")
DEFINE_INT(wasm_num_compilation_tasks, -1,
"number of parallel compilation tasks for wasm (default of -1 means "
"using all available threads)")
DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false,
"trace wasm native heap events")
DEFINE_BOOL(wasm_write_protect_code_memory, false,

View File

@ -2200,7 +2200,11 @@ bool AsyncStreamingProcessor::Deserialize(Vector<const uint8_t> module_bytes,
int GetMaxBackgroundTasks() {
if (NeedsDeterministicCompile()) return 0;
int num_worker_threads = V8::GetCurrentPlatform()->NumberOfWorkerThreads();
return std::min(FLAG_wasm_num_compilation_tasks, num_worker_threads);
int flag_limit = FLAG_wasm_num_compilation_tasks;
if (flag_limit >= 0) {
num_worker_threads = std::min(num_worker_threads, flag_limit);
}
return num_worker_threads;
}
CompilationStateImpl::CompilationStateImpl(