Index: src/wasm/wasm-opcodes.cc |
diff --git a/src/wasm/wasm-opcodes.cc b/src/wasm/wasm-opcodes.cc |
index cd2dde47480c9a6323006e361d3bb6af89990b6b..8f81b81a50bd9c4eb54c8952a354c227532a644d 100644 |
--- a/src/wasm/wasm-opcodes.cc |
+++ b/src/wasm/wasm-opcodes.cc |
@@ -88,6 +88,7 @@ static const FunctionSig* kSimdExprSigs[] = { |
static byte kSimpleExprSigTable[256]; |
static byte kSimpleAsmjsExprSigTable[256]; |
static byte kSimdExprSigTable[256]; |
+static byte kAtomicExprSigTable[256]; |
// Initialize the signature table. |
static void InitSigTables() { |
@@ -105,6 +106,12 @@ static void InitSigTables() { |
kSimdExprSigTable[simd_index] = static_cast<int>(kSigEnum_##sig) + 1; |
FOREACH_SIMD_0_OPERAND_OPCODE(SET_SIG_TABLE) |
#undef SET_SIG_TABLE |
+ byte atomic_index; |
+#define SET_ATOMIC_SIG_TABLE(name, opcode, sig) \ |
+ atomic_index = opcode & 0xff; \ |
+ kAtomicExprSigTable[atomic_index] = static_cast<int>(kSigEnum_##sig) + 1; |
+ FOREACH_ATOMIC_OPCODE(SET_ATOMIC_SIG_TABLE) |
+#undef SET_ATOMIC_SIG_TABLE |
} |
class SigTable { |
@@ -125,6 +132,10 @@ class SigTable { |
return const_cast<FunctionSig*>( |
kSimdExprSigs[kSimdExprSigTable[static_cast<byte>(opcode & 0xff)]]); |
} |
+ FunctionSig* AtomicSignature(WasmOpcode opcode) const { |
+ return const_cast<FunctionSig*>( |
+ kSimpleExprSigs[kAtomicExprSigTable[static_cast<byte>(opcode & 0xff)]]); |
+ } |
}; |
static base::LazyInstance<SigTable>::type sig_table = LAZY_INSTANCE_INITIALIZER; |
@@ -141,6 +152,10 @@ FunctionSig* WasmOpcodes::AsmjsSignature(WasmOpcode opcode) { |
return sig_table.Get().AsmjsSignature(opcode); |
} |
+FunctionSig* WasmOpcodes::AtomicSignature(WasmOpcode opcode) { |
+ return sig_table.Get().AtomicSignature(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 |