| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 // Bitfields for the various annotations for memory accesses. | 62 // Bitfields for the various annotations for memory accesses. |
| 63 typedef BitField<Alignment, 7, 1> AlignmentField; | 63 typedef BitField<Alignment, 7, 1> AlignmentField; |
| 64 typedef BitField<Atomicity, 5, 2> AtomicityField; | 64 typedef BitField<Atomicity, 5, 2> AtomicityField; |
| 65 typedef BitField<bool, 4, 1> OffsetField; | 65 typedef BitField<bool, 4, 1> OffsetField; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 typedef Signature<LocalType> FunctionSig; | 68 typedef Signature<LocalType> FunctionSig; |
| 69 std::ostream& operator<<(std::ostream& os, const FunctionSig& function); | 69 std::ostream& operator<<(std::ostream& os, const FunctionSig& function); |
| 70 | 70 |
| 71 struct WasmName { |
| 72 const char* name; |
| 73 uint32_t length; |
| 74 }; |
| 75 |
| 71 // TODO(titzer): Renumber all the opcodes to fill in holes. | 76 // TODO(titzer): Renumber all the opcodes to fill in holes. |
| 72 | 77 |
| 73 // Control expressions and blocks. | 78 // Control expressions and blocks. |
| 74 #define FOREACH_CONTROL_OPCODE(V) \ | 79 #define FOREACH_CONTROL_OPCODE(V) \ |
| 75 V(Nop, 0x00, _) \ | 80 V(Nop, 0x00, _) \ |
| 76 V(Block, 0x01, _) \ | 81 V(Block, 0x01, _) \ |
| 77 V(Loop, 0x02, _) \ | 82 V(Loop, 0x02, _) \ |
| 78 V(If, 0x03, _) \ | 83 V(If, 0x03, _) \ |
| 79 V(IfElse, 0x04, _) \ | 84 V(IfElse, 0x04, _) \ |
| 80 V(Select, 0x05, _) \ | 85 V(Select, 0x05, _) \ |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 default: | 494 default: |
| 490 return "<unknown>"; | 495 return "<unknown>"; |
| 491 } | 496 } |
| 492 } | 497 } |
| 493 }; | 498 }; |
| 494 } // namespace wasm | 499 } // namespace wasm |
| 495 } // namespace internal | 500 } // namespace internal |
| 496 } // namespace v8 | 501 } // namespace v8 |
| 497 | 502 |
| 498 #endif // V8_WASM_OPCODES_H_ | 503 #endif // V8_WASM_OPCODES_H_ |
| OLD | NEW |