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_INTERPRETER_BYTECODES_H_ | 5 #ifndef V8_INTERPRETER_BYTECODES_H_ |
6 #define V8_INTERPRETER_BYTECODES_H_ | 6 #define V8_INTERPRETER_BYTECODES_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 // Clients of this interface shouldn't depend on lots of interpreter internals. | 10 // Clients of this interface shouldn't depend on lots of interpreter internals. |
11 // Do not include anything from src/interpreter here! | 11 // Do not include anything from src/interpreter here! |
12 #include "src/utils.h" | 12 #include "src/utils.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 namespace interpreter { | 16 namespace interpreter { |
17 | 17 |
18 // The list of operand types used by bytecodes. | 18 // The list of operand types used by bytecodes. |
19 #define OPERAND_TYPE_LIST(V) \ | 19 #define OPERAND_TYPE_LIST(V) \ |
20 \ | 20 \ |
21 /* None operand. */ \ | 21 /* None operand. */ \ |
22 V(None, OperandSize::kNone) \ | 22 V(None, OperandSize::kNone) \ |
23 \ | 23 \ |
24 /* Byte operands. */ \ | 24 /* Byte operands. */ \ |
25 V(Count8, OperandSize::kByte) \ | 25 V(Count8, OperandSize::kByte) \ |
26 V(Imm8, OperandSize::kByte) \ | 26 V(Imm8, OperandSize::kByte) \ |
27 V(Idx8, OperandSize::kByte) \ | 27 V(Idx8, OperandSize::kByte) \ |
28 V(Reg8, OperandSize::kByte) \ | 28 V(Reg8, OperandSize::kByte) \ |
29 \ | 29 V(MaybeReg8, OperandSize::kByte) \ |
30 /* Short operands. */ \ | 30 \ |
| 31 /* Short operands. */ \ |
31 V(Idx16, OperandSize::kShort) | 32 V(Idx16, OperandSize::kShort) |
32 | 33 |
33 // The list of bytecodes which are interpreted by the interpreter. | 34 // The list of bytecodes which are interpreted by the interpreter. |
34 #define BYTECODE_LIST(V) \ | 35 #define BYTECODE_LIST(V) \ |
35 \ | 36 \ |
36 /* Loading the accumulator */ \ | 37 /* Loading the accumulator */ \ |
37 V(LdaZero, OperandType::kNone) \ | 38 V(LdaZero, OperandType::kNone) \ |
38 V(LdaSmi8, OperandType::kImm8) \ | 39 V(LdaSmi8, OperandType::kImm8) \ |
39 V(LdaUndefined, OperandType::kNone) \ | 40 V(LdaUndefined, OperandType::kNone) \ |
40 V(LdaNull, OperandType::kNone) \ | 41 V(LdaNull, OperandType::kNone) \ |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 /* Unary Operators */ \ | 115 /* Unary Operators */ \ |
115 V(Inc, OperandType::kNone) \ | 116 V(Inc, OperandType::kNone) \ |
116 V(Dec, OperandType::kNone) \ | 117 V(Dec, OperandType::kNone) \ |
117 V(LogicalNot, OperandType::kNone) \ | 118 V(LogicalNot, OperandType::kNone) \ |
118 V(TypeOf, OperandType::kNone) \ | 119 V(TypeOf, OperandType::kNone) \ |
119 V(DeletePropertyStrict, OperandType::kReg8) \ | 120 V(DeletePropertyStrict, OperandType::kReg8) \ |
120 V(DeletePropertySloppy, OperandType::kReg8) \ | 121 V(DeletePropertySloppy, OperandType::kReg8) \ |
121 \ | 122 \ |
122 /* Call operations */ \ | 123 /* Call operations */ \ |
123 V(Call, OperandType::kReg8, OperandType::kReg8, OperandType::kCount8) \ | 124 V(Call, OperandType::kReg8, OperandType::kReg8, OperandType::kCount8) \ |
124 V(CallRuntime, OperandType::kIdx16, OperandType::kReg8, \ | 125 V(CallRuntime, OperandType::kIdx16, OperandType::kMaybeReg8, \ |
| 126 OperandType::kCount8) \ |
| 127 V(CallJSRuntime, OperandType::kIdx16, OperandType::kReg8, \ |
125 OperandType::kCount8) \ | 128 OperandType::kCount8) \ |
126 \ | 129 \ |
127 /* New operator */ \ | 130 /* New operator */ \ |
128 V(New, OperandType::kReg8, OperandType::kReg8, OperandType::kCount8) \ | 131 V(New, OperandType::kReg8, OperandType::kMaybeReg8, OperandType::kCount8) \ |
129 \ | 132 \ |
130 /* Test Operators */ \ | 133 /* Test Operators */ \ |
131 V(TestEqual, OperandType::kReg8) \ | 134 V(TestEqual, OperandType::kReg8) \ |
132 V(TestNotEqual, OperandType::kReg8) \ | 135 V(TestNotEqual, OperandType::kReg8) \ |
133 V(TestEqualStrict, OperandType::kReg8) \ | 136 V(TestEqualStrict, OperandType::kReg8) \ |
134 V(TestNotEqualStrict, OperandType::kReg8) \ | 137 V(TestNotEqualStrict, OperandType::kReg8) \ |
135 V(TestLessThan, OperandType::kReg8) \ | 138 V(TestLessThan, OperandType::kReg8) \ |
136 V(TestGreaterThan, OperandType::kReg8) \ | 139 V(TestGreaterThan, OperandType::kReg8) \ |
137 V(TestLessThanOrEqual, OperandType::kReg8) \ | 140 V(TestLessThanOrEqual, OperandType::kReg8) \ |
138 V(TestGreaterThanOrEqual, OperandType::kReg8) \ | 141 V(TestGreaterThanOrEqual, OperandType::kReg8) \ |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 344 |
342 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 345 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
343 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 346 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
344 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); | 347 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); |
345 | 348 |
346 } // namespace interpreter | 349 } // namespace interpreter |
347 } // namespace internal | 350 } // namespace internal |
348 } // namespace v8 | 351 } // namespace v8 |
349 | 352 |
350 #endif // V8_INTERPRETER_BYTECODES_H_ | 353 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |