| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 V(ForInNext, AccumulatorUse::kWrite, OperandType::kReg, OperandType::kReg, \ | 232 V(ForInNext, AccumulatorUse::kWrite, OperandType::kReg, OperandType::kReg, \ |
| 233 OperandType::kRegPair, OperandType::kIdx) \ | 233 OperandType::kRegPair, OperandType::kIdx) \ |
| 234 V(ForInStep, AccumulatorUse::kWrite, OperandType::kReg) \ | 234 V(ForInStep, AccumulatorUse::kWrite, OperandType::kReg) \ |
| 235 \ | 235 \ |
| 236 /* Perform a stack guard check */ \ | 236 /* Perform a stack guard check */ \ |
| 237 V(StackCheck, AccumulatorUse::kNone) \ | 237 V(StackCheck, AccumulatorUse::kNone) \ |
| 238 \ | 238 \ |
| 239 /* Non-local flow control */ \ | 239 /* Non-local flow control */ \ |
| 240 V(Throw, AccumulatorUse::kRead) \ | 240 V(Throw, AccumulatorUse::kRead) \ |
| 241 V(ReThrow, AccumulatorUse::kRead) \ | 241 V(ReThrow, AccumulatorUse::kRead) \ |
| 242 V(Return, AccumulatorUse::kRead) \ | 242 V(Return, AccumulatorUse::kNone) \ |
| 243 \ | 243 \ |
| 244 /* Generators */ \ | 244 /* Generators */ \ |
| 245 V(SuspendGenerator, AccumulatorUse::kRead, OperandType::kReg) \ | 245 V(SuspendGenerator, AccumulatorUse::kRead, OperandType::kReg) \ |
| 246 V(ResumeGenerator, AccumulatorUse::kWrite, OperandType::kReg) \ | 246 V(ResumeGenerator, AccumulatorUse::kWrite, OperandType::kReg) \ |
| 247 \ | 247 \ |
| 248 /* Debugger */ \ | 248 /* Debugger */ \ |
| 249 V(Debugger, AccumulatorUse::kNone) \ | 249 V(Debugger, AccumulatorUse::kNone) \ |
| 250 DEBUG_BREAK_BYTECODE_LIST(V) \ | 250 DEBUG_BREAK_BYTECODE_LIST(V) \ |
| 251 \ | 251 \ |
| 252 /* Illegal bytecode (terminates execution) */ \ | 252 /* Illegal bytecode (terminates execution) */ \ |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 // Returns a debug break bytecode to replace |bytecode|. | 502 // Returns a debug break bytecode to replace |bytecode|. |
| 503 static Bytecode GetDebugBreak(Bytecode bytecode); | 503 static Bytecode GetDebugBreak(Bytecode bytecode); |
| 504 | 504 |
| 505 // Returns the size of the bytecode including its operands for the | 505 // Returns the size of the bytecode including its operands for the |
| 506 // given |operand_scale|. | 506 // given |operand_scale|. |
| 507 static int Size(Bytecode bytecode, OperandScale operand_scale); | 507 static int Size(Bytecode bytecode, OperandScale operand_scale); |
| 508 | 508 |
| 509 // Returns the size of |operand|. | 509 // Returns the size of |operand|. |
| 510 static OperandSize SizeOfOperand(OperandType operand, OperandScale scale); | 510 static OperandSize SizeOfOperand(OperandType operand, OperandScale scale); |
| 511 | 511 |
| 512 // Returns the number of values which |bytecode| returns. | |
| 513 static size_t ReturnCount(Bytecode bytecode); | |
| 514 | |
| 515 // Returns true if the bytecode is a conditional jump taking | 512 // Returns true if the bytecode is a conditional jump taking |
| 516 // an immediate byte operand (OperandType::kImm). | 513 // an immediate byte operand (OperandType::kImm). |
| 517 static bool IsConditionalJumpImmediate(Bytecode bytecode); | 514 static bool IsConditionalJumpImmediate(Bytecode bytecode); |
| 518 | 515 |
| 519 // Returns true if the bytecode is a conditional jump taking | 516 // Returns true if the bytecode is a conditional jump taking |
| 520 // a constant pool entry (OperandType::kIdx). | 517 // a constant pool entry (OperandType::kIdx). |
| 521 static bool IsConditionalJumpConstant(Bytecode bytecode); | 518 static bool IsConditionalJumpConstant(Bytecode bytecode); |
| 522 | 519 |
| 523 // Returns true if the bytecode is a conditional jump taking | 520 // Returns true if the bytecode is a conditional jump taking |
| 524 // any kind of operand. | 521 // any kind of operand. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); | 641 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); |
| 645 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); | 642 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); |
| 646 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); | 643 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); |
| 647 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 644 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
| 648 | 645 |
| 649 } // namespace interpreter | 646 } // namespace interpreter |
| 650 } // namespace internal | 647 } // namespace internal |
| 651 } // namespace v8 | 648 } // namespace v8 |
| 652 | 649 |
| 653 #endif // V8_INTERPRETER_BYTECODES_H_ | 650 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |