Commit f6d0dc6d authored by bradnelson's avatar bradnelson Committed by Commit bot

[wasm][asm.js] Add wasm module size to asm debug measurements.

Also show size when --trace-asm-time is on.

BUG=
R=mtrofin@chromium.org

Review-Url: https://codereview.chromium.org/2658703003
Cr-Commit-Position: refs/heads/master@{#42678}
parent d0befa95
......@@ -191,6 +191,8 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) {
internal::wasm::kAsmJsOrigin, info->script(), asm_offsets_vec);
DCHECK(!compiled.is_null());
double compile_time = compile_timer.Elapsed().InMillisecondsF();
DCHECK_GE(module->end(), module->begin());
uintptr_t wasm_size = module->end() - module->begin();
wasm::AsmTyper::StdlibSet uses = builder.typer()->StdlibUses();
Handle<FixedArray> uses_array =
......@@ -216,10 +218,10 @@ MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) {
if (FLAG_predictable) {
length = base::OS::SNPrintF(text, arraysize(text), "success");
} else {
length =
base::OS::SNPrintF(text, arraysize(text),
"success, asm->wasm: %0.3f ms, compile: %0.3f ms",
asm_wasm_time, compile_time);
length = base::OS::SNPrintF(
text, arraysize(text),
"success, asm->wasm: %0.3f ms, compile: %0.3f ms, %" PRIuPTR " bytes",
asm_wasm_time, compile_time, wasm_size);
}
DCHECK_NE(-1, length);
USE(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