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 4946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4957 bool for_typeof_; | 4957 bool for_typeof_; |
4958 }; | 4958 }; |
4959 | 4959 |
4960 | 4960 |
4961 class HAllocate: public HTemplateInstruction<2> { | 4961 class HAllocate: public HTemplateInstruction<2> { |
4962 public: | 4962 public: |
4963 enum Flags { | 4963 enum Flags { |
4964 CAN_ALLOCATE_IN_NEW_SPACE = 1 << 0, | 4964 CAN_ALLOCATE_IN_NEW_SPACE = 1 << 0, |
4965 CAN_ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1, | 4965 CAN_ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1, |
4966 CAN_ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2, | 4966 CAN_ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2, |
4967 ALLOCATE_DOUBLE_ALIGNED = 1 << 3 | 4967 ALLOCATE_DOUBLE_ALIGNED = 1 << 3, |
| 4968 PREFILL_WITH_FILLER = 1 << 4 |
4968 }; | 4969 }; |
4969 | 4970 |
4970 HAllocate(HValue* context, HValue* size, HType type, Flags flags) | 4971 HAllocate(HValue* context, HValue* size, HType type, Flags flags) |
4971 : type_(type), | 4972 : type_(type), |
4972 flags_(flags) { | 4973 flags_(flags) { |
4973 SetOperandAt(0, context); | 4974 SetOperandAt(0, context); |
4974 SetOperandAt(1, size); | 4975 SetOperandAt(1, size); |
4975 set_representation(Representation::Tagged()); | 4976 set_representation(Representation::Tagged()); |
4976 SetFlag(kTrackSideEffectDominators); | 4977 SetFlag(kTrackSideEffectDominators); |
4977 SetGVNFlag(kChangesNewSpacePromotion); | 4978 SetGVNFlag(kChangesNewSpacePromotion); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5034 } | 5035 } |
5035 | 5036 |
5036 bool GuaranteedInNewSpace() const { | 5037 bool GuaranteedInNewSpace() const { |
5037 return CanAllocateInNewSpace() && !CanAllocateInOldSpace(); | 5038 return CanAllocateInNewSpace() && !CanAllocateInOldSpace(); |
5038 } | 5039 } |
5039 | 5040 |
5040 bool MustAllocateDoubleAligned() const { | 5041 bool MustAllocateDoubleAligned() const { |
5041 return (flags_ & ALLOCATE_DOUBLE_ALIGNED) != 0; | 5042 return (flags_ & ALLOCATE_DOUBLE_ALIGNED) != 0; |
5042 } | 5043 } |
5043 | 5044 |
| 5045 bool MustPrefillWithFiller() const { |
| 5046 return (flags_ & PREFILL_WITH_FILLER) != 0; |
| 5047 } |
| 5048 |
| 5049 void SetFlags(Flags flags) { |
| 5050 flags_ = static_cast<HAllocate::Flags>(flags_ | flags); |
| 5051 } |
| 5052 |
5044 void UpdateSize(HValue* size) { | 5053 void UpdateSize(HValue* size) { |
5045 SetOperandAt(1, size); | 5054 SetOperandAt(1, size); |
5046 } | 5055 } |
5047 | 5056 |
5048 virtual void HandleSideEffectDominator(GVNFlag side_effect, | 5057 virtual void HandleSideEffectDominator(GVNFlag side_effect, |
5049 HValue* dominator); | 5058 HValue* dominator); |
5050 | 5059 |
5051 virtual void PrintDataTo(StringStream* stream); | 5060 virtual void PrintDataTo(StringStream* stream); |
5052 | 5061 |
5053 DECLARE_CONCRETE_INSTRUCTION(Allocate) | 5062 DECLARE_CONCRETE_INSTRUCTION(Allocate) |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6681 virtual bool IsDeletable() const { return true; } | 6690 virtual bool IsDeletable() const { return true; } |
6682 }; | 6691 }; |
6683 | 6692 |
6684 | 6693 |
6685 #undef DECLARE_INSTRUCTION | 6694 #undef DECLARE_INSTRUCTION |
6686 #undef DECLARE_CONCRETE_INSTRUCTION | 6695 #undef DECLARE_CONCRETE_INSTRUCTION |
6687 | 6696 |
6688 } } // namespace v8::internal | 6697 } } // namespace v8::internal |
6689 | 6698 |
6690 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6699 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |