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

Unified Diff: src/compiler/register-allocator.cc

Issue 1824303002: check if we can split (linear scan) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/register-allocator.h ('k') | src/compiler/wasm-linkage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.cc
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc
index 82faf752427de95a819c9e686810bae99fe2b6e3..0368380b8cdf93fb4ea8976ad35e6ea07247559e 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -2947,9 +2947,13 @@ void LinearScanAllocator::AllocateBlockedReg(LiveRange* current) {
LifetimePosition pos = use_pos[reg];
if (pos < register_use->pos()) {
- // All registers are blocked before the first use that requires a register.
- // Spill starting part of live range up to that use.
- SpillBetween(current, current->Start(), register_use->pos());
+ if (LifetimePosition::ExistsGapPositionBetween(current->Start(),
+ register_use->pos())) {
+ SpillBetween(current, current->Start(), register_use->pos());
+ } else {
+ SetLiveRangeAssignedRegister(current, reg);
+ SplitAndSpillIntersecting(current);
+ }
return;
}
@@ -2994,6 +2998,8 @@ void LinearScanAllocator::SplitAndSpillIntersecting(LiveRange* current) {
// live-ranges: ranges are allocated in order of their start positions,
// ranges are retired from active/inactive when the start of the
// current live-range is larger than their end.
+ DCHECK(LifetimePosition::ExistsGapPositionBetween(current->Start(),
+ next_pos->pos()));
SpillBetweenUntil(range, spill_pos, current->Start(), next_pos->pos());
}
ActiveToHandled(range);
« no previous file with comments | « src/compiler/register-allocator.h ('k') | src/compiler/wasm-linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698