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

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

Issue 2205973003: [wasm] Serialization/Deserialization of compiled module (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix silly bug Created 4 years, 4 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-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index 6529810918bcac9ffecd17a57737cd70c349e026..001f9568fa3c22c6284f8abcaac05320c708812f 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -318,17 +318,9 @@ static i::MaybeHandle<i::JSObject> CreateModuleObject(
i::MaybeHandle<i::FixedArray> compiled_module =
decoded_module->CompileFunctions(i_isolate, thrower);
if (compiled_module.is_null()) return nothing;
- Local<Context> context = isolate->GetCurrentContext();
- i::Handle<i::Context> i_context = Utils::OpenHandle(*context);
- i::Handle<i::JSFunction> module_cons(i_context->wasm_module_constructor());
- i::Handle<i::JSObject> module_obj =
- i_isolate->factory()->NewJSObject(module_cons);
- module_obj->SetInternalField(0, *compiled_module.ToHandleChecked());
- i::Handle<i::Object> module_ref = Utils::OpenHandle(*source);
- i::Handle<i::Symbol> module_sym(i_context->wasm_module_sym());
- i::Object::SetProperty(module_obj, module_sym, module_ref, i::STRICT).Check();
- return module_obj;
+ return i::wasm::CreateCompiledModuleObject(i_isolate,
+ compiled_module.ToHandleChecked());
}
void WebAssemblyCompile(const v8::FunctionCallbackInfo<v8::Value>& args) {

Powered by Google App Engine
This is Rietveld 408576698