Commit 2f27911b authored by mtrofin's avatar mtrofin Committed by Commit bot

[turbofan] Break dependency on RegisterAllocationData from Merge.

Found this while working on the unit tests for split/splinter/merge. The
dependency is unnecessary and hinders testability.

BUG=

Review URL: https://codereview.chromium.org/1325453005

Cr-Commit-Position: refs/heads/master@{#30465}
parent 0526e102
......@@ -153,7 +153,9 @@ void LiveRangeMerger::Merge() {
}
TopLevelLiveRange *splinter_parent = range->splintered_from();
splinter_parent->Merge(range, data());
int to_remove = range->vreg();
splinter_parent->Merge(range, data()->allocation_zone());
data()->live_ranges()[to_remove] = nullptr;
}
}
......
......@@ -897,13 +897,10 @@ void TopLevelLiveRange::UpdateSpillRangePostMerge(TopLevelLiveRange* merged) {
}
void TopLevelLiveRange::Merge(TopLevelLiveRange* other,
RegisterAllocationData* data) {
void TopLevelLiveRange::Merge(TopLevelLiveRange* other, Zone* zone) {
DCHECK(Start() < other->Start());
DCHECK(other->splintered_from() == this);
data->live_ranges()[other->vreg()] = nullptr;
LiveRange* last_other = other->last_child();
LiveRange* last_me = last_child();
......@@ -929,8 +926,7 @@ void TopLevelLiveRange::Merge(TopLevelLiveRange* other,
// register allocation splitting.
LiveRange* after = last_insertion_point_->next();
if (last_insertion_point_->End() > other->Start()) {
LiveRange* new_after =
last_insertion_point_->SplitAt(other->Start(), data->allocation_zone());
LiveRange* new_after = last_insertion_point_->SplitAt(other->Start(), zone);
new_after->set_spilled(last_insertion_point_->spilled());
if (!new_after->spilled())
new_after->set_assigned_register(
......
......@@ -471,7 +471,7 @@ class TopLevelLiveRange final : public LiveRange {
// Assuming other was splintered from this range, embeds other and its
// children as part of the children sequence of this range.
void Merge(TopLevelLiveRange* other, RegisterAllocationData* data);
void Merge(TopLevelLiveRange* other, Zone* zone);
// Spill range management.
void SetSpillRange(SpillRange* spill_range);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment