Commit 759db9fc authored by kschimpf's avatar kschimpf Committed by Commit bot

Separate decoding module peak memory bytes for asm/wasm.

Currently, V8 uses the same counter to measue module decoding peak memory bytes
for both asm.js and WASM. This CL separates the counter into two separate
counters, and then uses the appropriate counter when decoding a module.

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

Review-Url: https://codereview.chromium.org/2778973003
Cr-Commit-Position: refs/heads/master@{#44207}
parent c95ef4af
...@@ -1014,7 +1014,11 @@ class RuntimeCallTimerScope { ...@@ -1014,7 +1014,11 @@ class RuntimeCallTimerScope {
HM(memory_heap_committed, V8.MemoryHeapCommitted) \ HM(memory_heap_committed, V8.MemoryHeapCommitted) \
HM(memory_heap_used, V8.MemoryHeapUsed) \ HM(memory_heap_used, V8.MemoryHeapUsed) \
/* Asm/Wasm */ \ /* Asm/Wasm */ \
HM(wasm_decode_module_peak_memory_bytes, V8.WasmDecodeModulePeakMemoryBytes) \ /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \
HM(wasm_decode_asm_module_peak_memory_bytes, \
V8.WasmDecodeModulePeakMemoryBytes) \
HM(wasm_decode_wasm_module_peak_memory_bytes, \
V8.WasmDecodeModulePeakMemoryBytes) \
HM(wasm_compile_function_peak_memory_bytes, \ HM(wasm_compile_function_peak_memory_bytes, \
V8.WasmCompileFunctionPeakMemoryBytes) \ V8.WasmCompileFunctionPeakMemoryBytes) \
/* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \ /* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \
......
...@@ -1173,8 +1173,10 @@ ModuleResult DecodeWasmModule(Isolate* isolate, const byte* module_start, ...@@ -1173,8 +1173,10 @@ ModuleResult DecodeWasmModule(Isolate* isolate, const byte* module_start,
// TODO(titzer): this isn't accurate, since it doesn't count the data // TODO(titzer): this isn't accurate, since it doesn't count the data
// allocated on the C++ heap. // allocated on the C++ heap.
// https://bugs.chromium.org/p/chromium/issues/detail?id=657320 // https://bugs.chromium.org/p/chromium/issues/detail?id=657320
isolate->counters()->wasm_decode_module_peak_memory_bytes()->AddSample( (IsWasm(origin)
static_cast<int>(zone->allocation_size())); ? isolate->counters()->wasm_decode_wasm_module_peak_memory_bytes()
: isolate->counters()->wasm_decode_asm_module_peak_memory_bytes())
->AddSample(static_cast<int>(zone->allocation_size()));
return result; return result;
} }
......
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