| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/wasm/wasm-opcodes.h" | 5 #include "src/wasm/wasm-opcodes.h" |
| 6 #include "src/messages.h" | 6 #include "src/messages.h" |
| 7 #include "src/signature.h" | 7 #include "src/signature.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 #define SET_SIG_TABLE(name, opcode, sig) \ | 81 #define SET_SIG_TABLE(name, opcode, sig) \ |
| 82 kSimpleExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1; | 82 kSimpleExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1; |
| 83 FOREACH_SIMPLE_OPCODE(SET_SIG_TABLE); | 83 FOREACH_SIMPLE_OPCODE(SET_SIG_TABLE); |
| 84 FOREACH_SIMPLE_MEM_OPCODE(SET_SIG_TABLE); | 84 FOREACH_SIMPLE_MEM_OPCODE(SET_SIG_TABLE); |
| 85 FOREACH_ASMJS_COMPAT_OPCODE(SET_SIG_TABLE); | 85 FOREACH_ASMJS_COMPAT_OPCODE(SET_SIG_TABLE); |
| 86 #undef SET_SIG_TABLE | 86 #undef SET_SIG_TABLE |
| 87 byte simd_index; | 87 byte simd_index; |
| 88 #define SET_SIG_TABLE(name, opcode, sig) \ | 88 #define SET_SIG_TABLE(name, opcode, sig) \ |
| 89 simd_index = opcode & 0xff; \ | 89 simd_index = opcode & 0xff; \ |
| 90 kSimdExprSigTable[simd_index] = static_cast<int>(kSigEnum_##sig) + 1; | 90 kSimdExprSigTable[simd_index] = static_cast<int>(kSigEnum_##sig) + 1; |
| 91 FOREACH_SIMD_OPCODE(SET_SIG_TABLE) | 91 FOREACH_SIMD_0_OPERAND_OPCODE(SET_SIG_TABLE) |
| 92 #undef SET_SIG_TABLE | 92 #undef SET_SIG_TABLE |
| 93 } | 93 } |
| 94 | 94 |
| 95 class SigTable { | 95 class SigTable { |
| 96 public: | 96 public: |
| 97 SigTable() { | 97 SigTable() { |
| 98 // TODO(ahaas): Move {InitSigTable} into the class. | 98 // TODO(ahaas): Move {InitSigTable} into the class. |
| 99 InitSigTables(); | 99 InitSigTables(); |
| 100 } | 100 } |
| 101 FunctionSig* Signature(WasmOpcode opcode) const { | 101 FunctionSig* Signature(WasmOpcode opcode) const { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return MessageTemplate::kNone; | 136 return MessageTemplate::kNone; |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) { | 140 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) { |
| 141 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason)); | 141 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason)); |
| 142 } | 142 } |
| 143 } // namespace wasm | 143 } // namespace wasm |
| 144 } // namespace internal | 144 } // namespace internal |
| 145 } // namespace v8 | 145 } // namespace v8 |
| OLD | NEW |