Separate module min memory pages counter for asm.js/WASM.

Currently, V8 uses the same size counter to measure the minimum number of memory pages allocated by a module for both asm.js and WASM. This CL separates the counter into two separate counters, and then uses the appropriate counter when measuring.

BUG=chromium:704922
R=mtrofin@chromium.org,bradnelson@chromium.org

Review-Url: https://codereview.chromium.org/2781453004
Cr-Commit-Position: refs/heads/master@{#44204}
This commit is contained in:
kschimpf 2017-03-28 11:14:12 -07:00 committed by Commit bot
parent a84da1c3b7
commit 1d4821280b
2 changed files with 6 additions and 2 deletions

View File

@ -1017,7 +1017,9 @@ class RuntimeCallTimerScope {
HM(wasm_decode_module_peak_memory_bytes, V8.WasmDecodeModulePeakMemoryBytes) \
HM(wasm_compile_function_peak_memory_bytes, \
V8.WasmCompileFunctionPeakMemoryBytes) \
HM(wasm_min_mem_pages_count, V8.WasmMinMemPagesCount) \
/* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \
HM(wasm_asm_min_mem_pages_count, V8.WasmMinMemPagesCount) \
HM(wasm_wasm_min_mem_pages_count, V8.WasmMinMemPagesCount) \
HM(wasm_max_mem_pages_count, V8.WasmMaxMemPagesCount) \
HM(wasm_function_size_bytes, V8.WasmFunctionSizeBytes) \
HM(wasm_module_size_bytes, V8.WasmModuleSizeBytes)

View File

@ -1315,7 +1315,9 @@ class InstantiationHelper {
MaybeHandle<JSArrayBuffer> old_memory;
uint32_t min_mem_pages = module_->min_mem_pages;
isolate_->counters()->wasm_min_mem_pages_count()->AddSample(min_mem_pages);
(module_->is_wasm() ? isolate_->counters()->wasm_wasm_min_mem_pages_count()
: isolate_->counters()->wasm_asm_min_mem_pages_count())
->AddSample(min_mem_pages);
if (!memory_.is_null()) {
// Set externally passed ArrayBuffer non neuterable.