| Index: src/wasm/wasm-opcodes.cc
|
| diff --git a/src/wasm/wasm-opcodes.cc b/src/wasm/wasm-opcodes.cc
|
| index f776da6aef3e768c6073f1e32ef4fd3dadcdfa45..cd2dde47480c9a6323006e361d3bb6af89990b6b 100644
|
| --- a/src/wasm/wasm-opcodes.cc
|
| +++ b/src/wasm/wasm-opcodes.cc
|
| @@ -86,6 +86,7 @@ static const FunctionSig* kSimdExprSigs[] = {
|
| nullptr, FOREACH_SIMD_SIGNATURE(DECLARE_SIMD_SIG_ENTRY)};
|
|
|
| static byte kSimpleExprSigTable[256];
|
| +static byte kSimpleAsmjsExprSigTable[256];
|
| static byte kSimdExprSigTable[256];
|
|
|
| // Initialize the signature table.
|
| @@ -93,9 +94,11 @@ static void InitSigTables() {
|
| #define SET_SIG_TABLE(name, opcode, sig) \
|
| kSimpleExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1;
|
| FOREACH_SIMPLE_OPCODE(SET_SIG_TABLE);
|
| - FOREACH_SIMPLE_MEM_OPCODE(SET_SIG_TABLE);
|
| - FOREACH_ASMJS_COMPAT_OPCODE(SET_SIG_TABLE);
|
| #undef SET_SIG_TABLE
|
| +#define SET_ASMJS_SIG_TABLE(name, opcode, sig) \
|
| + kSimpleAsmjsExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1;
|
| + FOREACH_ASMJS_COMPAT_OPCODE(SET_ASMJS_SIG_TABLE);
|
| +#undef SET_ASMJS_SIG_TABLE
|
| byte simd_index;
|
| #define SET_SIG_TABLE(name, opcode, sig) \
|
| simd_index = opcode & 0xff; \
|
| @@ -114,6 +117,10 @@ class SigTable {
|
| return const_cast<FunctionSig*>(
|
| kSimpleExprSigs[kSimpleExprSigTable[static_cast<byte>(opcode)]]);
|
| }
|
| + FunctionSig* AsmjsSignature(WasmOpcode opcode) const {
|
| + return const_cast<FunctionSig*>(
|
| + kSimpleExprSigs[kSimpleAsmjsExprSigTable[static_cast<byte>(opcode)]]);
|
| + }
|
| FunctionSig* SimdSignature(WasmOpcode opcode) const {
|
| return const_cast<FunctionSig*>(
|
| kSimdExprSigs[kSimdExprSigTable[static_cast<byte>(opcode & 0xff)]]);
|
| @@ -130,6 +137,10 @@ FunctionSig* WasmOpcodes::Signature(WasmOpcode opcode) {
|
| }
|
| }
|
|
|
| +FunctionSig* WasmOpcodes::AsmjsSignature(WasmOpcode opcode) {
|
| + return sig_table.Get().AsmjsSignature(opcode);
|
| +}
|
| +
|
| // TODO(titzer): pull WASM_64 up to a common header.
|
| #if !V8_TARGET_ARCH_32_BIT || V8_TARGET_ARCH_X64
|
| #define WASM_64 1
|
|
|