From c18df50014cc11933c88e5b1ca326313061f930c Mon Sep 17 00:00:00 2001 From: Kim-Anh Tran Date: Thu, 8 Feb 2018 11:50:54 +0100 Subject: [PATCH] [wasm] Fix tracing info for lazy compilation on native heap Added counter to correctly reflect the number of non-compiled functions. Added usages of variables used only for tracing or debug to avoid compiler warnings. R=clemensh@chromium.org Change-Id: I4c8d9c0f43bf23250b4702e43592cd64046d28c7 Reviewed-on: https://chromium-review.googlesource.com/907890 Commit-Queue: Kim-Anh Tran Reviewed-by: Clemens Hammacher Cr-Commit-Position: refs/heads/master@{#51201} --- src/wasm/module-compiler.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/wasm/module-compiler.cc b/src/wasm/module-compiler.cc index dcd9001f43..d805a63405 100644 --- a/src/wasm/module-compiler.cc +++ b/src/wasm/module-compiler.cc @@ -660,6 +660,7 @@ Address CompileLazy(Isolate* isolate) { func_index, isolate->heap()->undefined_value()); DCHECK_LT(0, patched); + USE(patched); } return result->instructions().start(); @@ -1075,6 +1076,7 @@ const wasm::WasmCode* LazyCompilationOrchestrator::CompileFromJsToWasm( } DCHECK_LT(0, patched); TRACE_LAZY("Patched %d location(s) in the caller.\n", patched); + USE(patched); #ifdef DEBUG it.next(); @@ -1122,6 +1124,7 @@ const wasm::WasmCode* LazyCompilationOrchestrator::CompileDirectCall( ->module() ->functions[caller_func_index] .code.offset(); + int num_non_compiled_functions = 0; for (RelocIterator it(wasm_caller->instructions(), wasm_caller->reloc_info(), wasm_caller->constant_pool(), @@ -1142,6 +1145,8 @@ const wasm::WasmCode* LazyCompilationOrchestrator::CompileDirectCall( non_compiled_functions.push_back(Nothing()); continue; } + ++num_non_compiled_functions; + uint32_t called_func_index = ExtractDirectCallIndex(decoder, func_bytes + byte_pos); DCHECK_LT(called_func_index, @@ -1154,8 +1159,9 @@ const wasm::WasmCode* LazyCompilationOrchestrator::CompileDirectCall( } } - TRACE_LAZY("Found %zu non-compiled functions in caller.\n", - non_compiled_functions.size()); + TRACE_LAZY("Found %d non-compiled functions in caller.\n", + num_non_compiled_functions); + USE(num_non_compiled_functions); } uint32_t func_to_return_idx = 0; @@ -1215,6 +1221,7 @@ const wasm::WasmCode* LazyCompilationOrchestrator::CompileDirectCall( DCHECK_LT(0, patched); TRACE_LAZY("Patched %d location(s) in the caller.\n", patched); + USE(patched); return ret; }