 Chromium Code Reviews
 Chromium Code Reviews Issue 2780563002:
  Separate module decoding counter into asm and wasm counters.  (Closed)
    
  
    Issue 2780563002:
  Separate module decoding counter into asm and wasm counters.  (Closed) 
  | Index: src/wasm/wasm-module.h | 
| diff --git a/src/wasm/wasm-module.h b/src/wasm/wasm-module.h | 
| index ca0be798cc79dce8f22b3bc4853066beb77d48c8..5016574103903679760bc1d47248ab1b7a73ef7c 100644 | 
| --- a/src/wasm/wasm-module.h | 
| +++ b/src/wasm/wasm-module.h | 
| @@ -137,6 +137,14 @@ struct WasmExport { | 
| }; | 
| enum ModuleOrigin : uint8_t { kWasmOrigin, kAsmJsOrigin }; | 
| + | 
| +inline bool isWasm(ModuleOrigin Origin) { | 
| 
bbudge
2017/03/27 20:03:40
Sorry I wasn't more clear: these should be IsWasm,
 
kschimpf
2017/03/27 20:35:15
Done.
 | 
| + 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. |