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

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

Issue 2424623002: [wasm] Use a Managed<WasmModule> to hold metadata about modules. (Closed)
Patch Set: Created 4 years, 2 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: 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 3c41d59c72a46bb09942cae607992de18b3f9036..44eff472cd81765be2c9928e8523d3e1f0c57c20 100644
--- a/test/cctest/wasm/test-run-wasm-module.cc
+++ b/test/cctest/wasm/test-run-wasm-module.cc
@@ -197,14 +197,18 @@ TEST(Run_WasmModule_Serialization) {
testing::SetupIsolateForWasmModule(isolate);
ModuleResult decoding_result = DecodeWasmModule(
- isolate, &zone, buffer.begin(), buffer.end(), false, kWasmOrigin);
- std::unique_ptr<const WasmModule> module(decoding_result.val);
- CHECK(!decoding_result.failed());
-
+ isolate, buffer.begin(), buffer.end(), false, kWasmOrigin);
+ if (decoding_result.failed()) {
+ delete decoding_result.val;
+ CHECK(false);
+ }
+ WasmModule* module = const_cast<WasmModule*>(decoding_result.val);
+ Handle<WasmModuleWrapper> module_wrapper =
+ WasmModuleWrapper::New(isolate, module);
MaybeHandle<WasmCompiledModule> compiled_module =
- module->CompileFunctions(isolate, &thrower);
+ module->CompileFunctions(isolate, module_wrapper, &thrower);
CHECK(!compiled_module.is_null());
- Handle<JSObject> module_obj = CreateCompiledModuleObject(
+ Handle<JSObject> module_obj = CreateWasmModuleObject(
isolate, compiled_module.ToHandleChecked(), ModuleOrigin::kWasmOrigin);
v8::Local<v8::Object> v8_module_obj = v8::Utils::ToLocal(module_obj);
CHECK(v8_module_obj->IsWebAssemblyCompiledModule());
@@ -374,7 +378,7 @@ TEST(TestInterruptLoop) {
ErrorThrower thrower(isolate, "Test");
const Handle<JSObject> instance =
testing::CompileInstantiateWasmModuleForTesting(
- isolate, &thrower, &zone, buffer.begin(), buffer.end(),
+ isolate, &thrower, buffer.begin(), buffer.end(),
ModuleOrigin::kWasmOrigin);
CHECK(!instance.is_null());
@@ -448,7 +452,7 @@ TEST(Run_WasmModule_GrowMemOobFixedIndex) {
ErrorThrower thrower(isolate, "Test");
Handle<JSObject> instance = testing::CompileInstantiateWasmModuleForTesting(
- isolate, &thrower, &zone, buffer.begin(), buffer.end(),
+ isolate, &thrower, buffer.begin(), buffer.end(),
ModuleOrigin::kWasmOrigin);
CHECK(!instance.is_null());
@@ -493,7 +497,7 @@ TEST(Run_WasmModule_GrowMemOobVariableIndex) {
ErrorThrower thrower(isolate, "Test");
Handle<JSObject> instance = testing::CompileInstantiateWasmModuleForTesting(
- isolate, &thrower, &zone, buffer.begin(), buffer.end(),
+ isolate, &thrower, buffer.begin(), buffer.end(),
ModuleOrigin::kWasmOrigin);
CHECK(!instance.is_null());

Powered by Google App Engine
This is Rietveld 408576698