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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 #undef COUNT_BYTECODE | 306 #undef COUNT_BYTECODE |
304 }; | 307 }; |
305 | 308 |
306 | 309 |
307 // An interpreter Register which is located in the function's Register file | 310 // An interpreter Register which is located in the function's Register file |
308 // in its stack-frame. Register hold parameters, this, and expression values. | 311 // in its stack-frame. Register hold parameters, this, and expression values. |
309 class Register { | 312 class Register { |
310 public: | 313 public: |
311 explicit Register(int index = kInvalidIndex) : index_(index) {} | 314 explicit Register(int index = kInvalidIndex) : index_(index) {} |
312 | 315 |
313 int index() const { | 316 int index() const { return index_; } |
314 DCHECK(index_ != kInvalidIndex); | |
315 return index_; | |
316 } | |
317 bool is_parameter() const { return index() < 0; } | 317 bool is_parameter() const { return index() < 0; } |
318 bool is_valid() const { return index_ != kInvalidIndex; } | 318 bool is_valid() const { return index_ != kInvalidIndex; } |
319 bool is_byte_operand() const; | 319 bool is_byte_operand() const; |
320 bool is_short_operand() const; | 320 bool is_short_operand() const; |
321 | 321 |
322 static Register FromParameterIndex(int index, int parameter_count); | 322 static Register FromParameterIndex(int index, int parameter_count); |
323 int ToParameterIndex(int parameter_count) const; | 323 int ToParameterIndex(int parameter_count) const; |
324 static int MaxParameterIndex(); | 324 static int MaxParameterIndex(); |
325 static int MaxRegisterIndex(); | 325 static int MaxRegisterIndex(); |
326 static int MaxRegisterIndexForByteOperand(); | 326 static int MaxRegisterIndexForByteOperand(); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 490 |
491 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 491 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
492 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 492 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
493 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); | 493 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); |
494 | 494 |
495 } // namespace interpreter | 495 } // namespace interpreter |
496 } // namespace internal | 496 } // namespace internal |
497 } // namespace v8 | 497 } // namespace v8 |
498 | 498 |
499 #endif // V8_INTERPRETER_BYTECODES_H_ | 499 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |