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

Unified Diff: src/asmjs/asm-js.cc

Issue 2642683002: [wasm][asm.js] Store foreign init function for asm.js as internal field. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | src/wasm/wasm-module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-js.cc
diff --git a/src/asmjs/asm-js.cc b/src/asmjs/asm-js.cc
index b4026b0b191e934df8f0e7e0e9a1c396e54a771c..c296592ca92331e634c7e88d2fe3af7bdc875bcf 100644
--- a/src/asmjs/asm-js.cc
+++ b/src/asmjs/asm-js.cc
@@ -278,15 +278,11 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(i::Isolate* isolate,
return MaybeHandle<Object>();
}
- i::Handle<i::Name> init_name(isolate->factory()->InternalizeUtf8String(
- wasm::AsmWasmBuilder::foreign_init_name));
+ i::Handle<i::JSObject> module_object = maybe_module_object.ToHandleChecked();
+ i::Handle<i::Object> init(
+ module->GetInternalField(WasmModuleObject::kAsmForeignInit), isolate);
+ DCHECK(!init.is_null());
- i::Handle<i::Object> module_object = maybe_module_object.ToHandleChecked();
- i::MaybeHandle<i::Object> maybe_init =
- i::Object::GetProperty(module_object, init_name);
- DCHECK(!maybe_init.is_null());
-
- i::Handle<i::Object> init = maybe_init.ToHandleChecked();
i::Handle<i::Object> undefined(isolate->heap()->undefined_value(), isolate);
i::Handle<i::Object>* foreign_args_array =
new i::Handle<i::Object>[foreign_globals->length()];
« no previous file with comments | « no previous file | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698