| 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/globals.h" |
| 9 #include "src/machine-type.h" | 9 #include "src/machine-type.h" |
| 10 #include "src/runtime/runtime.h" | 10 #include "src/runtime/runtime.h" |
| 11 #include "src/signature.h" | 11 #include "src/signature.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 namespace wasm { | 15 namespace wasm { |
| 16 | 16 |
| 17 // Binary encoding of local types. | 17 // Binary encoding of local types. |
| 18 enum LocalTypeCode { | 18 enum LocalTypeCode { |
| 19 kLocalVoid = 0x40, | 19 kLocalVoid = 0x40, |
| 20 kLocalI32 = 0x7f, | 20 kLocalI32 = 0x7f, |
| 21 kLocalI64 = 0x7e, | 21 kLocalI64 = 0x7e, |
| 22 kLocalF32 = 0x7d, | 22 kLocalF32 = 0x7d, |
| 23 kLocalF64 = 0x7c, | 23 kLocalF64 = 0x7c, |
| 24 kLocalS128 = 0x7b | 24 kLocalS128 = 0x7b |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 // Type code for multi-value block types. | 27 // Type code for multi-value block types. |
| 28 static const uint8_t kMultivalBlock = 0x41; | 28 static const uint8_t kMultivalBlock = 0x41; |
| 29 | 29 |
| 30 // We reuse the internal machine type to represent WebAssembly AST types. | 30 // We reuse the internal machine type to represent WebAssembly types. |
| 31 // A typedef improves readability without adding a whole new type system. | 31 // A typedef improves readability without adding a whole new type system. |
| 32 typedef MachineRepresentation LocalType; | 32 typedef MachineRepresentation LocalType; |
| 33 const LocalType kAstStmt = MachineRepresentation::kNone; | 33 const LocalType kAstStmt = MachineRepresentation::kNone; |
| 34 const LocalType kAstI32 = MachineRepresentation::kWord32; | 34 const LocalType kAstI32 = MachineRepresentation::kWord32; |
| 35 const LocalType kAstI64 = MachineRepresentation::kWord64; | 35 const LocalType kAstI64 = MachineRepresentation::kWord64; |
| 36 const LocalType kAstF32 = MachineRepresentation::kFloat32; | 36 const LocalType kAstF32 = MachineRepresentation::kFloat32; |
| 37 const LocalType kAstF64 = MachineRepresentation::kFloat64; | 37 const LocalType kAstF64 = MachineRepresentation::kFloat64; |
| 38 const LocalType kAstS128 = MachineRepresentation::kSimd128; | 38 const LocalType kAstS128 = MachineRepresentation::kSimd128; |
| 39 // We use kTagged here because kNone is already used by kAstStmt. | 39 // We use kTagged here because kNone is already used by kAstStmt. |
| 40 const LocalType kAstEnd = MachineRepresentation::kTagged; | 40 const LocalType kAstEnd = MachineRepresentation::kTagged; |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 default: | 678 default: |
| 679 return "<unknown>"; | 679 return "<unknown>"; |
| 680 } | 680 } |
| 681 } | 681 } |
| 682 }; | 682 }; |
| 683 } // namespace wasm | 683 } // namespace wasm |
| 684 } // namespace internal | 684 } // namespace internal |
| 685 } // namespace v8 | 685 } // namespace v8 |
| 686 | 686 |
| 687 #endif // V8_WASM_OPCODES_H_ | 687 #endif // V8_WASM_OPCODES_H_ |
| OLD | NEW |