| 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 <cstdint> | 8 #include <cstdint> |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 OperandType::kIdx) \ | 180 OperandType::kIdx) \ |
| 181 V(TestLessThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg, \ | 181 V(TestLessThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg, \ |
| 182 OperandType::kIdx) \ | 182 OperandType::kIdx) \ |
| 183 V(TestGreaterThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg, \ | 183 V(TestGreaterThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg, \ |
| 184 OperandType::kIdx) \ | 184 OperandType::kIdx) \ |
| 185 V(TestInstanceOf, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 185 V(TestInstanceOf, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 186 V(TestIn, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 186 V(TestIn, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 187 \ | 187 \ |
| 188 /* TestEqual with Null or Undefined */ \ | 188 /* TestEqual with Null or Undefined */ \ |
| 189 V(TestUndetectable, AccumulatorUse::kWrite, OperandType::kReg) \ | 189 V(TestUndetectable, AccumulatorUse::kWrite, OperandType::kReg) \ |
| 190 V(TestNull, AccumulatorUse::kWrite, OperandType::kReg) \ |
| 191 V(TestUndefined, AccumulatorUse::kWrite, OperandType::kReg) \ |
| 190 \ | 192 \ |
| 191 /* Cast operators */ \ | 193 /* Cast operators */ \ |
| 192 V(ToName, AccumulatorUse::kRead, OperandType::kRegOut) \ | 194 V(ToName, AccumulatorUse::kRead, OperandType::kRegOut) \ |
| 193 V(ToNumber, AccumulatorUse::kRead, OperandType::kRegOut) \ | 195 V(ToNumber, AccumulatorUse::kRead, OperandType::kRegOut) \ |
| 194 V(ToObject, AccumulatorUse::kRead, OperandType::kRegOut) \ | 196 V(ToObject, AccumulatorUse::kRead, OperandType::kRegOut) \ |
| 195 \ | 197 \ |
| 196 /* Literals */ \ | 198 /* Literals */ \ |
| 197 V(CreateRegExpLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \ | 199 V(CreateRegExpLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \ |
| 198 OperandType::kIdx, OperandType::kFlag8) \ | 200 OperandType::kIdx, OperandType::kFlag8) \ |
| 199 V(CreateArrayLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \ | 201 V(CreateArrayLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \ |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 case Bytecode::kTestNotEqual: | 479 case Bytecode::kTestNotEqual: |
| 478 case Bytecode::kTestEqualStrict: | 480 case Bytecode::kTestEqualStrict: |
| 479 case Bytecode::kTestLessThan: | 481 case Bytecode::kTestLessThan: |
| 480 case Bytecode::kTestLessThanOrEqual: | 482 case Bytecode::kTestLessThanOrEqual: |
| 481 case Bytecode::kTestGreaterThan: | 483 case Bytecode::kTestGreaterThan: |
| 482 case Bytecode::kTestGreaterThanOrEqual: | 484 case Bytecode::kTestGreaterThanOrEqual: |
| 483 case Bytecode::kTestInstanceOf: | 485 case Bytecode::kTestInstanceOf: |
| 484 case Bytecode::kTestIn: | 486 case Bytecode::kTestIn: |
| 485 case Bytecode::kTestUndetectable: | 487 case Bytecode::kTestUndetectable: |
| 486 case Bytecode::kForInContinue: | 488 case Bytecode::kForInContinue: |
| 489 case Bytecode::kTestUndefined: |
| 490 case Bytecode::kTestNull: |
| 487 return true; | 491 return true; |
| 488 default: | 492 default: |
| 489 return false; | 493 return false; |
| 490 } | 494 } |
| 491 } | 495 } |
| 492 | 496 |
| 493 // Return true if |bytecode| is an accumulator load without effects, | 497 // Return true if |bytecode| is an accumulator load without effects, |
| 494 // e.g. LdaConstant, LdaTrue, Ldar. | 498 // e.g. LdaConstant, LdaTrue, Ldar. |
| 495 static constexpr bool IsAccumulatorLoadWithoutEffects(Bytecode bytecode) { | 499 static constexpr bool IsAccumulatorLoadWithoutEffects(Bytecode bytecode) { |
| 496 return bytecode == Bytecode::kLdar || bytecode == Bytecode::kLdaZero || | 500 return bytecode == Bytecode::kLdar || bytecode == Bytecode::kLdaZero || |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 }; | 812 }; |
| 809 | 813 |
| 810 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, | 814 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, |
| 811 const Bytecode& bytecode); | 815 const Bytecode& bytecode); |
| 812 | 816 |
| 813 } // namespace interpreter | 817 } // namespace interpreter |
| 814 } // namespace internal | 818 } // namespace internal |
| 815 } // namespace v8 | 819 } // namespace v8 |
| 816 | 820 |
| 817 #endif // V8_INTERPRETER_BYTECODES_H_ | 821 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |