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 5148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5159 PREFILL_WITH_FILLER = 1 << 4 | 5159 PREFILL_WITH_FILLER = 1 << 4 |
5160 }; | 5160 }; |
5161 | 5161 |
5162 HAllocate(HValue* context, | 5162 HAllocate(HValue* context, |
5163 HValue* size, | 5163 HValue* size, |
5164 HType type, | 5164 HType type, |
5165 PretenureFlag pretenure_flag, | 5165 PretenureFlag pretenure_flag, |
5166 InstanceType instance_type) | 5166 InstanceType instance_type) |
5167 : HTemplateInstruction<2>(type), | 5167 : HTemplateInstruction<2>(type), |
5168 dominating_allocate_(NULL), | 5168 dominating_allocate_(NULL), |
5169 filler_free_space_size_(NULL) { | 5169 filler_free_space_size_(NULL), |
| 5170 clear_next_map_word_(false) { |
5170 SetOperandAt(0, context); | 5171 SetOperandAt(0, context); |
5171 SetOperandAt(1, size); | 5172 SetOperandAt(1, size); |
5172 set_representation(Representation::Tagged()); | 5173 set_representation(Representation::Tagged()); |
5173 SetFlag(kTrackSideEffectDominators); | 5174 SetFlag(kTrackSideEffectDominators); |
5174 SetGVNFlag(kChangesNewSpacePromotion); | 5175 SetGVNFlag(kChangesNewSpacePromotion); |
5175 SetGVNFlag(kDependsOnNewSpacePromotion); | 5176 SetGVNFlag(kDependsOnNewSpacePromotion); |
5176 flags_ = pretenure_flag == TENURED | 5177 flags_ = pretenure_flag == TENURED |
5177 ? (Heap::TargetSpaceId(instance_type) == OLD_POINTER_SPACE | 5178 ? (Heap::TargetSpaceId(instance_type) == OLD_POINTER_SPACE |
5178 ? ALLOCATE_IN_OLD_POINTER_SPACE : ALLOCATE_IN_OLD_DATA_SPACE) | 5179 ? ALLOCATE_IN_OLD_POINTER_SPACE : ALLOCATE_IN_OLD_DATA_SPACE) |
5179 : ALLOCATE_IN_NEW_SPACE; | 5180 : ALLOCATE_IN_NEW_SPACE; |
5180 if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) { | 5181 if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) { |
5181 flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED); | 5182 flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED); |
5182 } | 5183 } |
5183 // We have to fill the allocated object with one word fillers if we do | 5184 // We have to fill the allocated object with one word fillers if we do |
5184 // not use allocation folding since some allocations may depend on each | 5185 // not use allocation folding since some allocations may depend on each |
5185 // other, i.e., have a pointer to each other. A GC in between these | 5186 // other, i.e., have a pointer to each other. A GC in between these |
5186 // allocations may leave such objects behind in a not completely initialized | 5187 // allocations may leave such objects behind in a not completely initialized |
5187 // state. | 5188 // state. |
5188 if (!FLAG_use_gvn || !FLAG_use_allocation_folding) { | 5189 if (!FLAG_use_gvn || !FLAG_use_allocation_folding) { |
5189 flags_ = static_cast<HAllocate::Flags>(flags_ | PREFILL_WITH_FILLER); | 5190 flags_ = static_cast<HAllocate::Flags>(flags_ | PREFILL_WITH_FILLER); |
5190 } | 5191 } |
| 5192 clear_next_map_word_ = pretenure_flag == NOT_TENURED && |
| 5193 AllocationSite::CanTrack(instance_type); |
5191 } | 5194 } |
5192 | 5195 |
5193 void UpdateSize(HValue* size) { | 5196 void UpdateSize(HValue* size) { |
5194 SetOperandAt(1, size); | 5197 SetOperandAt(1, size); |
5195 } | 5198 } |
5196 | 5199 |
5197 HAllocate* GetFoldableDominator(HAllocate* dominator); | 5200 HAllocate* GetFoldableDominator(HAllocate* dominator); |
5198 | 5201 |
5199 void UpdateFreeSpaceFiller(int32_t filler_size); | 5202 void UpdateFreeSpaceFiller(int32_t filler_size); |
5200 | 5203 |
5201 void CreateFreeSpaceFiller(int32_t filler_size); | 5204 void CreateFreeSpaceFiller(int32_t filler_size); |
5202 | 5205 |
5203 bool IsFoldable(HAllocate* allocate) { | 5206 bool IsFoldable(HAllocate* allocate) { |
5204 return (IsNewSpaceAllocation() && allocate->IsNewSpaceAllocation()) || | 5207 return (IsNewSpaceAllocation() && allocate->IsNewSpaceAllocation()) || |
5205 (IsOldDataSpaceAllocation() && allocate->IsOldDataSpaceAllocation()) || | 5208 (IsOldDataSpaceAllocation() && allocate->IsOldDataSpaceAllocation()) || |
5206 (IsOldPointerSpaceAllocation() && | 5209 (IsOldPointerSpaceAllocation() && |
5207 allocate->IsOldPointerSpaceAllocation()); | 5210 allocate->IsOldPointerSpaceAllocation()); |
5208 } | 5211 } |
5209 | 5212 |
| 5213 void ClearNextMapWord(int offset); |
| 5214 |
5210 Flags flags_; | 5215 Flags flags_; |
5211 Handle<Map> known_initial_map_; | 5216 Handle<Map> known_initial_map_; |
5212 HAllocate* dominating_allocate_; | 5217 HAllocate* dominating_allocate_; |
5213 HStoreNamedField* filler_free_space_size_; | 5218 HStoreNamedField* filler_free_space_size_; |
| 5219 bool clear_next_map_word_; |
5214 }; | 5220 }; |
5215 | 5221 |
5216 | 5222 |
5217 class HStoreCodeEntry V8_FINAL: public HTemplateInstruction<2> { | 5223 class HStoreCodeEntry V8_FINAL: public HTemplateInstruction<2> { |
5218 public: | 5224 public: |
5219 static HStoreCodeEntry* New(Zone* zone, | 5225 static HStoreCodeEntry* New(Zone* zone, |
5220 HValue* context, | 5226 HValue* context, |
5221 HValue* function, | 5227 HValue* function, |
5222 HValue* code) { | 5228 HValue* code) { |
5223 return new(zone) HStoreCodeEntry(function, code); | 5229 return new(zone) HStoreCodeEntry(function, code); |
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6927 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 6933 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
6928 }; | 6934 }; |
6929 | 6935 |
6930 | 6936 |
6931 #undef DECLARE_INSTRUCTION | 6937 #undef DECLARE_INSTRUCTION |
6932 #undef DECLARE_CONCRETE_INSTRUCTION | 6938 #undef DECLARE_CONCRETE_INSTRUCTION |
6933 | 6939 |
6934 } } // namespace v8::internal | 6940 } } // namespace v8::internal |
6935 | 6941 |
6936 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6942 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |