Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Unified Diff: src/wasm/wasm-module.cc

Issue 1866873002: [wasm] Adding metrics for Asm/Wasm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index a1c2a7a3e10a0900ba4de3aaebc3fabe1ab3ca91..abfcaea3eb52fd28d0e6a438b8aed57c0ce8ba67 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -382,6 +382,8 @@ static MaybeHandle<JSFunction> LookupFunction(
MaybeHandle<JSObject> WasmModule::Instantiate(Isolate* isolate,
Handle<JSObject> ffi,
Handle<JSArrayBuffer> memory) {
+ HistogramTimerScope wasm_instantiate_time_scope(
+ isolate->counters()->wasm_instantiate_time());
this->shared_isolate = isolate; // TODO(titzer): have a real shared isolate.
ErrorThrower thrower(isolate, "WasmModule::Instantiate()");
Factory* factory = isolate->factory();
@@ -402,6 +404,10 @@ MaybeHandle<JSObject> WasmModule::Instantiate(Isolate* isolate,
//-------------------------------------------------------------------------
// Allocate and initialize the linear memory.
//-------------------------------------------------------------------------
+ isolate->counters()->wasm_min_mem_pages_memory()->AddSample(
+ instance.module->min_mem_pages);
+ isolate->counters()->wasm_max_mem_pages_memory()->AddSample(
+ instance.module->max_mem_pages);
if (memory.is_null()) {
if (!AllocateMemory(&thrower, isolate, &instance)) {
return MaybeHandle<JSObject>();
@@ -424,6 +430,9 @@ MaybeHandle<JSObject> WasmModule::Instantiate(Isolate* isolate,
*instance.globals_buffer);
}
+ HistogramTimerScope wasm_compile_time_scope(
+ isolate->counters()->wasm_compile_time());
+
//-------------------------------------------------------------------------
// Compile wrappers to imported functions.
//-------------------------------------------------------------------------
@@ -458,6 +467,9 @@ MaybeHandle<JSObject> WasmModule::Instantiate(Isolate* isolate,
// Compile all functions in the module.
//-------------------------------------------------------------------------
+ isolate->counters()->wasm_functions_per_module()->AddSample(
+ static_cast<int>(functions.size()));
+
// First pass: compile each function and initialize the code table.
index = FLAG_skip_compiling_wasm_funcs;
while (index < functions.size()) {

Powered by Google App Engine
This is Rietveld 408576698