From 35701006960e4a6419f2dcb62964cfbb311bcd5a Mon Sep 17 00:00:00 2001 From: kschimpf Date: Mon, 27 Mar 2017 14:09:37 -0700 Subject: [PATCH] Split counters for functions per module for asm and wasm. Currently, V8 uses the same counter to count both wasm and and asm js. This splits the counters into two separate counters, and then uses the appropriate counter when instantiating the module. BUG=chromium:704922 R=bbudge@chromium.org,bradnelson@chromium.org Review-Url: https://codereview.chromium.org/2777073003 Cr-Commit-Position: refs/heads/master@{#44164} --- src/counters.h | 3 ++- src/wasm/wasm-module.cc | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/counters.h b/src/counters.h index 1bb92ee386..27b51d40a7 100644 --- a/src/counters.h +++ b/src/counters.h @@ -926,7 +926,8 @@ class RuntimeCallTimerScope { HR(scavenge_reason, V8.GCScavengeReason, 0, 21, 22) \ HR(young_generation_handling, V8.GCYoungGenerationHandling, 0, 2, 3) \ /* Asm/Wasm. */ \ - HR(wasm_functions_per_module, V8.WasmFunctionsPerModule, 1, 10000, 51) + HR(wasm_functions_per_asm_module, V8.WasmFunctionsPerModule, 1, 10000, 51) \ + HR(wasm_functions_per_wasm_module, V8.WasmFunctionsPerModule, 1, 10000, 51) #define HISTOGRAM_TIMER_LIST(HT) \ /* Garbage collection timers. */ \ diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc index d1f0760825..21b01e5552 100644 --- a/src/wasm/wasm-module.cc +++ b/src/wasm/wasm-module.cc @@ -542,8 +542,10 @@ class CompilationHelper { temp_instance.function_code[i] = init_builtin; } - isolate_->counters()->wasm_functions_per_module()->AddSample( - static_cast(module_->functions.size())); + (module_->is_wasm() ? isolate_->counters()->wasm_functions_per_wasm_module() + : isolate_->counters()->wasm_functions_per_asm_module()) + ->AddSample(static_cast(module_->functions.size())); + if (!lazy_compile) { CompilationHelper helper(isolate_, module_); size_t funcs_to_compile =