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/globals.h" |
8 #include "src/machine-type.h" | 9 #include "src/machine-type.h" |
9 #include "src/signature.h" | 10 #include "src/signature.h" |
10 | 11 |
11 namespace v8 { | 12 namespace v8 { |
12 namespace internal { | 13 namespace internal { |
13 namespace wasm { | 14 namespace wasm { |
14 | 15 |
15 // Binary encoding of local types. | 16 // Binary encoding of local types. |
16 enum LocalTypeCode { | 17 enum LocalTypeCode { |
17 kLocalVoid = 0, | 18 kLocalVoid = 0, |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 V(TrapInvalidIndex) | 480 V(TrapInvalidIndex) |
480 | 481 |
481 enum TrapReason { | 482 enum TrapReason { |
482 #define DECLARE_ENUM(name) k##name, | 483 #define DECLARE_ENUM(name) k##name, |
483 FOREACH_WASM_TRAPREASON(DECLARE_ENUM) | 484 FOREACH_WASM_TRAPREASON(DECLARE_ENUM) |
484 kTrapCount | 485 kTrapCount |
485 #undef DECLARE_ENUM | 486 #undef DECLARE_ENUM |
486 }; | 487 }; |
487 | 488 |
488 // A collection of opcode-related static methods. | 489 // A collection of opcode-related static methods. |
489 class WasmOpcodes { | 490 class V8_EXPORT_PRIVATE WasmOpcodes { |
490 public: | 491 public: |
491 static const char* OpcodeName(WasmOpcode opcode); | 492 static const char* OpcodeName(WasmOpcode opcode); |
492 static const char* ShortOpcodeName(WasmOpcode opcode); | 493 static const char* ShortOpcodeName(WasmOpcode opcode); |
493 static FunctionSig* Signature(WasmOpcode opcode); | 494 static FunctionSig* Signature(WasmOpcode opcode); |
494 static FunctionSig* AsmjsSignature(WasmOpcode opcode); | 495 static FunctionSig* AsmjsSignature(WasmOpcode opcode); |
495 static bool IsPrefixOpcode(WasmOpcode opcode); | 496 static bool IsPrefixOpcode(WasmOpcode opcode); |
496 | 497 |
497 static int TrapReasonToMessageId(TrapReason reason); | 498 static int TrapReasonToMessageId(TrapReason reason); |
498 static const char* TrapReasonMessage(TrapReason reason); | 499 static const char* TrapReasonMessage(TrapReason reason); |
499 | 500 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 default: | 641 default: |
641 return "<unknown>"; | 642 return "<unknown>"; |
642 } | 643 } |
643 } | 644 } |
644 }; | 645 }; |
645 } // namespace wasm | 646 } // namespace wasm |
646 } // namespace internal | 647 } // namespace internal |
647 } // namespace v8 | 648 } // namespace v8 |
648 | 649 |
649 #endif // V8_WASM_OPCODES_H_ | 650 #endif // V8_WASM_OPCODES_H_ |
OLD | NEW |