Commit d958ecf4 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Remove redundant allocation of CompilationHelper

Inside the CompilationHelper, we were creating another compilation
helper to execute sequential or parallel compilation.
I don't see the reason to do so.

R=ahaas@chromium.org

Change-Id: Ib2c4486296a8f923e7e38620879c02963fff7d60
Reviewed-on: https://chromium-review.googlesource.com/497754Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45157}
parent eb64b26f
......@@ -562,18 +562,16 @@ class CompilationHelper {
->AddSample(static_cast<int>(module_->functions.size()));
if (!lazy_compile) {
CompilationHelper helper(isolate_, module_);
size_t funcs_to_compile =
module_->functions.size() - module_->num_imported_functions;
if (!FLAG_trace_wasm_decoder && FLAG_wasm_num_compilation_tasks != 0 &&
funcs_to_compile > 1) {
// Avoid a race condition by collecting results into a second vector.
std::vector<Handle<Code>> results(temp_instance.function_code);
helper.CompileInParallel(&module_env, results, thrower);
CompileInParallel(&module_env, results, thrower);
temp_instance.function_code.swap(results);
} else {
helper.CompileSequentially(&module_env, temp_instance.function_code,
thrower);
CompileSequentially(&module_env, temp_instance.function_code, thrower);
}
if (thrower->error()) return {};
}
......
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