Commit f3bfe565 authored by Karl Schimpf's avatar Karl Schimpf Committed by Commit Bot

Fix UMA stats for WASM function size

The code was updating the UMA stats for V8.WasmFunctionSizeBytes when
the WASM function was decoded. Unfortunately, decoding of functions is
no longer done as a separate step. Rather, it is done as part of the
compilation step.

This CL moves the UMA updates to the compilation step.

Bug: v8:7032
Change-Id: I4679036035540fabd43855c1ba5ba66ffee6762a
Reviewed-on: https://chromium-review.googlesource.com/754023
Commit-Queue: Karl Schimpf <kschimpf@chromium.org>
Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49117}
parent 1b9e9bb9
......@@ -4719,6 +4719,11 @@ WasmCompilationUnit::~WasmCompilationUnit() {
}
void WasmCompilationUnit::ExecuteCompilation() {
auto size_histogram = env_->module->is_wasm()
? counters()->wasm_wasm_function_size_bytes()
: counters()->wasm_asm_function_size_bytes();
size_histogram->AddSample(
static_cast<int>(func_body_.end - func_body_.start));
auto timed_histogram = env_->module->is_wasm()
? counters()->wasm_compile_wasm_function_time()
: counters()->wasm_compile_asm_function_time();
......
......@@ -738,10 +738,6 @@ class ModuleDecoderImpl : public Decoder {
void DecodeFunctionBody(uint32_t index, uint32_t length, uint32_t offset,
bool verify_functions) {
auto size_histogram = module_->is_wasm()
? GetCounters()->wasm_wasm_function_size_bytes()
: GetCounters()->wasm_asm_function_size_bytes();
size_histogram->AddSample(length);
WasmFunction* function =
&module_->functions[index + module_->num_imported_functions];
function->code = {offset, length};
......
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