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

[wasm] Correctly pass signature index to indirect calls

This renames the macro parameter {index} to {sig_index} to make clear
that this should be the index of a signature.
It also fixes some tests that wrongly passed a function index here (with
no observable difference in the test outcome unfortunately).
It also renames some {f[0-3]} variables to {sig[0-3]} to make it clear
that they refer to signatures.

R=mstarzinger@chromium.org

Bug: v8:10021
Change-Id: Ia4f697acd5d6a2e6f2fb45b680dac20f24ea1b08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1936471
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65178}
parent 3ac7a3e5
......@@ -411,27 +411,29 @@ inline WasmOpcode LoadStoreOpcodeOf(MachineType type, bool store) {
#define TABLE_ZERO 0
// TODO(titzer): change usages of these macros to put func last.
#define WASM_CALL_INDIRECT0(index, func) \
func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT1(index, func, a) \
a, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT2(index, func, a, b) \
a, b, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT3(index, func, a, b, c) \
a, b, c, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT4(index, func, a, b, c, d) \
a, b, c, d, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT5(index, func, a, b, c, d, e) \
a, b, c, d, e, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECTN(arity, index, func, ...) \
__VA_ARGS__, func, kExprCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_CALL_INDIRECT_TABLE0(table, index, func) \
func, kExprCallIndirect, static_cast<byte>(index), static_cast<byte>(table)
#define WASM_RETURN_CALL_INDIRECT0(index, func) \
func, kExprReturnCallIndirect, static_cast<byte>(index), TABLE_ZERO
#define WASM_RETURN_CALL_INDIRECT(index, func, ...) \
__VA_ARGS__, func, kExprReturnCallIndirect, static_cast<byte>(index), \
#define WASM_CALL_INDIRECT0(sig_index, func) \
func, kExprCallIndirect, static_cast<byte>(sig_index), TABLE_ZERO
#define WASM_CALL_INDIRECT1(sig_index, func, a) \
a, func, kExprCallIndirect, static_cast<byte>(sig_index), TABLE_ZERO
#define WASM_CALL_INDIRECT2(sig_index, func, a, b) \
a, b, func, kExprCallIndirect, static_cast<byte>(sig_index), TABLE_ZERO
#define WASM_CALL_INDIRECT3(sig_index, func, a, b, c) \
a, b, c, func, kExprCallIndirect, static_cast<byte>(sig_index), TABLE_ZERO
#define WASM_CALL_INDIRECT4(sig_index, func, a, b, c, d) \
a, b, c, d, func, kExprCallIndirect, static_cast<byte>(sig_index), TABLE_ZERO
#define WASM_CALL_INDIRECT5(sig_index, func, a, b, c, d, e) \
a, b, c, d, e, func, kExprCallIndirect, static_cast<byte>(sig_index), \
TABLE_ZERO
#define WASM_CALL_INDIRECTN(arity, sig_index, func, ...) \
__VA_ARGS__, func, kExprCallIndirect, static_cast<byte>(sig_index), TABLE_ZERO
#define WASM_CALL_INDIRECT_TABLE0(table, sig_index, func) \
func, kExprCallIndirect, static_cast<byte>(sig_index), \
static_cast<byte>(table)
#define WASM_RETURN_CALL_INDIRECT0(sig_index, func) \
func, kExprReturnCallIndirect, static_cast<byte>(sig_index), TABLE_ZERO
#define WASM_RETURN_CALL_INDIRECT(sig_index, func, ...) \
__VA_ARGS__, func, kExprReturnCallIndirect, static_cast<byte>(sig_index), \
TABLE_ZERO
#define WASM_NOT(x) x, kExprI32Eqz
......
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