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

Unified Diff: src/compiler/live-range-separator.cc

Issue 1311983002: [turbofan] Separate LiveRange and TopLevelLiveRange concepts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/greedy-allocator.cc ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/live-range-separator.cc
diff --git a/src/compiler/live-range-separator.cc b/src/compiler/live-range-separator.cc
index 94b159787c368c224f64515642c343f978e4995b..47116b9a2d25c901f9e7a3090b990fc04ebbb396 100644
--- a/src/compiler/live-range-separator.cc
+++ b/src/compiler/live-range-separator.cc
@@ -66,9 +66,8 @@ bool IsIntervalAlreadyExcluded(const LiveRange *range, LifetimePosition start,
}
-void CreateSplinter(LiveRange *range, RegisterAllocationData *data,
+void CreateSplinter(TopLevelLiveRange *range, RegisterAllocationData *data,
LifetimePosition first_cut, LifetimePosition last_cut) {
- DCHECK(!range->IsChild());
DCHECK(!range->IsSplinter());
// We can ignore ranges that live solely in deferred blocks.
// If a range ends right at the end of a deferred block, it is marked by
@@ -94,7 +93,10 @@ void CreateSplinter(LiveRange *range, RegisterAllocationData *data,
if (range->MayRequireSpillRange()) {
data->CreateSpillRangeForLiveRange(range);
}
- LiveRange *result = data->NewChildRangeFor(range);
+ TopLevelLiveRange *result = data->NextLiveRange(range->machine_type());
+ DCHECK_NULL(data->live_ranges()[result->vreg()]);
+ data->live_ranges()[result->vreg()] = result;
+
Zone *zone = data->allocation_zone();
range->Splinter(start, end, result, zone);
}
@@ -138,7 +140,7 @@ void SplinterRangesInDeferredBlocks(RegisterAllocationData *data) {
int range_id = iterator.Current();
iterator.Advance();
- LiveRange *range = data->live_ranges()[range_id];
+ TopLevelLiveRange *range = data->live_ranges()[range_id];
CreateSplinter(range, data, first_cut, last_cut);
}
}
@@ -155,12 +157,11 @@ void LiveRangeSeparator::Splinter() {
void LiveRangeMerger::Merge() {
int live_range_count = static_cast<int>(data()->live_ranges().size());
for (int i = 0; i < live_range_count; ++i) {
- LiveRange *range = data()->live_ranges()[i];
- if (range == nullptr || range->IsEmpty() || range->IsChild() ||
- !range->IsSplinter()) {
+ TopLevelLiveRange *range = data()->live_ranges()[i];
+ if (range == nullptr || range->IsEmpty() || !range->IsSplinter()) {
continue;
}
- LiveRange *splinter_parent = range->splintered_from();
+ TopLevelLiveRange *splinter_parent = range->splintered_from();
splinter_parent->Merge(range, data());
}
« no previous file with comments | « src/compiler/greedy-allocator.cc ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698