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 4027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4038 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right, | 4038 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right, |
4039 HType type = HType::Tagged()) | 4039 HType type = HType::Tagged()) |
4040 : HBinaryOperation(context, left, right, type) { | 4040 : HBinaryOperation(context, left, right, type) { |
4041 SetFlag(kFlexibleRepresentation); | 4041 SetFlag(kFlexibleRepresentation); |
4042 SetFlag(kTruncatingToInt32); | 4042 SetFlag(kTruncatingToInt32); |
4043 SetFlag(kAllowUndefinedAsNaN); | 4043 SetFlag(kAllowUndefinedAsNaN); |
4044 SetAllSideEffects(); | 4044 SetAllSideEffects(); |
4045 } | 4045 } |
4046 | 4046 |
4047 virtual void RepresentationChanged(Representation to) V8_OVERRIDE { | 4047 virtual void RepresentationChanged(Representation to) V8_OVERRIDE { |
4048 if (to.IsTagged()) SetChangesFlag(kNewSpacePromotion); | |
4049 if (to.IsTagged() && | 4048 if (to.IsTagged() && |
4050 (left()->ToNumberCanBeObserved() || right()->ToNumberCanBeObserved())) { | 4049 (left()->ToNumberCanBeObserved() || right()->ToNumberCanBeObserved())) { |
4051 SetAllSideEffects(); | 4050 SetAllSideEffects(); |
4052 ClearFlag(kUseGVN); | 4051 ClearFlag(kUseGVN); |
4053 } else { | 4052 } else { |
4054 ClearAllSideEffects(); | 4053 ClearAllSideEffects(); |
4055 SetFlag(kUseGVN); | 4054 SetFlag(kUseGVN); |
4056 } | 4055 } |
| 4056 if (to.IsTagged()) SetChangesFlag(kNewSpacePromotion); |
4057 } | 4057 } |
4058 | 4058 |
4059 virtual void UpdateRepresentation(Representation new_rep, | 4059 virtual void UpdateRepresentation(Representation new_rep, |
4060 HInferRepresentationPhase* h_infer, | 4060 HInferRepresentationPhase* h_infer, |
4061 const char* reason) V8_OVERRIDE { | 4061 const char* reason) V8_OVERRIDE { |
4062 // We only generate either int32 or generic tagged bitwise operations. | 4062 // We only generate either int32 or generic tagged bitwise operations. |
4063 if (new_rep.IsDouble()) new_rep = Representation::Integer32(); | 4063 if (new_rep.IsDouble()) new_rep = Representation::Integer32(); |
4064 HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | 4064 HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); |
4065 } | 4065 } |
4066 | 4066 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4112 class HArithmeticBinaryOperation : public HBinaryOperation { | 4112 class HArithmeticBinaryOperation : public HBinaryOperation { |
4113 public: | 4113 public: |
4114 HArithmeticBinaryOperation(HValue* context, HValue* left, HValue* right) | 4114 HArithmeticBinaryOperation(HValue* context, HValue* left, HValue* right) |
4115 : HBinaryOperation(context, left, right, HType::TaggedNumber()) { | 4115 : HBinaryOperation(context, left, right, HType::TaggedNumber()) { |
4116 SetAllSideEffects(); | 4116 SetAllSideEffects(); |
4117 SetFlag(kFlexibleRepresentation); | 4117 SetFlag(kFlexibleRepresentation); |
4118 SetFlag(kAllowUndefinedAsNaN); | 4118 SetFlag(kAllowUndefinedAsNaN); |
4119 } | 4119 } |
4120 | 4120 |
4121 virtual void RepresentationChanged(Representation to) V8_OVERRIDE { | 4121 virtual void RepresentationChanged(Representation to) V8_OVERRIDE { |
4122 if (to.IsTagged()) SetChangesFlag(kNewSpacePromotion); | |
4123 if (to.IsTagged() && | 4122 if (to.IsTagged() && |
4124 (left()->ToNumberCanBeObserved() || right()->ToNumberCanBeObserved())) { | 4123 (left()->ToNumberCanBeObserved() || right()->ToNumberCanBeObserved())) { |
4125 SetAllSideEffects(); | 4124 SetAllSideEffects(); |
4126 ClearFlag(kUseGVN); | 4125 ClearFlag(kUseGVN); |
4127 } else { | 4126 } else { |
4128 ClearAllSideEffects(); | 4127 ClearAllSideEffects(); |
4129 SetFlag(kUseGVN); | 4128 SetFlag(kUseGVN); |
4130 } | 4129 } |
| 4130 if (to.IsTagged()) SetChangesFlag(kNewSpacePromotion); |
4131 } | 4131 } |
4132 | 4132 |
4133 DECLARE_ABSTRACT_INSTRUCTION(ArithmeticBinaryOperation) | 4133 DECLARE_ABSTRACT_INSTRUCTION(ArithmeticBinaryOperation) |
4134 | 4134 |
4135 private: | 4135 private: |
4136 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 4136 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
4137 }; | 4137 }; |
4138 | 4138 |
4139 | 4139 |
4140 class HCompareGeneric V8_FINAL : public HBinaryOperation { | 4140 class HCompareGeneric V8_FINAL : public HBinaryOperation { |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4696 return true; | 4696 return true; |
4697 } else if (right()->IsInteger32Constant()) { | 4697 } else if (right()->IsInteger32Constant()) { |
4698 decomposition->Apply(left(), right()->GetInteger32Constant()); | 4698 decomposition->Apply(left(), right()->GetInteger32Constant()); |
4699 return true; | 4699 return true; |
4700 } else { | 4700 } else { |
4701 return false; | 4701 return false; |
4702 } | 4702 } |
4703 } | 4703 } |
4704 | 4704 |
4705 virtual void RepresentationChanged(Representation to) V8_OVERRIDE { | 4705 virtual void RepresentationChanged(Representation to) V8_OVERRIDE { |
4706 if (to.IsTagged()) { | |
4707 SetChangesFlag(kNewSpacePromotion); | |
4708 ClearFlag(kAllowUndefinedAsNaN); | |
4709 } | |
4710 if (to.IsTagged() && | 4706 if (to.IsTagged() && |
4711 (left()->ToNumberCanBeObserved() || right()->ToNumberCanBeObserved() || | 4707 (left()->ToNumberCanBeObserved() || right()->ToNumberCanBeObserved() || |
4712 left()->ToStringCanBeObserved() || right()->ToStringCanBeObserved())) { | 4708 left()->ToStringCanBeObserved() || right()->ToStringCanBeObserved())) { |
4713 SetAllSideEffects(); | 4709 SetAllSideEffects(); |
4714 ClearFlag(kUseGVN); | 4710 ClearFlag(kUseGVN); |
4715 } else { | 4711 } else { |
4716 ClearAllSideEffects(); | 4712 ClearAllSideEffects(); |
4717 SetFlag(kUseGVN); | 4713 SetFlag(kUseGVN); |
4718 } | 4714 } |
| 4715 if (to.IsTagged()) { |
| 4716 SetChangesFlag(kNewSpacePromotion); |
| 4717 ClearFlag(kAllowUndefinedAsNaN); |
| 4718 } |
4719 } | 4719 } |
4720 | 4720 |
4721 virtual Representation RepresentationFromInputs() V8_OVERRIDE; | 4721 virtual Representation RepresentationFromInputs() V8_OVERRIDE; |
4722 | 4722 |
4723 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE; | 4723 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE; |
4724 | 4724 |
4725 DECLARE_CONCRETE_INSTRUCTION(Add) | 4725 DECLARE_CONCRETE_INSTRUCTION(Add) |
4726 | 4726 |
4727 protected: | 4727 protected: |
4728 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } | 4728 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } |
(...skipping 2776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7505 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7505 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7506 }; | 7506 }; |
7507 | 7507 |
7508 | 7508 |
7509 #undef DECLARE_INSTRUCTION | 7509 #undef DECLARE_INSTRUCTION |
7510 #undef DECLARE_CONCRETE_INSTRUCTION | 7510 #undef DECLARE_CONCRETE_INSTRUCTION |
7511 | 7511 |
7512 } } // namespace v8::internal | 7512 } } // namespace v8::internal |
7513 | 7513 |
7514 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7514 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |