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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // call" portion. | 178 // call" portion. |
179 // - the portion after the call. | 179 // - the portion after the call. |
180 LiveRange* GetRemainderAfterSplittingAroundFirstCall(LiveRange* range); | 180 LiveRange* GetRemainderAfterSplittingAroundFirstCall(LiveRange* range); |
181 | 181 |
182 // While we attempt to merge spill ranges later on in the allocation pipeline, | 182 // While we attempt to merge spill ranges later on in the allocation pipeline, |
183 // we want to ensure group elements get merged. Waiting until later may hinder | 183 // we want to ensure group elements get merged. Waiting until later may hinder |
184 // merge-ability, since the pipeline merger (being naive) may create conflicts | 184 // merge-ability, since the pipeline merger (being naive) may create conflicts |
185 // between spill ranges of group members. | 185 // between spill ranges of group members. |
186 void TryReuseSpillRangesForGroups(); | 186 void TryReuseSpillRangesForGroups(); |
187 | 187 |
| 188 LifetimePosition GetLastResortSplitPosition(const LiveRange* range); |
| 189 |
| 190 bool IsProgressPossible(const LiveRange* range); |
| 191 |
188 // Necessary heuristic: spill when all else failed. | 192 // Necessary heuristic: spill when all else failed. |
189 void SpillRangeAsLastResort(LiveRange* range); | 193 void SpillRangeAsLastResort(LiveRange* range); |
190 | 194 |
191 void AssignRangeToRegister(int reg_id, LiveRange* range); | 195 void AssignRangeToRegister(int reg_id, LiveRange* range); |
192 | 196 |
193 Zone* local_zone_; | 197 Zone* local_zone_; |
194 ZoneVector<CoalescedLiveRanges*> allocations_; | 198 ZoneVector<CoalescedLiveRanges*> allocations_; |
195 AllocationScheduler scheduler_; | 199 AllocationScheduler scheduler_; |
196 ZoneVector<LiveRangeGroup*> groups_; | 200 ZoneVector<LiveRangeGroup*> groups_; |
197 | 201 |
198 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator); | 202 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator); |
199 }; | 203 }; |
200 } // namespace compiler | 204 } // namespace compiler |
201 } // namespace internal | 205 } // namespace internal |
202 } // namespace v8 | 206 } // namespace v8 |
203 #endif // V8_GREEDY_ALLOCATOR_H_ | 207 #endif // V8_GREEDY_ALLOCATOR_H_ |
OLD | NEW |