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

Unified Diff: src/wasm/wasm-objects.cc

Issue 2771803005: Hide WasmModule.origin field behind readable accessors. (Closed)
Patch Set: Fix merge conflict with master. 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
Index: src/wasm/wasm-objects.cc
diff --git a/src/wasm/wasm-objects.cc b/src/wasm/wasm-objects.cc
index 619c0a08451cbd32ae74125cfef9c8bfb1b4b6dd..6e0b6a7abdb5f248a6da819c390e4b2cfc51038a 100644
--- a/src/wasm/wasm-objects.cc
+++ b/src/wasm/wasm-objects.cc
@@ -221,7 +221,7 @@ bool IsBreakablePosition(Handle<WasmCompiledModule> compiled_module,
Handle<WasmModuleObject> WasmModuleObject::New(
Isolate* isolate, Handle<WasmCompiledModule> compiled_module) {
- ModuleOrigin origin = compiled_module->module()->origin;
+ ModuleOrigin origin = compiled_module->module()->get_origin();
Handle<JSObject> module_object;
if (origin == ModuleOrigin::kWasmOrigin) {
Mircea Trofin 2017/03/24 22:25:15 why not use the is_wasm() / is_asm_js() APIs here,
Karl 2017/03/24 22:41:40 It is, look up at line 224.
Mircea Trofin 2017/03/24 22:43:42 that's get_origin()
Karl 2017/03/24 22:51:17 Ok. I see. I didn't read the usage well enough. Ch
@@ -584,7 +584,7 @@ Handle<WasmSharedModuleData> WasmSharedModuleData::New(
}
bool WasmSharedModuleData::is_asm_js() {
- bool asm_js = module()->origin == wasm::ModuleOrigin::kAsmJsOrigin;
+ bool asm_js = module()->is_asm_js();
DCHECK_EQ(asm_js, script()->IsUserJavaScript());
DCHECK_EQ(asm_js, has_asm_js_offset_table());
return asm_js;

Powered by Google App Engine
This is Rietveld 408576698