Commit 8d708c65 authored by bradnelson's avatar bradnelson Committed by Commit bot

[wasm] Allow --turbo-stats to collect wasm compilation info.

Enable compilation stats for Wasm code.
As parallel compilation can interfere with these measurements,
also force single threaded compilation when collecting stats.

BUG=None
TEST=None
LOG=N
R=mtrofin@chromium.org

Review-Url: https://codereview.chromium.org/2769743002
Cr-Commit-Position: refs/heads/master@{#44046}
parent 2747ab31
......@@ -115,6 +115,7 @@ class PipelineData {
// For WASM compile entry point.
PipelineData(ZoneStats* zone_stats, CompilationInfo* info, JSGraph* jsgraph,
PipelineStatistics* pipeline_statistics,
SourcePositionTable* source_positions,
ZoneVector<trap_handler::ProtectedInstructionData>*
protected_instructions)
......@@ -122,6 +123,7 @@ class PipelineData {
info_(info),
debug_name_(info_->GetDebugName()),
zone_stats_(zone_stats),
pipeline_statistics_(pipeline_statistics),
graph_zone_scope_(zone_stats_, ZONE_NAME),
graph_(jsgraph->graph()),
source_positions_(source_positions),
......@@ -648,7 +650,9 @@ class PipelineWasmCompilationJob final : public CompilationJob {
: CompilationJob(info->isolate(), info, "TurboFan",
State::kReadyToExecute),
zone_stats_(info->isolate()->allocator()),
data_(&zone_stats_, info, jsgraph, source_positions, protected_insts),
pipeline_statistics_(CreatePipelineStatistics(info, &zone_stats_)),
data_(&zone_stats_, info, jsgraph, pipeline_statistics_.get(),
source_positions, protected_insts),
pipeline_(&data_),
linkage_(descriptor),
allow_signalling_nan_(allow_signalling_nan) {}
......@@ -660,6 +664,7 @@ class PipelineWasmCompilationJob final : public CompilationJob {
private:
ZoneStats zone_stats_;
std::unique_ptr<PipelineStatistics> pipeline_statistics_;
PipelineData data_;
PipelineImpl pipeline_;
Linkage linkage_;
......
......@@ -528,6 +528,8 @@ 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")
// Parallel compilation confuses turbo_stats, force single threaded.
DEFINE_VALUE_IMPLICATION(turbo_stats, wasm_num_compilation_tasks, 0)
DEFINE_UINT(wasm_max_mem_pages, v8::internal::wasm::kV8MaxWasmMemoryPages,
"maximum memory size of a wasm instance")
DEFINE_UINT(wasm_max_table_size, v8::internal::wasm::kV8MaxWasmTableSize,
......
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