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

Unified Diff: test/cctest/wasm/test-run-wasm-module.cc

Issue 2695813005: [wasm] Split the compilation and instantiation API into sync and async methods. (Closed)
Patch Set: [wasm] Split the compilation and instantiation API into sync and async methods. Created 3 years, 10 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/wasm/wasm-module.cc ('k') | test/common/wasm/wasm-module-runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm-module.cc
diff --git a/test/cctest/wasm/test-run-wasm-module.cc b/test/cctest/wasm/test-run-wasm-module.cc
index 5f005b3566a7b1023912c1abb6fb4a0f55bb4cb5..03ffb7ac65e5917db85ba5957147e552c4cc4927 100644
--- a/test/cctest/wasm/test-run-wasm-module.cc
+++ b/test/cctest/wasm/test-run-wasm-module.cc
@@ -271,9 +271,9 @@ class WasmSerializationTest {
0);
}
Handle<JSObject> instance =
- WasmModule::Instantiate(current_isolate(), &thrower, module_object,
- Handle<JSReceiver>::null(),
- Handle<JSArrayBuffer>::null())
+ SyncInstantiate(current_isolate(), &thrower, module_object,
+ Handle<JSReceiver>::null(),
+ MaybeHandle<JSArrayBuffer>())
.ToHandleChecked();
Handle<Object> params[1] = {
Handle<Object>(Smi::FromInt(41), current_isolate())};
@@ -318,19 +318,13 @@ class WasmSerializationTest {
HandleScope scope(serialization_isolate);
testing::SetupIsolateForWasmModule(serialization_isolate);
- ModuleResult decoding_result =
- DecodeWasmModule(serialization_isolate, buffer.begin(), buffer.end(),
- false, kWasmOrigin);
- CHECK(!decoding_result.failed());
+ MaybeHandle<WasmModuleObject> module_object =
+ SyncCompile(serialization_isolate, &thrower,
+ ModuleWireBytes(buffer.begin(), buffer.end()));
- Handle<WasmModuleWrapper> module_wrapper = WasmModuleWrapper::New(
- serialization_isolate, const_cast<WasmModule*>(decoding_result.val));
-
- MaybeHandle<WasmCompiledModule> compiled_module =
- decoding_result.val->CompileFunctions(
- serialization_isolate, module_wrapper, &thrower,
- ModuleWireBytes(buffer.begin(), buffer.end()),
- Handle<Script>::null(), Vector<const byte>::empty());
+ MaybeHandle<WasmCompiledModule> compiled_module(
+ module_object.ToHandleChecked()->compiled_module(),
+ serialization_isolate);
CHECK(!compiled_module.is_null());
Handle<JSObject> module_obj = WasmModuleObject::New(
serialization_isolate, compiled_module.ToHandleChecked());
@@ -437,10 +431,8 @@ TEST(BlockWasmCodeGen) {
CcTest::isolate()->SetAllowCodeGenerationFromStringsCallback(False);
ErrorThrower thrower(isolate, "block codegen");
- MaybeHandle<WasmModuleObject> ret = wasm::CreateModuleObjectFromBytes(
- isolate, buffer.begin(), buffer.end(), &thrower,
- wasm::ModuleOrigin::kWasmOrigin, Handle<v8::internal::Script>::null(),
- Vector<const byte>::empty());
+ MaybeHandle<WasmModuleObject> ret = wasm::SyncCompile(
+ isolate, &thrower, ModuleWireBytes(buffer.begin(), buffer.end()));
CcTest::isolate()->SetAllowCodeGenerationFromStringsCallback(nullptr);
CHECK(ret.is_null());
CHECK(thrower.error());
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/common/wasm/wasm-module-runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698