Index: src/wasm/wasm-module.h |
diff --git a/src/wasm/wasm-module.h b/src/wasm/wasm-module.h |
index ca0be798cc79dce8f22b3bc4853066beb77d48c8..d7d1abd25e8ef707c45f3a553706647780d80dd9 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) { |
+ 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. |