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. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 /* Binary Operators */ \ | 51 /* Binary Operators */ \ |
52 V(Add, OperandType::kReg) \ | 52 V(Add, OperandType::kReg) \ |
53 V(Sub, OperandType::kReg) \ | 53 V(Sub, OperandType::kReg) \ |
54 V(Mul, OperandType::kReg) \ | 54 V(Mul, OperandType::kReg) \ |
55 V(Div, OperandType::kReg) \ | 55 V(Div, OperandType::kReg) \ |
56 V(Mod, OperandType::kReg) \ | 56 V(Mod, OperandType::kReg) \ |
57 \ | 57 \ |
58 /* Call operations. */ \ | 58 /* Call operations. */ \ |
59 V(Call, OperandType::kReg, OperandType::kReg, OperandType::kCount) \ | 59 V(Call, OperandType::kReg, OperandType::kReg, OperandType::kCount) \ |
60 \ | 60 \ |
61 /* Test Operators */ \ | |
62 V(TestEqual, OperandType::kReg) \ | |
63 V(TestNotEqual, OperandType::kReg) \ | |
64 V(TestEqualStrict, OperandType::kReg) \ | |
65 V(TestNotEqualStrict, OperandType::kReg) \ | |
66 V(TestLessThan, OperandType::kReg) \ | |
67 V(TestGreaterThan, OperandType::kReg) \ | |
68 V(TestLessThanEqual, OperandType::kReg) \ | |
69 V(TestGreaterThanEqual, OperandType::kReg) \ | |
70 V(TestInstanceOf, OperandType::kReg) \ | |
71 V(TestIn, OperandType::kReg) \ | |
72 \ | |
73 /* Cast operators */ \ | |
74 V(CastToBoolean, OperandType::kNone) \ | |
rmcilroy
2015/09/23 14:00:29
Drop the "Cast" just ToBoolean (thoughout), since
oth
2015/09/24 11:15:27
Done.
| |
75 \ | |
61 /* Control Flow */ \ | 76 /* Control Flow */ \ |
77 V(Jump, OperandType::kImm8) \ | |
78 V(JumpConstant, OperandType::kIdx) \ | |
79 V(JumpIfTrue, OperandType::kImm8) \ | |
80 V(JumpIfTrueConstant, OperandType::kIdx) \ | |
81 V(JumpIfFalse, OperandType::kImm8) \ | |
82 V(JumpIfFalseConstant, OperandType::kIdx) \ | |
62 V(Return, OperandType::kNone) | 83 V(Return, OperandType::kNone) |
63 | 84 |
64 | 85 |
65 // Enumeration of operand types used by bytecodes. | 86 // Enumeration of operand types used by bytecodes. |
66 enum class OperandType : uint8_t { | 87 enum class OperandType : uint8_t { |
67 #define DECLARE_OPERAND_TYPE(Name) k##Name, | 88 #define DECLARE_OPERAND_TYPE(Name) k##Name, |
68 OPERAND_TYPE_LIST(DECLARE_OPERAND_TYPE) | 89 OPERAND_TYPE_LIST(DECLARE_OPERAND_TYPE) |
69 #undef DECLARE_OPERAND_TYPE | 90 #undef DECLARE_OPERAND_TYPE |
70 #define COUNT_OPERAND_TYPES(x) +1 | 91 #define COUNT_OPERAND_TYPES(x) +1 |
71 // The COUNT_OPERAND macro will turn this into kLast = -1 +1 +1... which will | 92 // The COUNT_OPERAND macro will turn this into kLast = -1 +1 +1... which will |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 }; | 184 }; |
164 | 185 |
165 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 186 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
166 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 187 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
167 | 188 |
168 } // namespace interpreter | 189 } // namespace interpreter |
169 } // namespace internal | 190 } // namespace internal |
170 } // namespace v8 | 191 } // namespace v8 |
171 | 192 |
172 #endif // V8_INTERPRETER_BYTECODES_H_ | 193 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |