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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 }; | 301 }; |
299 | 302 |
300 | 303 |
301 // An interpreter Register which is located in the function's Register file | 304 // An interpreter Register which is located in the function's Register file |
302 // in its stack-frame. Register hold parameters, this, and expression values. | 305 // in its stack-frame. Register hold parameters, this, and expression values. |
303 class Register { | 306 class Register { |
304 public: | 307 public: |
305 explicit Register(int index = kInvalidIndex) : index_(index) {} | 308 explicit Register(int index = kInvalidIndex) : index_(index) {} |
306 | 309 |
307 int index() const { | 310 int index() const { |
308 DCHECK(index_ != kInvalidIndex); | |
Michael Starzinger
2016/02/04 13:40:20
nit: Please run "git cl format".
oth
2016/02/04 14:00:59
Manually fixed. Current git cl format is not updat
| |
309 return index_; | 311 return index_; |
310 } | 312 } |
311 bool is_parameter() const { return index() < 0; } | 313 bool is_parameter() const { return index() < 0; } |
312 bool is_valid() const { return index_ != kInvalidIndex; } | 314 bool is_valid() const { return index_ != kInvalidIndex; } |
313 bool is_byte_operand() const; | 315 bool is_byte_operand() const; |
314 bool is_short_operand() const; | 316 bool is_short_operand() const; |
315 | 317 |
316 static Register FromParameterIndex(int index, int parameter_count); | 318 static Register FromParameterIndex(int index, int parameter_count); |
317 int ToParameterIndex(int parameter_count) const; | 319 int ToParameterIndex(int parameter_count) const; |
318 static int MaxParameterIndex(); | 320 static int MaxParameterIndex(); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
484 | 486 |
485 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 487 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
486 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 488 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
487 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); | 489 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); |
488 | 490 |
489 } // namespace interpreter | 491 } // namespace interpreter |
490 } // namespace internal | 492 } // namespace internal |
491 } // namespace v8 | 493 } // namespace v8 |
492 | 494 |
493 #endif // V8_INTERPRETER_BYTECODES_H_ | 495 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |