Commit ab76be3f authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm] Remove "CloneWasmModule" runtime function

This function was only used in a single test, and it tests a scenario
which cannot happen any more with the module cache: Having two copies of
the same NativeModule in an isolate.

Hence remove the respective runtime function and the test.

R=ahaas@chromium.org

Change-Id: Id7cdffbdf1bdf95a7eb31fdeb7d75b8e326bb90e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2339100Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69246}
parent ab8368df
......@@ -1380,19 +1380,6 @@ RUNTIME_FUNCTION(Runtime_DeserializeWasmModule) {
return *module_object;
}
// Create a new Module object using the same NativeModule.
RUNTIME_FUNCTION(Runtime_CloneWasmModule) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(WasmModuleObject, module_object, 0);
Handle<WasmModuleObject> new_module_object =
isolate->wasm_engine()->ImportNativeModule(
isolate, module_object->shared_native_module(), {});
return *new_module_object;
}
RUNTIME_FUNCTION(Runtime_HeapObjectVerify) {
HandleScope shs(isolate);
DCHECK_EQ(1, args.length());
......
......@@ -456,7 +456,6 @@ namespace internal {
F(ArraySpeciesProtector, 0, 1) \
F(ClearFunctionFeedback, 1, 1) \
F(ClearMegamorphicStubCache, 0, 1) \
F(CloneWasmModule, 1, 1) \
F(CompleteInobjectSlackTracking, 1, 1) \
F(ConstructConsString, 2, 1) \
F(ConstructDouble, 2, 1) \
......
Tests that cloning a module notifies the debugger
Got URL: wasm://wasm/cae8f226
Got URL: wasm://wasm/cae8f226
Got URL: wasm://wasm/cae8f226
Done!
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
utils.load('test/inspector/wasm-inspector-test.js');
let {session, contextGroup, Protocol} =
InspectorTest.start('Tests that cloning a module notifies the debugger');
let builder = new WasmModuleBuilder();
builder.addFunction('f', kSig_v_v).addBody([]).exportAs('f');
let moduleBytes = JSON.stringify(builder.toArray());
contextGroup.addScript(`
function test(moduleBytes) {
let wireBytes = new Uint8Array(moduleBytes);
let module = new WebAssembly.Module(wireBytes.buffer);
let serialized = %SerializeWasmModule(module);
let module2 = %DeserializeWasmModule(serialized, wireBytes);
let module3 = %CloneWasmModule(module);
}
`);
let scriptsSeen = 0;
Protocol.Debugger.onScriptParsed(msg => {
let url = msg.params.url;
if (url.startsWith('wasm://')) {
InspectorTest.log(`Got URL: ${url}`);
if (++scriptsSeen == 3) {
InspectorTest.log('Done!');
InspectorTest.completeTest();
}
}
});
Protocol.Debugger.enable();
Protocol.Runtime.evaluate({expression: `test(${moduleBytes});`});
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