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 5130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5141 HValue* dominator) { | 5141 HValue* dominator) { |
5142 // There may be multiple inner allocates dominated by one allocate. | 5142 // There may be multiple inner allocates dominated by one allocate. |
5143 while (object->IsInnerAllocatedObject()) { | 5143 while (object->IsInnerAllocatedObject()) { |
5144 object = HInnerAllocatedObject::cast(object)->base_object(); | 5144 object = HInnerAllocatedObject::cast(object)->base_object(); |
5145 } | 5145 } |
5146 | 5146 |
5147 if (object->IsAllocate()) { | 5147 if (object->IsAllocate()) { |
5148 HAllocate* allocate = HAllocate::cast(object); | 5148 HAllocate* allocate = HAllocate::cast(object); |
5149 if (allocate->IsAllocationFolded()) { | 5149 if (allocate->IsAllocationFolded()) { |
5150 HValue* dominator = allocate->allocation_folding_dominator(); | 5150 HValue* dominator = allocate->allocation_folding_dominator(); |
5151 DCHECK(HAllocate::cast(dominator)->IsAllocationFoldingDominator()); | 5151 // There is no guarantee that all allocations are folded together because |
5152 object = dominator; | 5152 // GVN performs a fixpoint. |
| 5153 if (HAllocate::cast(dominator)->IsAllocationFoldingDominator()) { |
| 5154 object = dominator; |
| 5155 } |
5153 } | 5156 } |
5154 } | 5157 } |
5155 | 5158 |
5156 if (object->IsConstant() && | 5159 if (object->IsConstant() && |
5157 HConstant::cast(object)->HasExternalReferenceValue()) { | 5160 HConstant::cast(object)->HasExternalReferenceValue()) { |
5158 // Stores to external references require no write barriers | 5161 // Stores to external references require no write barriers |
5159 return false; | 5162 return false; |
5160 } | 5163 } |
5161 // We definitely need a write barrier unless the object is the allocation | 5164 // We definitely need a write barrier unless the object is the allocation |
5162 // dominator. | 5165 // dominator. |
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7204 bool IsDeletable() const override { return true; } | 7207 bool IsDeletable() const override { return true; } |
7205 }; | 7208 }; |
7206 | 7209 |
7207 #undef DECLARE_INSTRUCTION | 7210 #undef DECLARE_INSTRUCTION |
7208 #undef DECLARE_CONCRETE_INSTRUCTION | 7211 #undef DECLARE_CONCRETE_INSTRUCTION |
7209 | 7212 |
7210 } // namespace internal | 7213 } // namespace internal |
7211 } // namespace v8 | 7214 } // namespace v8 |
7212 | 7215 |
7213 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 7216 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |