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 V(BitwiseOr, OperandType::kReg8) \ | 81 V(BitwiseOr, OperandType::kReg8) \ |
78 V(BitwiseXor, OperandType::kReg8) \ | 82 V(BitwiseXor, OperandType::kReg8) \ |
79 V(BitwiseAnd, OperandType::kReg8) \ | 83 V(BitwiseAnd, OperandType::kReg8) \ |
80 V(ShiftLeft, OperandType::kReg8) \ | 84 V(ShiftLeft, OperandType::kReg8) \ |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 int index() const { | 173 int index() const { |
170 DCHECK(index_ != kIllegalIndex); | 174 DCHECK(index_ != kIllegalIndex); |
171 return index_; | 175 return index_; |
172 } | 176 } |
173 bool is_parameter() const { return index() < 0; } | 177 bool is_parameter() const { return index() < 0; } |
174 | 178 |
175 static Register FromParameterIndex(int index, int parameter_count); | 179 static Register FromParameterIndex(int index, int parameter_count); |
176 int ToParameterIndex(int parameter_count) const; | 180 int ToParameterIndex(int parameter_count) const; |
177 static int MaxParameterIndex(); | 181 static int MaxParameterIndex(); |
178 | 182 |
| 183 // Returns the register for the function's closure object. |
| 184 static Register function_closure(); |
| 185 bool is_function_closure() const; |
| 186 |
179 // Returns the register for the function's outer context. | 187 // Returns the register for the function's outer context. |
180 static Register function_context(); | 188 static Register function_context(); |
181 bool is_function_context() const; | 189 bool is_function_context() const; |
182 | 190 |
183 static Register FromOperand(uint8_t operand); | 191 static Register FromOperand(uint8_t operand); |
184 uint8_t ToOperand() const; | 192 uint8_t ToOperand() const; |
185 | 193 |
186 private: | 194 private: |
187 static const int kIllegalIndex = kMaxInt; | 195 static const int kIllegalIndex = kMaxInt; |
188 | 196 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 261 |
254 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 262 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
255 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 263 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
256 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); | 264 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); |
257 | 265 |
258 } // namespace interpreter | 266 } // namespace interpreter |
259 } // namespace internal | 267 } // namespace internal |
260 } // namespace v8 | 268 } // namespace v8 |
261 | 269 |
262 #endif // V8_INTERPRETER_BYTECODES_H_ | 270 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |