| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 #define SET_SIG_TABLE(name, opcode, sig) \ | 93 #define SET_SIG_TABLE(name, opcode, sig) \ |
| 94 kSimpleExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1; | 94 kSimpleExprSigTable[opcode] = static_cast<int>(kSigEnum_##sig) + 1; |
| 95 FOREACH_SIMPLE_OPCODE(SET_SIG_TABLE); | 95 FOREACH_SIMPLE_OPCODE(SET_SIG_TABLE); |
| 96 FOREACH_SIMPLE_MEM_OPCODE(SET_SIG_TABLE); | 96 FOREACH_SIMPLE_MEM_OPCODE(SET_SIG_TABLE); |
| 97 FOREACH_ASMJS_COMPAT_OPCODE(SET_SIG_TABLE); | 97 FOREACH_ASMJS_COMPAT_OPCODE(SET_SIG_TABLE); |
| 98 #undef SET_SIG_TABLE | 98 #undef SET_SIG_TABLE |
| 99 byte simd_index; | 99 byte simd_index; |
| 100 #define SET_SIG_TABLE(name, opcode, sig) \ | 100 #define SET_SIG_TABLE(name, opcode, sig) \ |
| 101 simd_index = opcode & 0xff; \ | 101 simd_index = opcode & 0xff; \ |
| 102 kSimdExprSigTable[simd_index] = static_cast<int>(kSigEnum_##sig) + 1; | 102 kSimdExprSigTable[simd_index] = static_cast<int>(kSigEnum_##sig) + 1; |
| 103 FOREACH_SIMD_OPCODE(SET_SIG_TABLE) | 103 FOREACH_SIMD_0_OPERAND_OPCODE(SET_SIG_TABLE) |
| 104 #undef SET_SIG_TABLE | 104 #undef SET_SIG_TABLE |
| 105 } | 105 } |
| 106 | 106 |
| 107 class SigTable { | 107 class SigTable { |
| 108 public: | 108 public: |
| 109 SigTable() { | 109 SigTable() { |
| 110 // TODO(ahaas): Move {InitSigTable} into the class. | 110 // TODO(ahaas): Move {InitSigTable} into the class. |
| 111 InitSigTables(); | 111 InitSigTables(); |
| 112 } | 112 } |
| 113 FunctionSig* Signature(WasmOpcode opcode) const { | 113 FunctionSig* Signature(WasmOpcode opcode) const { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 return MessageTemplate::kNone; | 148 return MessageTemplate::kNone; |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 | 151 |
| 152 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) { | 152 const char* WasmOpcodes::TrapReasonMessage(TrapReason reason) { |
| 153 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason)); | 153 return MessageTemplate::TemplateString(TrapReasonToMessageId(reason)); |
| 154 } | 154 } |
| 155 } // namespace wasm | 155 } // namespace wasm |
| 156 } // namespace internal | 156 } // namespace internal |
| 157 } // namespace v8 | 157 } // namespace v8 |
| OLD | NEW |