Commit 2e592270 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] [cleanup] Remove InstantiateModuleForTesting

This method is dead now (after
https://chromium-review.googlesource.com/529844 and
https://chromium-review.googlesource.com/529210).

R=ahaas@chromium.org
BUG=v8:6474

Change-Id: Icd355283312bfae712c0db61bb5049925762060b
Reviewed-on: https://chromium-review.googlesource.com/530312Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45861}
parent 25dd609a
......@@ -42,35 +42,6 @@ std::unique_ptr<WasmModule> DecodeWasmModuleForTesting(
return std::move(decoding_result.val);
}
const Handle<WasmInstanceObject> InstantiateModuleForTesting(
Isolate* isolate, ErrorThrower* thrower, const WasmModule* module,
const ModuleWireBytes& wire_bytes) {
DCHECK_NOT_NULL(module);
if (module->import_table.size() > 0) {
thrower->CompileError("Not supported: module has imports.");
}
if (thrower->error()) return Handle<WasmInstanceObject>::null();
// Although we decoded the module for some pre-validation, run the bytes
// again through the normal pipeline.
// TODO(wasm): Use {module} instead of decoding the module bytes again.
MaybeHandle<WasmModuleObject> module_object =
SyncCompile(isolate, thrower, wire_bytes);
if (module_object.is_null()) {
thrower->CompileError("Module pre-validation failed.");
return Handle<WasmInstanceObject>::null();
}
MaybeHandle<WasmInstanceObject> maybe_instance =
SyncInstantiate(isolate, thrower, module_object.ToHandleChecked(),
Handle<JSReceiver>::null(), MaybeHandle<JSArrayBuffer>());
Handle<WasmInstanceObject> instance;
if (!maybe_instance.ToHandle(&instance)) {
return Handle<WasmInstanceObject>::null();
}
return instance;
}
int32_t RunWasmModuleForTesting(Isolate* isolate, Handle<JSObject> instance,
int argc, Handle<Object> argv[],
ModuleOrigin origin) {
......
......@@ -27,11 +27,6 @@ std::unique_ptr<WasmModule> DecodeWasmModuleForTesting(
Isolate* isolate, ErrorThrower* thrower, const byte* module_start,
const byte* module_end, ModuleOrigin origin, bool verify_functions = false);
// Instantiates a module without any imports and exports.
const Handle<WasmInstanceObject> InstantiateModuleForTesting(
Isolate* isolate, ErrorThrower* thrower, const WasmModule* module,
const ModuleWireBytes& wire_bytes);
int32_t CallWasmFunctionForTesting(Isolate* isolate, Handle<JSObject> instance,
ErrorThrower* thrower, const char* name,
int argc, Handle<Object> argv[],
......@@ -59,6 +54,7 @@ int32_t InterpretWasmModule(Isolate* isolate,
int32_t RunWasmModuleForTesting(Isolate* isolate, Handle<JSObject> instance,
int argc, Handle<Object> argv[],
ModuleOrigin origin);
// Install function map, module symbol for testing
void SetupIsolateForWasmModule(Isolate* isolate);
......
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