| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 OperandType::kIdx) \ | 178 OperandType::kIdx) \ |
| 179 V(TestLessThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg, \ | 179 V(TestLessThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg, \ |
| 180 OperandType::kIdx) \ | 180 OperandType::kIdx) \ |
| 181 V(TestGreaterThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg, \ | 181 V(TestGreaterThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg, \ |
| 182 OperandType::kIdx) \ | 182 OperandType::kIdx) \ |
| 183 V(TestInstanceOf, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 183 V(TestInstanceOf, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 184 V(TestIn, AccumulatorUse::kReadWrite, OperandType::kReg) \ | 184 V(TestIn, AccumulatorUse::kReadWrite, OperandType::kReg) \ |
| 185 \ | 185 \ |
| 186 /* TestEqual with Null or Undefined */ \ | 186 /* TestEqual with Null or Undefined */ \ |
| 187 V(TestUndetectable, AccumulatorUse::kWrite, OperandType::kReg) \ | 187 V(TestUndetectable, AccumulatorUse::kWrite, OperandType::kReg) \ |
| 188 V(TestNull, AccumulatorUse::kWrite, OperandType::kReg) \ |
| 189 V(TestUndefined, AccumulatorUse::kWrite, OperandType::kReg) \ |
| 188 \ | 190 \ |
| 189 /* Cast operators */ \ | 191 /* Cast operators */ \ |
| 190 V(ToName, AccumulatorUse::kRead, OperandType::kRegOut) \ | 192 V(ToName, AccumulatorUse::kRead, OperandType::kRegOut) \ |
| 191 V(ToNumber, AccumulatorUse::kRead, OperandType::kRegOut) \ | 193 V(ToNumber, AccumulatorUse::kRead, OperandType::kRegOut) \ |
| 192 V(ToObject, AccumulatorUse::kRead, OperandType::kRegOut) \ | 194 V(ToObject, AccumulatorUse::kRead, OperandType::kRegOut) \ |
| 193 \ | 195 \ |
| 194 /* Literals */ \ | 196 /* Literals */ \ |
| 195 V(CreateRegExpLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \ | 197 V(CreateRegExpLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \ |
| 196 OperandType::kIdx, OperandType::kFlag8) \ | 198 OperandType::kIdx, OperandType::kFlag8) \ |
| 197 V(CreateArrayLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \ | 199 V(CreateArrayLiteral, AccumulatorUse::kWrite, OperandType::kIdx, \ |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 case Bytecode::kTestNotEqual: | 483 case Bytecode::kTestNotEqual: |
| 482 case Bytecode::kTestEqualStrict: | 484 case Bytecode::kTestEqualStrict: |
| 483 case Bytecode::kTestLessThan: | 485 case Bytecode::kTestLessThan: |
| 484 case Bytecode::kTestLessThanOrEqual: | 486 case Bytecode::kTestLessThanOrEqual: |
| 485 case Bytecode::kTestGreaterThan: | 487 case Bytecode::kTestGreaterThan: |
| 486 case Bytecode::kTestGreaterThanOrEqual: | 488 case Bytecode::kTestGreaterThanOrEqual: |
| 487 case Bytecode::kTestInstanceOf: | 489 case Bytecode::kTestInstanceOf: |
| 488 case Bytecode::kTestIn: | 490 case Bytecode::kTestIn: |
| 489 case Bytecode::kTestUndetectable: | 491 case Bytecode::kTestUndetectable: |
| 490 case Bytecode::kForInContinue: | 492 case Bytecode::kForInContinue: |
| 493 case Bytecode::kTestUndefined: |
| 494 case Bytecode::kTestNull: |
| 491 return true; | 495 return true; |
| 492 default: | 496 default: |
| 493 return false; | 497 return false; |
| 494 } | 498 } |
| 495 } | 499 } |
| 496 | 500 |
| 497 // Return true if |bytecode| is an accumulator load without effects, | 501 // Return true if |bytecode| is an accumulator load without effects, |
| 498 // e.g. LdaConstant, LdaTrue, Ldar. | 502 // e.g. LdaConstant, LdaTrue, Ldar. |
| 499 static CONSTEXPR bool IsAccumulatorLoadWithoutEffects(Bytecode bytecode) { | 503 static CONSTEXPR bool IsAccumulatorLoadWithoutEffects(Bytecode bytecode) { |
| 500 return bytecode == Bytecode::kLdar || bytecode == Bytecode::kLdaZero || | 504 return bytecode == Bytecode::kLdar || bytecode == Bytecode::kLdaZero || |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 #undef CONSTEXPR | 820 #undef CONSTEXPR |
| 817 | 821 |
| 818 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, | 822 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, |
| 819 const Bytecode& bytecode); | 823 const Bytecode& bytecode); |
| 820 | 824 |
| 821 } // namespace interpreter | 825 } // namespace interpreter |
| 822 } // namespace internal | 826 } // namespace internal |
| 823 } // namespace v8 | 827 } // namespace v8 |
| 824 | 828 |
| 825 #endif // V8_INTERPRETER_BYTECODES_H_ | 829 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |