| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 : reason_(reason), type_(type) {} | 1296 : reason_(reason), type_(type) {} |
| 1297 | 1297 |
| 1298 const char* reason_; | 1298 const char* reason_; |
| 1299 Deoptimizer::BailoutType type_; | 1299 Deoptimizer::BailoutType type_; |
| 1300 }; | 1300 }; |
| 1301 | 1301 |
| 1302 | 1302 |
| 1303 // Inserts an int3/stop break instruction for debugging purposes. | 1303 // Inserts an int3/stop break instruction for debugging purposes. |
| 1304 class HDebugBreak V8_FINAL : public HTemplateInstruction<0> { | 1304 class HDebugBreak V8_FINAL : public HTemplateInstruction<0> { |
| 1305 public: | 1305 public: |
| 1306 DECLARE_INSTRUCTION_FACTORY_P0(HDebugBreak) |
| 1307 |
| 1306 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 1308 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 1307 return Representation::None(); | 1309 return Representation::None(); |
| 1308 } | 1310 } |
| 1309 | 1311 |
| 1310 DECLARE_CONCRETE_INSTRUCTION(DebugBreak) | 1312 DECLARE_CONCRETE_INSTRUCTION(DebugBreak) |
| 1311 }; | 1313 }; |
| 1312 | 1314 |
| 1313 | 1315 |
| 1314 class HGoto V8_FINAL : public HTemplateControlInstruction<1, 0> { | 1316 class HGoto V8_FINAL : public HTemplateControlInstruction<1, 0> { |
| 1315 public: | 1317 public: |
| (...skipping 2556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3872 | 3874 |
| 3873 class HBitwiseBinaryOperation : public HBinaryOperation { | 3875 class HBitwiseBinaryOperation : public HBinaryOperation { |
| 3874 public: | 3876 public: |
| 3875 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right, | 3877 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right, |
| 3876 HType type = HType::Tagged()) | 3878 HType type = HType::Tagged()) |
| 3877 : HBinaryOperation(context, left, right, type) { | 3879 : HBinaryOperation(context, left, right, type) { |
| 3878 SetFlag(kFlexibleRepresentation); | 3880 SetFlag(kFlexibleRepresentation); |
| 3879 SetFlag(kTruncatingToInt32); | 3881 SetFlag(kTruncatingToInt32); |
| 3880 SetFlag(kAllowUndefinedAsNaN); | 3882 SetFlag(kAllowUndefinedAsNaN); |
| 3881 SetAllSideEffects(); | 3883 SetAllSideEffects(); |
| 3884 if (left->IsForceRepresentation()) { |
| 3885 left->SetFlag(kTruncatingToInt32); |
| 3886 } |
| 3887 if (right->IsForceRepresentation()) { |
| 3888 right->SetFlag(kTruncatingToInt32); |
| 3889 } |
| 3882 } | 3890 } |
| 3883 | 3891 |
| 3884 virtual void RepresentationChanged(Representation to) V8_OVERRIDE { | 3892 virtual void RepresentationChanged(Representation to) V8_OVERRIDE { |
| 3885 if (!to.IsTagged()) { | 3893 if (to.IsTagged()) { |
| 3886 ASSERT(to.IsSmiOrInteger32()); | 3894 SetAllSideEffects(); |
| 3895 ClearFlag(kUseGVN); |
| 3896 } else { |
| 3887 ClearAllSideEffects(); | 3897 ClearAllSideEffects(); |
| 3888 SetFlag(kUseGVN); | 3898 SetFlag(kUseGVN); |
| 3889 } else { | |
| 3890 SetAllSideEffects(); | |
| 3891 ClearFlag(kUseGVN); | |
| 3892 } | 3899 } |
| 3893 } | 3900 } |
| 3894 | 3901 |
| 3895 virtual void UpdateRepresentation(Representation new_rep, | 3902 virtual void UpdateRepresentation(Representation new_rep, |
| 3896 HInferRepresentationPhase* h_infer, | 3903 HInferRepresentationPhase* h_infer, |
| 3897 const char* reason) V8_OVERRIDE { | 3904 const char* reason) V8_OVERRIDE { |
| 3898 // We only generate either int32 or generic tagged bitwise operations. | 3905 // We only generate either int32 or generic tagged bitwise operations. |
| 3899 if (new_rep.IsDouble()) new_rep = Representation::Integer32(); | 3906 if (new_rep.IsDouble()) new_rep = Representation::Integer32(); |
| 3900 HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | 3907 HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); |
| 3901 } | 3908 } |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4515 | 4522 |
| 4516 | 4523 |
| 4517 class HMul V8_FINAL : public HArithmeticBinaryOperation { | 4524 class HMul V8_FINAL : public HArithmeticBinaryOperation { |
| 4518 public: | 4525 public: |
| 4519 static HInstruction* New(Zone* zone, | 4526 static HInstruction* New(Zone* zone, |
| 4520 HValue* context, | 4527 HValue* context, |
| 4521 HValue* left, | 4528 HValue* left, |
| 4522 HValue* right); | 4529 HValue* right); |
| 4523 | 4530 |
| 4524 static HInstruction* NewImul(Zone* zone, | 4531 static HInstruction* NewImul(Zone* zone, |
| 4525 HValue* context, | 4532 HValue* context, |
| 4526 HValue* left, | 4533 HValue* left, |
| 4527 HValue* right) { | 4534 HValue* right) { |
| 4528 HMul* mul = new(zone) HMul(context, left, right); | 4535 HInstruction* instr = HMul::New(zone, context, left, right); |
| 4536 if (!instr->IsMul()) return instr; |
| 4537 HMul* mul = HMul::cast(instr); |
| 4529 // TODO(mstarzinger): Prevent bailout on minus zero for imul. | 4538 // TODO(mstarzinger): Prevent bailout on minus zero for imul. |
| 4530 mul->AssumeRepresentation(Representation::Integer32()); | 4539 mul->AssumeRepresentation(Representation::Integer32()); |
| 4531 mul->ClearFlag(HValue::kCanOverflow); | 4540 mul->ClearFlag(HValue::kCanOverflow); |
| 4532 return mul; | 4541 return mul; |
| 4533 } | 4542 } |
| 4534 | 4543 |
| 4535 virtual HValue* EnsureAndPropagateNotMinusZero( | 4544 virtual HValue* EnsureAndPropagateNotMinusZero( |
| 4536 BitVector* visited) V8_OVERRIDE; | 4545 BitVector* visited) V8_OVERRIDE; |
| 4537 | 4546 |
| 4538 virtual HValue* Canonicalize() V8_OVERRIDE; | 4547 virtual HValue* Canonicalize() V8_OVERRIDE; |
| (...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6485 | 6494 |
| 6486 DECLARE_CONCRETE_INSTRUCTION(StringAdd) | 6495 DECLARE_CONCRETE_INSTRUCTION(StringAdd) |
| 6487 | 6496 |
| 6488 protected: | 6497 protected: |
| 6489 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } | 6498 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } |
| 6490 | 6499 |
| 6491 private: | 6500 private: |
| 6492 HStringAdd(HValue* context, HValue* left, HValue* right, StringAddFlags flags) | 6501 HStringAdd(HValue* context, HValue* left, HValue* right, StringAddFlags flags) |
| 6493 : HBinaryOperation(context, left, right, HType::String()), flags_(flags) { | 6502 : HBinaryOperation(context, left, right, HType::String()), flags_(flags) { |
| 6494 set_representation(Representation::Tagged()); | 6503 set_representation(Representation::Tagged()); |
| 6495 SetFlag(kUseGVN); | 6504 if (flags_ == STRING_ADD_CHECK_NONE) { |
| 6496 SetGVNFlag(kDependsOnMaps); | 6505 SetFlag(kUseGVN); |
| 6497 SetGVNFlag(kChangesNewSpacePromotion); | 6506 SetGVNFlag(kDependsOnMaps); |
| 6507 SetGVNFlag(kChangesNewSpacePromotion); |
| 6508 } else { |
| 6509 SetAllSideEffects(); |
| 6510 } |
| 6498 } | 6511 } |
| 6499 | 6512 |
| 6500 // No side-effects except possible allocation. | 6513 // No side-effects except possible allocation. |
| 6501 // NOTE: this instruction _does not_ call ToString() on its inputs. | 6514 // NOTE: this instruction _does not_ call ToString() on its inputs. |
| 6502 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 6515 virtual bool IsDeletable() const V8_OVERRIDE { |
| 6516 return flags_ == STRING_ADD_CHECK_NONE; |
| 6517 } |
| 6503 | 6518 |
| 6504 const StringAddFlags flags_; | 6519 const StringAddFlags flags_; |
| 6505 }; | 6520 }; |
| 6506 | 6521 |
| 6507 | 6522 |
| 6508 class HStringCharCodeAt V8_FINAL : public HTemplateInstruction<3> { | 6523 class HStringCharCodeAt V8_FINAL : public HTemplateInstruction<3> { |
| 6509 public: | 6524 public: |
| 6510 static HStringCharCodeAt* New(Zone* zone, | 6525 static HStringCharCodeAt* New(Zone* zone, |
| 6511 HValue* context, | 6526 HValue* context, |
| 6512 HValue* string, | 6527 HValue* string, |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6969 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 6984 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 6970 }; | 6985 }; |
| 6971 | 6986 |
| 6972 | 6987 |
| 6973 #undef DECLARE_INSTRUCTION | 6988 #undef DECLARE_INSTRUCTION |
| 6974 #undef DECLARE_CONCRETE_INSTRUCTION | 6989 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6975 | 6990 |
| 6976 } } // namespace v8::internal | 6991 } } // namespace v8::internal |
| 6977 | 6992 |
| 6978 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6993 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |