Commit 15247047 authored by kschimpf's avatar kschimpf Committed by Commit bot

Separate module decoding counter into asm and wasm counters.

Currently, V8 uses the same counter to collect decoding time for both asm.js and
WASM. This separates that counter into two separate counters, and then uses the appropriate counter when instantiating a module.

BUG=chromium:704922
R=bbudge@chromium.org,mtrofin@chromium.org

Review-Url: https://codereview.chromium.org/2780563002
Cr-Commit-Position: refs/heads/master@{#44163}
parent 32fdc694
......@@ -962,7 +962,10 @@ class RuntimeCallTimerScope {
1000000, MICROSECOND) \
HT(wasm_instantiate_wasm_module_time, V8.WasmInstantiateModuleMicroSeconds, \
1000000, MICROSECOND) \
HT(wasm_decode_module_time, V8.WasmDecodeModuleMicroSeconds, 1000000, \
/* TODO(karlschimpf) Update chrome flags to reflect asm/wasm split. */ \
HT(wasm_decode_asm_module_time, V8.WasmDecodeModuleMicroSeconds, 1000000, \
MICROSECOND) \
HT(wasm_decode_wasm_module_time, V8.WasmDecodeModuleMicroSeconds, 1000000, \
MICROSECOND) \
HT(wasm_decode_function_time, V8.WasmDecodeFunctionMicroSeconds, 1000000, \
MICROSECOND) \
......
......@@ -1155,7 +1155,8 @@ ModuleResult DecodeWasmModule(Isolate* isolate, const byte* module_start,
const byte* module_end, bool verify_functions,
ModuleOrigin origin) {
HistogramTimerScope wasm_decode_module_time_scope(
isolate->counters()->wasm_decode_module_time());
IsWasm(origin) ? isolate->counters()->wasm_decode_wasm_module_time()
: isolate->counters()->wasm_decode_asm_module_time());
size_t size = module_end - module_start;
if (module_start > module_end) return ModuleError("start > end");
if (size >= kV8MaxWasmModuleSize)
......
......@@ -137,6 +137,14 @@ struct WasmExport {
};
enum ModuleOrigin : uint8_t { kWasmOrigin, kAsmJsOrigin };
inline bool IsWasm(ModuleOrigin Origin) {
return Origin == ModuleOrigin::kWasmOrigin;
}
inline bool IsAsmJs(ModuleOrigin Origin) {
return Origin == ModuleOrigin::kAsmJsOrigin;
}
struct ModuleWireBytes;
// Static representation of a module.
......@@ -184,8 +192,8 @@ struct V8_EXPORT_PRIVATE WasmModule {
ModuleOrigin get_origin() const { return origin_; }
void set_origin(ModuleOrigin new_value) { origin_ = new_value; }
bool is_wasm() const { return origin_ == kWasmOrigin; }
bool is_asm_js() const { return origin_ == kAsmJsOrigin; }
bool is_wasm() const { return wasm::IsWasm(origin_); }
bool is_asm_js() const { return wasm::IsAsmJs(origin_); }
private:
// TODO(kschimpf) - Encapsulate more fields.
......
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