| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
| 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
| 7 | 7 |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 | 10 |
| (...skipping 3782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3793 } | 3793 } |
| 3794 | 3794 |
| 3795 Range* InferRange(Zone* zone) override; | 3795 Range* InferRange(Zone* zone) override; |
| 3796 | 3796 |
| 3797 bool IsDeletable() const override { return true; } | 3797 bool IsDeletable() const override { return true; } |
| 3798 }; | 3798 }; |
| 3799 | 3799 |
| 3800 | 3800 |
| 3801 class HArithmeticBinaryOperation : public HBinaryOperation { | 3801 class HArithmeticBinaryOperation : public HBinaryOperation { |
| 3802 public: | 3802 public: |
| 3803 HArithmeticBinaryOperation(HValue* context, HValue* left, HValue* right) | 3803 HArithmeticBinaryOperation(HValue* context, HValue* left, HValue* right, |
| 3804 : HBinaryOperation(context, left, right, HType::TaggedNumber()) { | 3804 HType type = HType::TaggedNumber()) |
| 3805 : HBinaryOperation(context, left, right, type) { |
| 3805 SetAllSideEffects(); | 3806 SetAllSideEffects(); |
| 3806 SetFlag(kFlexibleRepresentation); | 3807 SetFlag(kFlexibleRepresentation); |
| 3807 SetFlag(kTruncatingToNumber); | 3808 SetFlag(kTruncatingToNumber); |
| 3808 } | 3809 } |
| 3809 | 3810 |
| 3810 void RepresentationChanged(Representation to) override { | 3811 void RepresentationChanged(Representation to) override { |
| 3811 if (to.IsTagged() && | 3812 if (to.IsTagged() && |
| 3812 (left()->ToNumberCanBeObserved() || right()->ToNumberCanBeObserved())) { | 3813 (left()->ToNumberCanBeObserved() || right()->ToNumberCanBeObserved())) { |
| 3813 SetAllSideEffects(); | 3814 SetAllSideEffects(); |
| 3814 ClearFlag(kUseGVN); | 3815 ClearFlag(kUseGVN); |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4319 DECLARE_CONCRETE_INSTRUCTION(Add) | 4320 DECLARE_CONCRETE_INSTRUCTION(Add) |
| 4320 | 4321 |
| 4321 protected: | 4322 protected: |
| 4322 bool DataEquals(HValue* other) override { return true; } | 4323 bool DataEquals(HValue* other) override { return true; } |
| 4323 | 4324 |
| 4324 Range* InferRange(Zone* zone) override; | 4325 Range* InferRange(Zone* zone) override; |
| 4325 | 4326 |
| 4326 private: | 4327 private: |
| 4327 HAdd(HValue* context, HValue* left, HValue* right, | 4328 HAdd(HValue* context, HValue* left, HValue* right, |
| 4328 ExternalAddType external_add_type = NoExternalAdd) | 4329 ExternalAddType external_add_type = NoExternalAdd) |
| 4329 : HArithmeticBinaryOperation(context, left, right), | 4330 : HArithmeticBinaryOperation(context, left, right, HType::Tagged()), |
| 4330 external_add_type_(external_add_type) { | 4331 external_add_type_(external_add_type) { |
| 4331 SetFlag(kCanOverflow); | 4332 SetFlag(kCanOverflow); |
| 4332 switch (external_add_type_) { | 4333 switch (external_add_type_) { |
| 4333 case AddOfExternalAndTagged: | 4334 case AddOfExternalAndTagged: |
| 4334 DCHECK(left->representation().IsExternal()); | 4335 DCHECK(left->representation().IsExternal()); |
| 4335 DCHECK(right->representation().IsTagged()); | 4336 DCHECK(right->representation().IsTagged()); |
| 4336 SetDependsOnFlag(kNewSpacePromotion); | 4337 SetDependsOnFlag(kNewSpacePromotion); |
| 4337 ClearFlag(HValue::kCanOverflow); | 4338 ClearFlag(HValue::kCanOverflow); |
| 4338 SetFlag(kHasNoObservableSideEffects); | 4339 SetFlag(kHasNoObservableSideEffects); |
| 4339 break; | 4340 break; |
| (...skipping 2542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6882 bool IsDeletable() const override { return true; } | 6883 bool IsDeletable() const override { return true; } |
| 6883 }; | 6884 }; |
| 6884 | 6885 |
| 6885 #undef DECLARE_INSTRUCTION | 6886 #undef DECLARE_INSTRUCTION |
| 6886 #undef DECLARE_CONCRETE_INSTRUCTION | 6887 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6887 | 6888 |
| 6888 } // namespace internal | 6889 } // namespace internal |
| 6889 } // namespace v8 | 6890 } // namespace v8 |
| 6890 | 6891 |
| 6891 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 6892 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |