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

Unified Diff: test/common/wasm/wasm-module-runner.cc

Issue 2510673002: [wasm] Use more precise types for some WASM objects. (Closed)
Patch Set: Address review comment. Created 4 years, 1 month 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 | « test/common/wasm/wasm-module-runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/common/wasm/wasm-module-runner.cc
diff --git a/test/common/wasm/wasm-module-runner.cc b/test/common/wasm/wasm-module-runner.cc
index 0b885175fcfcd0a724e6e06030a58ce1067f6e21..f47edb104936cb6e822c3a450535439272cca064 100644
--- a/test/common/wasm/wasm-module-runner.cc
+++ b/test/common/wasm/wasm-module-runner.cc
@@ -45,16 +45,15 @@ const WasmModule* DecodeWasmModuleForTesting(
return decoding_result.val;
}
-const Handle<JSObject> InstantiateModuleForTesting(Isolate* isolate,
- ErrorThrower* thrower,
- const WasmModule* module) {
+const Handle<WasmInstanceObject> InstantiateModuleForTesting(
+ Isolate* isolate, ErrorThrower* thrower, const WasmModule* module) {
CHECK(module != nullptr);
if (module->import_table.size() > 0) {
thrower->CompileError("Not supported: module has imports.");
}
- if (thrower->error()) return Handle<JSObject>::null();
+ if (thrower->error()) return Handle<WasmInstanceObject>::null();
// Although we decoded the module for some pre-validation, run the bytes
// again through the normal pipeline.
@@ -64,19 +63,19 @@ const Handle<JSObject> InstantiateModuleForTesting(Isolate* isolate,
ModuleOrigin::kWasmOrigin, Handle<Script>::null(), nullptr, nullptr);
if (module_object.is_null()) {
thrower->CompileError("Module pre-validation failed.");
- return Handle<JSObject>::null();
+ return Handle<WasmInstanceObject>::null();
}
- MaybeHandle<JSObject> maybe_instance = WasmModule::Instantiate(
+ MaybeHandle<WasmInstanceObject> maybe_instance = WasmModule::Instantiate(
isolate, thrower, module_object.ToHandleChecked(),
Handle<JSReceiver>::null(), Handle<JSArrayBuffer>::null());
- Handle<JSObject> instance;
+ Handle<WasmInstanceObject> instance;
if (!maybe_instance.ToHandle(&instance)) {
- return Handle<JSObject>::null();
+ return Handle<WasmInstanceObject>::null();
}
return instance;
}
-const Handle<JSObject> CompileInstantiateWasmModuleForTesting(
+const Handle<WasmInstanceObject> CompileInstantiateWasmModuleForTesting(
Isolate* isolate, ErrorThrower* thrower, const byte* module_start,
const byte* module_end, ModuleOrigin origin) {
std::unique_ptr<const WasmModule> module(DecodeWasmModuleForTesting(
@@ -84,7 +83,7 @@ const Handle<JSObject> CompileInstantiateWasmModuleForTesting(
if (module == nullptr) {
thrower->CompileError("Wasm module decoding failed");
- return Handle<JSObject>::null();
+ return Handle<WasmInstanceObject>::null();
}
return InstantiateModuleForTesting(isolate, thrower, module.get());
}
« no previous file with comments | « test/common/wasm/wasm-module-runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698