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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 V(KeyedLoadICStrict, OperandType::kReg8, OperandType::kIdx8) \ | 61 V(KeyedLoadICStrict, OperandType::kReg8, OperandType::kIdx8) \ |
62 \ | 62 \ |
63 /* StoreIC operations */ \ | 63 /* StoreIC operations */ \ |
64 V(StoreICSloppy, OperandType::kReg8, OperandType::kReg8, OperandType::kIdx8) \ | 64 V(StoreICSloppy, OperandType::kReg8, OperandType::kReg8, OperandType::kIdx8) \ |
65 V(StoreICStrict, OperandType::kReg8, OperandType::kReg8, OperandType::kIdx8) \ | 65 V(StoreICStrict, OperandType::kReg8, OperandType::kReg8, OperandType::kIdx8) \ |
66 V(KeyedStoreICSloppy, OperandType::kReg8, OperandType::kReg8, \ | 66 V(KeyedStoreICSloppy, OperandType::kReg8, OperandType::kReg8, \ |
67 OperandType::kIdx8) \ | 67 OperandType::kIdx8) \ |
68 V(KeyedStoreICStrict, OperandType::kReg8, OperandType::kReg8, \ | 68 V(KeyedStoreICStrict, OperandType::kReg8, OperandType::kReg8, \ |
69 OperandType::kIdx8) \ | 69 OperandType::kIdx8) \ |
70 \ | 70 \ |
| 71 /* Context operations */ \ |
| 72 V(PushContext, OperandType::kReg8) \ |
| 73 V(PopContext, OperandType::kReg8) \ |
| 74 \ |
71 /* Binary Operators */ \ | 75 /* Binary Operators */ \ |
72 V(Add, OperandType::kReg8) \ | 76 V(Add, OperandType::kReg8) \ |
73 V(Sub, OperandType::kReg8) \ | 77 V(Sub, OperandType::kReg8) \ |
74 V(Mul, OperandType::kReg8) \ | 78 V(Mul, OperandType::kReg8) \ |
75 V(Div, OperandType::kReg8) \ | 79 V(Div, OperandType::kReg8) \ |
76 V(Mod, OperandType::kReg8) \ | 80 V(Mod, OperandType::kReg8) \ |
77 \ | 81 \ |
78 /* Unary Operators */ \ | 82 /* Unary Operators */ \ |
79 V(LogicalNot, OperandType::kNone) \ | 83 V(LogicalNot, OperandType::kNone) \ |
80 V(TypeOf, OperandType::kNone) \ | 84 V(TypeOf, OperandType::kNone) \ |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 int index() const { | 164 int index() const { |
161 DCHECK(index_ != kIllegalIndex); | 165 DCHECK(index_ != kIllegalIndex); |
162 return index_; | 166 return index_; |
163 } | 167 } |
164 bool is_parameter() const { return index() < 0; } | 168 bool is_parameter() const { return index() < 0; } |
165 | 169 |
166 static Register FromParameterIndex(int index, int parameter_count); | 170 static Register FromParameterIndex(int index, int parameter_count); |
167 int ToParameterIndex(int parameter_count) const; | 171 int ToParameterIndex(int parameter_count) const; |
168 static int MaxParameterIndex(); | 172 static int MaxParameterIndex(); |
169 | 173 |
| 174 // Returns the register for the function's closure object. |
| 175 static Register function_closure(); |
| 176 bool is_function_closure() const; |
| 177 |
170 // Returns the register for the function's outer context. | 178 // Returns the register for the function's outer context. |
171 static Register function_context(); | 179 static Register function_context(); |
172 bool is_function_context() const; | 180 bool is_function_context() const; |
173 | 181 |
174 static Register FromOperand(uint8_t operand); | 182 static Register FromOperand(uint8_t operand); |
175 uint8_t ToOperand() const; | 183 uint8_t ToOperand() const; |
176 | 184 |
177 private: | 185 private: |
178 static const int kIllegalIndex = kMaxInt; | 186 static const int kIllegalIndex = kMaxInt; |
179 | 187 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 252 |
245 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 253 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
246 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 254 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
247 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); | 255 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); |
248 | 256 |
249 } // namespace interpreter | 257 } // namespace interpreter |
250 } // namespace internal | 258 } // namespace internal |
251 } // namespace v8 | 259 } // namespace v8 |
252 | 260 |
253 #endif // V8_INTERPRETER_BYTECODES_H_ | 261 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |