Commit 2869dd55 authored by Mircea Trofin's avatar Mircea Trofin Committed by Commit Bot

[wasm] Remove override-ability from async compile and instantiate.

We're now using explicit APIs.

Bug: 
Change-Id: I4a4248e44543f6e7dfcbdc66456e610fb98ff5ee
Reviewed-on: https://chromium-review.googlesource.com/513406
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45500}
parent d2fd0cf1
......@@ -170,7 +170,6 @@ void WebAssemblyCompile(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
MicrotasksScope runs_microtasks(isolate, MicrotasksScope::kRunMicrotasks);
if (i_isolate->wasm_compile_callback()(args)) return;
HandleScope scope(isolate);
ErrorThrower thrower(i_isolate, "WebAssembly.compile()");
......@@ -424,7 +423,6 @@ void WebAssemblyInstantiate(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
MicrotasksScope runs_microtasks(isolate, MicrotasksScope::kRunMicrotasks);
if (i_isolate->wasm_instantiate_callback()(args)) return;
ErrorThrower thrower(i_isolate, "WebAssembly.instantiate()");
......
......@@ -65,45 +65,10 @@ async function FailSyncInstantiate() {
}
}
async function FailAsyncCompile() {
print("FailAsyncCompile...");
%SetWasmCompileControls(buffer.byteLength - 1, false);
assertThrows(() => new WebAssembly.Module(buffer), RangeError);
print(" wait");
try {
let m = await WebAssembly.compile(buffer);
print(" cont");
assertUnreachable();
} catch (e) {
print(" catch: " + e);
assertTrue(e instanceof RangeError);
}
}
async function FailAsyncInstantiate() {
print("FailAsyncInstantiate...");
%SetWasmCompileControls(buffer.byteLength - 1, false);
assertThrows(() => new WebAssembly.Instance(buffer), RangeError);
print(" wait");
try {
let m = await WebAssembly.instantiate(buffer);
print(" cont");
assertUnreachable();
} catch (e) {
print(" catch: " + e);
assertTrue(e instanceof RangeError);
}
}
async function TestAll() {
await SuccessfulTest();
await FailSyncCompile();
await FailSyncInstantiate();
await FailAsyncCompile();
await FailAsyncInstantiate();
}
assertPromiseResult(TestAll());
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment