Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: src/compiler/greedy-allocator.h

Issue 1328783002: [turbofan] Greedy: split around calls heuristic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/greedy-allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 float GetAllocatedRangeWeight(float candidate_weight); 118 float GetAllocatedRangeWeight(float candidate_weight);
119 119
120 // Returns kInvalidWeight if there are no conflicts, or the largest weight of 120 // Returns kInvalidWeight if there are no conflicts, or the largest weight of
121 // a range conflicting with the given range, at the given register. 121 // a range conflicting with the given range, at the given register.
122 float GetMaximumConflictingWeight(unsigned reg_id, 122 float GetMaximumConflictingWeight(unsigned reg_id,
123 const LiveRange* range) const; 123 const LiveRange* range) const;
124 124
125 // This is the extension point for splitting heuristics. 125 // This is the extension point for splitting heuristics.
126 void SplitOrSpillBlockedRange(LiveRange* range); 126 void SplitOrSpillBlockedRange(LiveRange* range);
127 127
128 // Find a good position where to fill, after a range was spilled after a call.
129 LifetimePosition FindSplitPositionAfterCall(const LiveRange* range,
130 int call_index);
131 // Split a range around all calls it passes over. Returns true if any changes
132 // were made, or false if no calls were found.
133 bool TrySplitAroundCalls(LiveRange* range);
134
135 // Finds the first call instruction in the path of this range. Splits before
136 // and requeues that segment (if any), spills the section over the call, and
137 // returns the section after the call. The return is:
138 // - same range, if no call was found
139 // - nullptr, if the range finished at the call and there's no "after the
140 // call" portion.
141 // - the portion after the call.
142 LiveRange* GetRemainderAfterSplittingAroundFirstCall(LiveRange* range);
143
128 // Necessary heuristic: spill when all else failed. 144 // Necessary heuristic: spill when all else failed.
129 void SpillRangeAsLastResort(LiveRange* range); 145 void SpillRangeAsLastResort(LiveRange* range);
130 146
131 void AssignRangeToRegister(int reg_id, LiveRange* range); 147 void AssignRangeToRegister(int reg_id, LiveRange* range);
132 148
133 Zone* local_zone_; 149 Zone* local_zone_;
134 ZoneVector<CoalescedLiveRanges*> allocations_; 150 ZoneVector<CoalescedLiveRanges*> allocations_;
135 AllocationScheduler scheduler_; 151 AllocationScheduler scheduler_;
136 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator); 152 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator);
137 }; 153 };
138 } // namespace compiler 154 } // namespace compiler
139 } // namespace internal 155 } // namespace internal
140 } // namespace v8 156 } // namespace v8
141 #endif // V8_GREEDY_ALLOCATOR_H_ 157 #endif // V8_GREEDY_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/greedy-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698