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

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: disable dchecks 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
« no previous file with comments | « src/snapshot/deserializer.cc ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index 88b9e1682fea79fe1296171ce6e7a2085890017f..0bd600579956067ccf48534cf0ec4cd729340490 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) {
« no previous file with comments | « src/snapshot/deserializer.cc ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698