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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 OperandType::kIdx8) \ | 135 OperandType::kIdx8) \ |
136 V(StoreICSloppyWide, OperandType::kReg8, OperandType::kIdx16, \ | 136 V(StoreICSloppyWide, OperandType::kReg8, OperandType::kIdx16, \ |
137 OperandType::kIdx16) \ | 137 OperandType::kIdx16) \ |
138 V(StoreICStrictWide, OperandType::kReg8, OperandType::kIdx16, \ | 138 V(StoreICStrictWide, OperandType::kReg8, OperandType::kIdx16, \ |
139 OperandType::kIdx16) \ | 139 OperandType::kIdx16) \ |
140 V(KeyedStoreICSloppyWide, OperandType::kReg8, OperandType::kReg8, \ | 140 V(KeyedStoreICSloppyWide, OperandType::kReg8, OperandType::kReg8, \ |
141 OperandType::kIdx16) \ | 141 OperandType::kIdx16) \ |
142 V(KeyedStoreICStrictWide, OperandType::kReg8, OperandType::kReg8, \ | 142 V(KeyedStoreICStrictWide, OperandType::kReg8, OperandType::kReg8, \ |
143 OperandType::kIdx16) \ | 143 OperandType::kIdx16) \ |
144 \ | 144 \ |
| 145 /* Class information */ \ |
| 146 V(LdaInitialMap, OperandType::kNone) \ |
| 147 \ |
145 /* Binary Operators */ \ | 148 /* Binary Operators */ \ |
146 V(Add, OperandType::kReg8) \ | 149 V(Add, OperandType::kReg8) \ |
147 V(Sub, OperandType::kReg8) \ | 150 V(Sub, OperandType::kReg8) \ |
148 V(Mul, OperandType::kReg8) \ | 151 V(Mul, OperandType::kReg8) \ |
149 V(Div, OperandType::kReg8) \ | 152 V(Div, OperandType::kReg8) \ |
150 V(Mod, OperandType::kReg8) \ | 153 V(Mod, OperandType::kReg8) \ |
151 V(BitwiseOr, OperandType::kReg8) \ | 154 V(BitwiseOr, OperandType::kReg8) \ |
152 V(BitwiseXor, OperandType::kReg8) \ | 155 V(BitwiseXor, OperandType::kReg8) \ |
153 V(BitwiseAnd, OperandType::kReg8) \ | 156 V(BitwiseAnd, OperandType::kReg8) \ |
154 V(ShiftLeft, OperandType::kReg8) \ | 157 V(ShiftLeft, OperandType::kReg8) \ |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 #undef COUNT_BYTECODE | 303 #undef COUNT_BYTECODE |
301 }; | 304 }; |
302 | 305 |
303 | 306 |
304 // An interpreter Register which is located in the function's Register file | 307 // An interpreter Register which is located in the function's Register file |
305 // in its stack-frame. Register hold parameters, this, and expression values. | 308 // in its stack-frame. Register hold parameters, this, and expression values. |
306 class Register { | 309 class Register { |
307 public: | 310 public: |
308 explicit Register(int index = kInvalidIndex) : index_(index) {} | 311 explicit Register(int index = kInvalidIndex) : index_(index) {} |
309 | 312 |
310 int index() const { | 313 int index() const { return index_; } |
311 DCHECK(index_ != kInvalidIndex); | |
312 return index_; | |
313 } | |
314 bool is_parameter() const { return index() < 0; } | 314 bool is_parameter() const { return index() < 0; } |
315 bool is_valid() const { return index_ != kInvalidIndex; } | 315 bool is_valid() const { return index_ != kInvalidIndex; } |
316 bool is_byte_operand() const; | 316 bool is_byte_operand() const; |
317 bool is_short_operand() const; | 317 bool is_short_operand() const; |
318 | 318 |
319 static Register FromParameterIndex(int index, int parameter_count); | 319 static Register FromParameterIndex(int index, int parameter_count); |
320 int ToParameterIndex(int parameter_count) const; | 320 int ToParameterIndex(int parameter_count) const; |
321 static int MaxParameterIndex(); | 321 static int MaxParameterIndex(); |
322 static int MaxRegisterIndex(); | 322 static int MaxRegisterIndex(); |
323 static int MaxRegisterIndexForByteOperand(); | 323 static int MaxRegisterIndexForByteOperand(); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 487 |
488 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 488 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
489 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 489 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
490 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); | 490 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); |
491 | 491 |
492 } // namespace interpreter | 492 } // namespace interpreter |
493 } // namespace internal | 493 } // namespace internal |
494 } // namespace v8 | 494 } // namespace v8 |
495 | 495 |
496 #endif // V8_INTERPRETER_BYTECODES_H_ | 496 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |