OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_GREEDY_ALLOCATOR_H_ | 5 #ifndef V8_GREEDY_ALLOCATOR_H_ |
6 #define V8_GREEDY_ALLOCATOR_H_ | 6 #define V8_GREEDY_ALLOCATOR_H_ |
7 | 7 |
8 #include "src/compiler/coalesced-live-ranges.h" | 8 #include "src/compiler/coalesced-live-ranges.h" |
9 #include "src/compiler/register-allocator.h" | 9 #include "src/compiler/register-allocator.h" |
10 #include "src/zone-containers.h" | 10 #include "src/zone-containers.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 // Calculate the weight of a candidate for allocation. | 143 // Calculate the weight of a candidate for allocation. |
144 void EnsureValidRangeWeight(LiveRange* range); | 144 void EnsureValidRangeWeight(LiveRange* range); |
145 | 145 |
146 // Calculate the new weight of a range that is about to be allocated. | 146 // Calculate the new weight of a range that is about to be allocated. |
147 float GetAllocatedRangeWeight(float candidate_weight); | 147 float GetAllocatedRangeWeight(float candidate_weight); |
148 | 148 |
149 // Returns kInvalidWeight if there are no conflicts, or the largest weight of | 149 // Returns kInvalidWeight if there are no conflicts, or the largest weight of |
150 // a range conflicting with the given range, at the given register. | 150 // a range conflicting with the given range, at the given register. |
151 float GetMaximumConflictingWeight(unsigned reg_id, | 151 float GetMaximumConflictingWeight(unsigned reg_id, const LiveRange* range, |
152 const LiveRange* range) const; | 152 float competing_weight) const; |
153 | 153 |
154 // Returns kInvalidWeight if there are no conflicts, or the largest weight of | 154 // Returns kInvalidWeight if there are no conflicts, or the largest weight of |
155 // a range conflicting with the given range, at the given register. | 155 // a range conflicting with the given range, at the given register. |
156 float GetMaximumConflictingWeight(unsigned reg_id, | 156 float GetMaximumConflictingWeight(unsigned reg_id, |
157 const LiveRangeGroup* group, | 157 const LiveRangeGroup* group, |
158 float group_weight) const; | 158 float group_weight) const; |
159 | 159 |
160 // This is the extension point for splitting heuristics. | 160 // This is the extension point for splitting heuristics. |
161 void SplitOrSpillBlockedRange(LiveRange* range); | 161 void SplitOrSpillBlockedRange(LiveRange* range); |
162 | 162 |
(...skipping 25 matching lines...) Expand all Loading... |
188 ZoneVector<CoalescedLiveRanges*> allocations_; | 188 ZoneVector<CoalescedLiveRanges*> allocations_; |
189 AllocationScheduler scheduler_; | 189 AllocationScheduler scheduler_; |
190 ZoneVector<LiveRangeGroup*> groups_; | 190 ZoneVector<LiveRangeGroup*> groups_; |
191 | 191 |
192 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator); | 192 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator); |
193 }; | 193 }; |
194 } // namespace compiler | 194 } // namespace compiler |
195 } // namespace internal | 195 } // namespace internal |
196 } // namespace v8 | 196 } // namespace v8 |
197 #endif // V8_GREEDY_ALLOCATOR_H_ | 197 #endif // V8_GREEDY_ALLOCATOR_H_ |
OLD | NEW |