Commit 4e3f4b2d authored by kschimpf's avatar kschimpf Committed by Commit bot

Separate module byte size counter for asm.js/wasm.

Currently, V8 uses the same size counter to measure module sizes for both asm.js
and WASM. This CL separates the counter into two separate counters, and then
uses the appropriate counter when decoding.

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

Review-Url: https://codereview.chromium.org/2777203005
Cr-Commit-Position: refs/heads/master@{#44211}
parent 90c12512
......@@ -1030,7 +1030,9 @@ class RuntimeCallTimerScope {
/* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \
HM(wasm_asm_function_size_bytes, V8.WasmFunctionSizeBytes) \
HM(wasm_wasm_function_size_bytes, V8.WasmFunctionSizeBytes) \
HM(wasm_module_size_bytes, V8.WasmModuleSizeBytes)
/* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \
HM(wasm_asm_module_size_bytes, V8.WasmModuleSizeBytes) \
HM(wasm_wasm_module_size_bytes, V8.WasmModuleSizeBytes)
// 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
......
......@@ -1162,8 +1162,9 @@ ModuleResult DecodeWasmModule(Isolate* isolate, const byte* module_start,
if (size >= kV8MaxWasmModuleSize)
return ModuleError("size > maximum module size");
// TODO(bradnelson): Improve histogram handling of size_t.
isolate->counters()->wasm_module_size_bytes()->AddSample(
static_cast<int>(size));
(IsWasm(origin) ? isolate->counters()->wasm_wasm_module_size_bytes()
: isolate->counters()->wasm_asm_module_size_bytes())
->AddSample(static_cast<int>(size));
// Signatures are stored in zone memory, which have the same lifetime
// as the {module}.
Zone* zone = new Zone(isolate->allocator(), ZONE_NAME);
......
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