Commit 90c12512 authored by kschimpf's avatar kschimpf Committed by Commit bot

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

Currently, V* uses the same size counter to measure the maximum 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/2783713002
Cr-Commit-Position: refs/heads/master@{#44210}
parent b6bbf682
......@@ -1024,7 +1024,9 @@ class RuntimeCallTimerScope {
/* 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) \
/* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \
HM(wasm_asm_max_mem_pages_count, V8.WasmMaxMemPagesCount) \
HM(wasm_wasm_max_mem_pages_count, V8.WasmMaxMemPagesCount) \
/* 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) \
......
......@@ -2347,9 +2347,12 @@ uint32_t GetMaxInstanceMemoryPages(Isolate* isolate,
if (maximum < FLAG_wasm_max_mem_pages) return maximum;
}
}
uint32_t compiled_max_pages = instance->compiled_module()->max_mem_pages();
isolate->counters()->wasm_max_mem_pages_count()->AddSample(
compiled_max_pages);
WasmCompiledModule* compiled_module = instance->compiled_module();
uint32_t compiled_max_pages = compiled_module->max_mem_pages();
(compiled_module->module()->is_wasm()
? isolate->counters()->wasm_wasm_max_mem_pages_count()
: isolate->counters()->wasm_asm_max_mem_pages_count())
->AddSample(compiled_max_pages);
if (compiled_max_pages != 0) return compiled_max_pages;
return FLAG_wasm_max_mem_pages;
}
......
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