| 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 #ifndef V8_WASM_OPCODES_H_ | 5 #ifndef V8_WASM_OPCODES_H_ |
| 6 #define V8_WASM_OPCODES_H_ | 6 #define V8_WASM_OPCODES_H_ |
| 7 | 7 |
| 8 #include "src/machine-type.h" | 8 #include "src/machine-type.h" |
| 9 #include "src/signature.h" | 9 #include "src/signature.h" |
| 10 | 10 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 enum TrapReason { | 341 enum TrapReason { |
| 342 #define DECLARE_ENUM(name) k##name, | 342 #define DECLARE_ENUM(name) k##name, |
| 343 FOREACH_WASM_TRAPREASON(DECLARE_ENUM) | 343 FOREACH_WASM_TRAPREASON(DECLARE_ENUM) |
| 344 kTrapCount | 344 kTrapCount |
| 345 #undef DECLARE_ENUM | 345 #undef DECLARE_ENUM |
| 346 }; | 346 }; |
| 347 | 347 |
| 348 // A collection of opcode-related static methods. | 348 // A collection of opcode-related static methods. |
| 349 class WasmOpcodes { | 349 class WasmOpcodes { |
| 350 public: | 350 public: |
| 351 static bool IsSupported(WasmOpcode opcode); | |
| 352 static const char* OpcodeName(WasmOpcode opcode); | 351 static const char* OpcodeName(WasmOpcode opcode); |
| 353 static const char* ShortOpcodeName(WasmOpcode opcode); | 352 static const char* ShortOpcodeName(WasmOpcode opcode); |
| 354 static FunctionSig* Signature(WasmOpcode opcode); | 353 static FunctionSig* Signature(WasmOpcode opcode); |
| 355 | 354 |
| 356 static int TrapReasonToMessageId(TrapReason reason); | 355 static int TrapReasonToMessageId(TrapReason reason); |
| 357 static const char* TrapReasonMessage(TrapReason reason); | 356 static const char* TrapReasonMessage(TrapReason reason); |
| 358 | 357 |
| 359 static byte MemSize(MachineType type) { | 358 static byte MemSize(MachineType type) { |
| 360 return 1 << ElementSizeLog2Of(type.representation()); | 359 return 1 << ElementSizeLog2Of(type.representation()); |
| 361 } | 360 } |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 default: | 513 default: |
| 515 return "<unknown>"; | 514 return "<unknown>"; |
| 516 } | 515 } |
| 517 } | 516 } |
| 518 }; | 517 }; |
| 519 } // namespace wasm | 518 } // namespace wasm |
| 520 } // namespace internal | 519 } // namespace internal |
| 521 } // namespace v8 | 520 } // namespace v8 |
| 522 | 521 |
| 523 #endif // V8_WASM_OPCODES_H_ | 522 #endif // V8_WASM_OPCODES_H_ |
| OLD | NEW |