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

Unified Diff: src/wasm/wasm-module.h

Issue 2780563002: Separate module decoding counter into asm and wasm counters. (Closed)
Patch Set: Rename isWasm and isAsmJs to IsWasm and IsAsmJs. 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/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698