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

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

Issue 2771803005: Hide WasmModule.origin field behind readable accessors. (Closed)
Patch Set: Use boolean accessors instead of get_origin. 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/wasm-module.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-objects.cc
diff --git a/src/wasm/wasm-objects.cc b/src/wasm/wasm-objects.cc
index 619c0a08451cbd32ae74125cfef9c8bfb1b4b6dd..8e67d10290844e4b62352f20813341a927cc357e 100644
--- a/src/wasm/wasm-objects.cc
+++ b/src/wasm/wasm-objects.cc
@@ -221,10 +221,9 @@ bool IsBreakablePosition(Handle<WasmCompiledModule> compiled_module,
Handle<WasmModuleObject> WasmModuleObject::New(
Isolate* isolate, Handle<WasmCompiledModule> compiled_module) {
- ModuleOrigin origin = compiled_module->module()->origin;
-
+ WasmModule* module = compiled_module->module();
Handle<JSObject> module_object;
- if (origin == ModuleOrigin::kWasmOrigin) {
+ if (module->is_wasm()) {
Handle<JSFunction> module_cons(
isolate->native_context()->wasm_module_constructor());
module_object = isolate->factory()->NewJSObject(module_cons);
@@ -232,7 +231,7 @@ Handle<WasmModuleObject> WasmModuleObject::New(
Object::SetProperty(module_object, module_sym, module_object, STRICT)
.Check();
} else {
- DCHECK(origin == ModuleOrigin::kAsmJsOrigin);
+ DCHECK(module->is_asm_js());
Handle<Map> map = isolate->factory()->NewMap(
JS_OBJECT_TYPE,
JSObject::kHeaderSize + WasmModuleObject::kFieldCount * kPointerSize);
@@ -584,7 +583,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;
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698