From a7462060ea808e1f2ddc4d4bb198715381e87766 Mon Sep 17 00:00:00 2001 From: Michael Starzinger Date: Wed, 17 May 2017 16:31:28 +0200 Subject: [PATCH] [asm.js] Add tracking of parser zone memory footprint. R=clemensh@chromium.org Change-Id: Ic1cc9bd5560a315128242dc58b29a76e359ca11f Reviewed-on: https://chromium-review.googlesource.com/507212 Reviewed-by: Clemens Hammacher Commit-Queue: Michael Starzinger Cr-Commit-Position: refs/heads/master@{#45389} --- src/asmjs/asm-js.cc | 4 ++++ src/counters.h | 36 +++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/asmjs/asm-js.cc b/src/asmjs/asm-js.cc index 4f55e34683..5544193ab9 100644 --- a/src/asmjs/asm-js.cc +++ b/src/asmjs/asm-js.cc @@ -206,6 +206,10 @@ MaybeHandle AsmJs::CompileAsmViaWasm(CompilationInfo* info) { size_t compile_zone_size = info->zone()->allocation_size() - compile_zone_start; size_t translate_zone_size = translate_zone.allocation_size(); + info->isolate() + ->counters() + ->asm_wasm_translation_peak_memory_bytes() + ->AddSample(static_cast(translate_zone_size)); translate_time = translate_timer.Elapsed().InMillisecondsF(); if (FLAG_trace_asm_parser) { PrintF( diff --git a/src/counters.h b/src/counters.h index 704e5858aa..bb917cc518 100644 --- a/src/counters.h +++ b/src/counters.h @@ -1020,23 +1020,25 @@ class RuntimeCallTimerScope { HM(heap_sample_code_space_committed, V8.MemoryHeapSampleCodeSpaceCommitted) \ HM(heap_sample_maximum_committed, V8.MemoryHeapSampleMaximumCommitted) -#define HISTOGRAM_MEMORY_LIST(HM) \ - HM(memory_heap_committed, V8.MemoryHeapCommitted) \ - HM(memory_heap_used, V8.MemoryHeapUsed) \ - /* Asm/Wasm */ \ - HM(wasm_decode_asm_module_peak_memory_bytes, \ - V8.WasmDecodeModulePeakMemoryBytes.asm) \ - HM(wasm_decode_wasm_module_peak_memory_bytes, \ - V8.WasmDecodeModulePeakMemoryBytes.wasm) \ - HM(wasm_compile_function_peak_memory_bytes, \ - V8.WasmCompileFunctionPeakMemoryBytes) \ - HM(wasm_asm_min_mem_pages_count, V8.WasmMinMemPagesCount.asm) \ - HM(wasm_wasm_min_mem_pages_count, V8.WasmMinMemPagesCount.wasm) \ - HM(wasm_wasm_max_mem_pages_count, V8.WasmMaxMemPagesCount.wasm) \ - HM(wasm_asm_function_size_bytes, V8.WasmFunctionSizeBytes.asm) \ - HM(wasm_wasm_function_size_bytes, V8.WasmFunctionSizeBytes.wasm) \ - HM(wasm_asm_module_size_bytes, V8.WasmModuleSizeBytes.asm) \ - HM(wasm_wasm_module_size_bytes, V8.WasmModuleSizeBytes.wasm) +#define HISTOGRAM_MEMORY_LIST(HM) \ + HM(memory_heap_committed, V8.MemoryHeapCommitted) \ + HM(memory_heap_used, V8.MemoryHeapUsed) \ + /* Asm/Wasm */ \ + HM(wasm_decode_asm_module_peak_memory_bytes, \ + V8.WasmDecodeModulePeakMemoryBytes.asm) \ + HM(wasm_decode_wasm_module_peak_memory_bytes, \ + V8.WasmDecodeModulePeakMemoryBytes.wasm) \ + HM(wasm_compile_function_peak_memory_bytes, \ + V8.WasmCompileFunctionPeakMemoryBytes) \ + HM(wasm_asm_min_mem_pages_count, V8.WasmMinMemPagesCount.asm) \ + HM(wasm_wasm_min_mem_pages_count, V8.WasmMinMemPagesCount.wasm) \ + HM(wasm_wasm_max_mem_pages_count, V8.WasmMaxMemPagesCount.wasm) \ + HM(wasm_asm_function_size_bytes, V8.WasmFunctionSizeBytes.asm) \ + HM(wasm_wasm_function_size_bytes, V8.WasmFunctionSizeBytes.wasm) \ + HM(wasm_asm_module_size_bytes, V8.WasmModuleSizeBytes.asm) \ + HM(wasm_wasm_module_size_bytes, V8.WasmModuleSizeBytes.wasm) \ + HM(asm_wasm_translation_peak_memory_bytes, \ + V8.AsmWasmTranslationPeakMemoryBytes) // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC // Intellisense to crash. It was broken into two macros (each of length 40