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

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

Issue 2806073002: [wasm] instantiate expressed in terms of compile (Closed)
Patch Set: feedback Created 3 years, 8 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-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 0e8054a9d895657d8db9aa561d6e9c6cf9a9a96f..cc7f9405dc8627cd6c97a367213e50121a419400 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -2603,44 +2603,6 @@ void wasm::AsyncInstantiate(Isolate* isolate, Handle<JSPromise> promise,
instance_object.ToHandleChecked());
}
-void wasm::AsyncCompileAndInstantiate(Isolate* isolate,
- Handle<JSPromise> promise,
- const ModuleWireBytes& bytes,
- MaybeHandle<JSReceiver> imports) {
- ErrorThrower thrower(isolate, nullptr);
-
- // Compile the module.
- MaybeHandle<WasmModuleObject> module_object =
- SyncCompile(isolate, &thrower, bytes);
- if (thrower.error()) {
- RejectPromise(isolate, handle(isolate->context()), &thrower, promise);
- return;
- }
- Handle<WasmModuleObject> module = module_object.ToHandleChecked();
-
- // Instantiate the module.
- MaybeHandle<WasmInstanceObject> instance_object = SyncInstantiate(
- isolate, &thrower, module, imports, Handle<JSArrayBuffer>::null());
- if (thrower.error()) {
- RejectPromise(isolate, handle(isolate->context()), &thrower, promise);
- return;
- }
-
- Handle<JSFunction> object_function =
- Handle<JSFunction>(isolate->native_context()->object_function(), isolate);
- Handle<JSObject> ret =
- isolate->factory()->NewJSObject(object_function, TENURED);
- Handle<String> module_property_name =
- isolate->factory()->InternalizeUtf8String("module");
- Handle<String> instance_property_name =
- isolate->factory()->InternalizeUtf8String("instance");
- JSObject::AddProperty(ret, module_property_name, module, NONE);
- JSObject::AddProperty(ret, instance_property_name,
- instance_object.ToHandleChecked(), NONE);
-
- ResolvePromise(isolate, handle(isolate->context()), promise, ret);
-}
-
// Encapsulates all the state and steps of an asynchronous compilation.
// An asynchronous compile job consists of a number of tasks that are executed
// as foreground and background tasks. Any phase that touches the V8 heap or

Powered by Google App Engine
This is Rietveld 408576698