Index: src/wasm/wasm-module.cc |
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc |
index d880547868055450f4ea5a904cb68b9c58898268..cfffcec07e7d7dd5aa83ba9e115e7b0ebb5b552a 100644 |
--- a/src/wasm/wasm-module.cc |
+++ b/src/wasm/wasm-module.cc |
@@ -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; |
} |