| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 V(Mul, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 150 V(Mul, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 151 V(Div, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 151 V(Div, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 152 V(Mod, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 152 V(Mod, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 153 V(BitwiseOr, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 153 V(BitwiseOr, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 154 V(BitwiseXor, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 154 V(BitwiseXor, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 155 V(BitwiseAnd, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 155 V(BitwiseAnd, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 156 V(ShiftLeft, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 156 V(ShiftLeft, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 157 V(ShiftRight, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 157 V(ShiftRight, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 158 V(ShiftRightLogical, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 158 V(ShiftRightLogical, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 159 \ | 159 \ |
| 160 /* Binary operators with immediate operands */ \ |
| 161 V(AddSmi, AccumulatorUse::kWrite, OperandType::kImm, OperandType::kReg) \ |
| 162 V(SubSmi, AccumulatorUse::kWrite, OperandType::kImm, OperandType::kReg) \ |
| 163 V(BitwiseOrSmi, AccumulatorUse::kWrite, OperandType::kImm, \ |
| 164 OperandType::kReg) \ |
| 165 V(BitwiseAndSmi, AccumulatorUse::kWrite, OperandType::kImm, \ |
| 166 OperandType::kReg) \ |
| 167 V(ShiftLeftSmi, AccumulatorUse::kWrite, OperandType::kImm, \ |
| 168 OperandType::kReg) \ |
| 169 V(ShiftRightSmi, AccumulatorUse::kWrite, OperandType::kImm, \ |
| 170 OperandType::kReg) \ |
| 171 \ |
| 160 /* Unary Operators */ \ | 172 /* Unary Operators */ \ |
| 161 V(Inc, AccumulatorUse::kReadWrite) \ | 173 V(Inc, AccumulatorUse::kReadWrite) \ |
| 162 V(Dec, AccumulatorUse::kReadWrite) \ | 174 V(Dec, AccumulatorUse::kReadWrite) \ |
| 163 V(ToBooleanLogicalNot, AccumulatorUse::kReadWrite) \ | 175 V(ToBooleanLogicalNot, AccumulatorUse::kReadWrite) \ |
| 164 V(LogicalNot, AccumulatorUse::kReadWrite) \ | 176 V(LogicalNot, AccumulatorUse::kReadWrite) \ |
| 165 V(TypeOf, AccumulatorUse::kReadWrite) \ | 177 V(TypeOf, AccumulatorUse::kReadWrite) \ |
| 166 V(DeletePropertyStrict, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 178 V(DeletePropertyStrict, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 167 V(DeletePropertySloppy, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 179 V(DeletePropertySloppy, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 168 \ | 180 \ |
| 169 /* Call operations */ \ | 181 /* Call operations */ \ |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 597 |
| 586 // Returns true if the bytecode is a call to the runtime. | 598 // Returns true if the bytecode is a call to the runtime. |
| 587 static bool IsCallRuntime(Bytecode bytecode); | 599 static bool IsCallRuntime(Bytecode bytecode); |
| 588 | 600 |
| 589 // Returns true if the bytecode is a debug break. | 601 // Returns true if the bytecode is a debug break. |
| 590 static bool IsDebugBreak(Bytecode bytecode); | 602 static bool IsDebugBreak(Bytecode bytecode); |
| 591 | 603 |
| 592 // Returns true if the bytecode is Ldar or Star. | 604 // Returns true if the bytecode is Ldar or Star. |
| 593 static bool IsLdarOrStar(Bytecode bytecode); | 605 static bool IsLdarOrStar(Bytecode bytecode); |
| 594 | 606 |
| 607 // Returns true if the bytecode is LdaSmi or LdaZero. |
| 608 static bool IsLdaSmiOrLdaZero(Bytecode bytecode); |
| 609 |
| 595 // Returns true if the bytecode has wider operand forms. | 610 // Returns true if the bytecode has wider operand forms. |
| 596 static bool IsBytecodeWithScalableOperands(Bytecode bytecode); | 611 static bool IsBytecodeWithScalableOperands(Bytecode bytecode); |
| 597 | 612 |
| 598 // Returns true if the bytecode is a scaling prefix bytecode. | 613 // Returns true if the bytecode is a scaling prefix bytecode. |
| 599 static bool IsPrefixScalingBytecode(Bytecode bytecode); | 614 static bool IsPrefixScalingBytecode(Bytecode bytecode); |
| 600 | 615 |
| 601 // Returns true if |operand_type| is any type of register operand. | 616 // Returns true if |operand_type| is any type of register operand. |
| 602 static bool IsRegisterOperandType(OperandType operand_type); | 617 static bool IsRegisterOperandType(OperandType operand_type); |
| 603 | 618 |
| 604 // Returns true if |operand_type| represents a register used as an input. | 619 // Returns true if |operand_type| represents a register used as an input. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); | 699 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); |
| 685 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); | 700 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); |
| 686 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); | 701 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); |
| 687 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 702 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
| 688 | 703 |
| 689 } // namespace interpreter | 704 } // namespace interpreter |
| 690 } // namespace internal | 705 } // namespace internal |
| 691 } // namespace v8 | 706 } // namespace v8 |
| 692 | 707 |
| 693 #endif // V8_INTERPRETER_BYTECODES_H_ | 708 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |