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

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

Issue 2780563002: Separate module decoding counter into asm and wasm counters. (Closed)
Patch Set: Fix is_wasm() and is_asm_js() to use Camel case. 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..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.
« 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