5ee2bee3ba
Safepoint maps record all spill slots that contain a tagged value. The introduction of multi-value return changed the stack frame layout though and the calculation of spill slots has not been adjusted accordingly. This CL adjusts the creation of safepoints now to work for multi-value returns as well. R=neis@chromium.org Bug: v8:11206 Change-Id: Id623dbc28b976dcf625ac78738e03e642fafbb36 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569762 Commit-Queue: Andreas Haas <ahaas@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#71591}
56 lines
1.6 KiB
JavaScript
56 lines
1.6 KiB
JavaScript
// Copyright 2020 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: --experimental-wasm-mv --expose-gc --stress-compaction
|
|
// Flags: --stress-scavenge=16
|
|
|
|
load('test/mjsunit/wasm/wasm-module-builder.js');
|
|
|
|
(function TestReturnOddNumberOfReturns() {
|
|
let builder = new WasmModuleBuilder();
|
|
let void_sig = builder.addType(kSig_v_v);
|
|
let mv_sig = builder.addType(
|
|
makeSig([], [kWasmI32, kWasmI32, kWasmI32, kWasmI32, kWasmI32]));
|
|
|
|
let gc_index = builder.addImport('q', 'gc', void_sig);
|
|
builder.addFunction('main', mv_sig)
|
|
.addBodyWithEnd([
|
|
kExprCallFunction, gc_index,
|
|
kExprI32Const, 1,
|
|
kExprI32Const, 2,
|
|
kExprI32Const, 3,
|
|
kExprI32Const, 4,
|
|
kExprI32Const, 5,
|
|
kExprEnd
|
|
])
|
|
.exportFunc();
|
|
|
|
let instance = builder.instantiate({q: {gc: gc}});
|
|
|
|
instance.exports.main();
|
|
})();
|
|
|
|
(function TestReturnEvenNumberOfReturns() {
|
|
let builder = new WasmModuleBuilder();
|
|
let void_sig = builder.addType(kSig_v_v);
|
|
let mv_sig =
|
|
builder.addType(makeSig([], [kWasmI32, kWasmI32, kWasmI32, kWasmI32]));
|
|
|
|
let gc_index = builder.addImport('q', 'gc', void_sig);
|
|
builder.addFunction('main', mv_sig)
|
|
.addBodyWithEnd([
|
|
kExprCallFunction, gc_index,
|
|
kExprI32Const, 1,
|
|
kExprI32Const, 2,
|
|
kExprI32Const, 3,
|
|
kExprI32Const, 4,
|
|
kExprEnd
|
|
])
|
|
.exportFunc();
|
|
|
|
let instance = builder.instantiate({q: {gc: gc}});
|
|
|
|
instance.exports.main();
|
|
})();
|