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

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

Issue 2780783003: Separate function byte size counter for asm.js/wasm. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « src/counters.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/module-decoder.cc
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc
index 84c39a9092f99d5c9a7b8d09e1541851ea8a57e6..491a6ccf11d36693d6451676fd5a26cd74ec6403 100644
--- a/src/wasm/module-decoder.cc
+++ b/src/wasm/module-decoder.cc
@@ -1195,16 +1195,17 @@ FunctionResult DecodeWasmFunction(Isolate* isolate, Zone* zone,
ModuleBytesEnv* module_env,
const byte* function_start,
const byte* function_end) {
+ bool is_wasm = module_env->module_env.is_wasm();
HistogramTimerScope wasm_decode_function_time_scope(
- module_env->module_env.is_wasm()
- ? isolate->counters()->wasm_decode_wasm_function_time()
- : isolate->counters()->wasm_decode_asm_function_time());
+ is_wasm ? isolate->counters()->wasm_decode_wasm_function_time()
+ : isolate->counters()->wasm_decode_asm_function_time());
size_t size = function_end - function_start;
if (function_start > function_end) return FunctionError("start > end");
if (size > kV8MaxWasmFunctionSize)
return FunctionError("size > maximum function size");
- isolate->counters()->wasm_function_size_bytes()->AddSample(
- static_cast<int>(size));
+ (is_wasm ? isolate->counters()->wasm_wasm_function_size_bytes()
+ : isolate->counters()->wasm_asm_function_size_bytes())
+ ->AddSample(static_cast<int>(size));
WasmFunction* function = new WasmFunction();
ModuleDecoder decoder(zone, function_start, function_end, kWasmOrigin);
return decoder.DecodeSingleFunction(module_env, function);
« no previous file with comments | « src/counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698