| 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 3744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3755 } | 3755 } |
| 3756 | 3756 |
| 3757 bool RightIsPowerOf2() { | 3757 bool RightIsPowerOf2() { |
| 3758 if (!right()->IsInteger32Constant()) return false; | 3758 if (!right()->IsInteger32Constant()) return false; |
| 3759 int32_t value = right()->GetInteger32Constant(); | 3759 int32_t value = right()->GetInteger32Constant(); |
| 3760 return value != 0 && (IsPowerOf2(value) || IsPowerOf2(-value)); | 3760 return value != 0 && (IsPowerOf2(value) || IsPowerOf2(-value)); |
| 3761 } | 3761 } |
| 3762 | 3762 |
| 3763 DECLARE_ABSTRACT_INSTRUCTION(BinaryOperation) | 3763 DECLARE_ABSTRACT_INSTRUCTION(BinaryOperation) |
| 3764 | 3764 |
| 3765 protected: |
| 3766 Range* InferRangeForDiv(Zone* zone); |
| 3767 |
| 3765 private: | 3768 private: |
| 3766 bool IgnoreObservedOutputRepresentation(Representation current_rep); | 3769 bool IgnoreObservedOutputRepresentation(Representation current_rep); |
| 3767 | 3770 |
| 3768 Representation observed_input_representation_[2]; | 3771 Representation observed_input_representation_[2]; |
| 3769 Representation observed_output_representation_; | 3772 Representation observed_output_representation_; |
| 3770 }; | 3773 }; |
| 3771 | 3774 |
| 3772 | 3775 |
| 3773 class HWrapReceiver V8_FINAL : public HTemplateInstruction<2> { | 3776 class HWrapReceiver V8_FINAL : public HTemplateInstruction<2> { |
| 3774 public: | 3777 public: |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4095 | 4098 |
| 4096 protected: | 4099 protected: |
| 4097 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } | 4100 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } |
| 4098 | 4101 |
| 4099 private: | 4102 private: |
| 4100 HMathFloorOfDiv(HValue* context, HValue* left, HValue* right) | 4103 HMathFloorOfDiv(HValue* context, HValue* left, HValue* right) |
| 4101 : HBinaryOperation(context, left, right) { | 4104 : HBinaryOperation(context, left, right) { |
| 4102 set_representation(Representation::Integer32()); | 4105 set_representation(Representation::Integer32()); |
| 4103 SetFlag(kUseGVN); | 4106 SetFlag(kUseGVN); |
| 4104 SetFlag(kCanOverflow); | 4107 SetFlag(kCanOverflow); |
| 4105 if (!right->IsConstant()) { | 4108 SetFlag(kCanBeDivByZero); |
| 4106 SetFlag(kCanBeDivByZero); | |
| 4107 } | |
| 4108 SetFlag(kAllowUndefinedAsNaN); | 4109 SetFlag(kAllowUndefinedAsNaN); |
| 4109 } | 4110 } |
| 4110 | 4111 |
| 4112 virtual Range* InferRange(Zone* zone) V8_OVERRIDE; |
| 4113 |
| 4111 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 4114 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 4112 }; | 4115 }; |
| 4113 | 4116 |
| 4114 | 4117 |
| 4115 class HArithmeticBinaryOperation : public HBinaryOperation { | 4118 class HArithmeticBinaryOperation : public HBinaryOperation { |
| 4116 public: | 4119 public: |
| 4117 HArithmeticBinaryOperation(HValue* context, HValue* left, HValue* right) | 4120 HArithmeticBinaryOperation(HValue* context, HValue* left, HValue* right) |
| 4118 : HBinaryOperation(context, left, right, HType::TaggedNumber()) { | 4121 : HBinaryOperation(context, left, right, HType::TaggedNumber()) { |
| 4119 SetAllSideEffects(); | 4122 SetAllSideEffects(); |
| 4120 SetFlag(kFlexibleRepresentation); | 4123 SetFlag(kFlexibleRepresentation); |
| (...skipping 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7516 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7519 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7517 }; | 7520 }; |
| 7518 | 7521 |
| 7519 | 7522 |
| 7520 #undef DECLARE_INSTRUCTION | 7523 #undef DECLARE_INSTRUCTION |
| 7521 #undef DECLARE_CONCRETE_INSTRUCTION | 7524 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7522 | 7525 |
| 7523 } } // namespace v8::internal | 7526 } } // namespace v8::internal |
| 7524 | 7527 |
| 7525 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7528 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |