From f1a6e5e79b3f402f3a3744c8fe431dfe18a0fd51 Mon Sep 17 00:00:00 2001 From: mtrofin Date: Sun, 4 Sep 2016 21:06:15 -0700 Subject: [PATCH] [turbofan] Readjust has_slot_use after splintering has_slot_use is computed early, and we need it to determine if we need to generate SpillRanges. After splintering, however, the information may be incorrect - e.g. just the splinter may have slot uses, and not the original. BUG= Review-Url: https://codereview.chromium.org/2312523002 Cr-Commit-Position: refs/heads/master@{#39147} --- src/compiler/live-range-separator.cc | 16 ++++++++++++++++ src/compiler/register-allocator.cc | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/compiler/live-range-separator.cc b/src/compiler/live-range-separator.cc index e3cd0a3137..db65593906 100644 --- a/src/compiler/live-range-separator.cc +++ b/src/compiler/live-range-separator.cc @@ -58,6 +58,15 @@ void CreateSplinter(TopLevelLiveRange *range, RegisterAllocationData *data, } } +void SetSlotUse(TopLevelLiveRange *range) { + range->set_has_slot_use(false); + for (const UsePosition *pos = range->first_pos(); + !range->has_slot_use() && pos != nullptr; pos = pos->next()) { + if (pos->type() == UsePositionType::kRequiresSlot) { + range->set_has_slot_use(true); + } + } +} void SplinterLiveRange(TopLevelLiveRange *range, RegisterAllocationData *data) { const InstructionSequence *code = data->code(); @@ -99,7 +108,14 @@ void SplinterLiveRange(TopLevelLiveRange *range, RegisterAllocationData *data) { if (first_cut.IsValid()) { CreateSplinter(range, data, first_cut, last_cut); } + + // Redo has_slot_use + if (range->has_slot_use() && range->splinter() != nullptr) { + SetSlotUse(range); + SetSlotUse(range->splinter()); + } } + } // namespace diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc index d171502cc9..fb4d7f9aa1 100644 --- a/src/compiler/register-allocator.cc +++ b/src/compiler/register-allocator.cc @@ -1041,6 +1041,8 @@ void TopLevelLiveRange::Merge(TopLevelLiveRange* other, Zone* zone) { TopLevel()->UpdateParentForAllChildren(TopLevel()); TopLevel()->UpdateSpillRangePostMerge(other); + TopLevel()->set_has_slot_use(TopLevel()->has_slot_use() || + other->has_slot_use()); #if DEBUG Verify();