Lines Matching refs:range

571     LiveRange* range = LiveRangeFor(operand_index);  in AddInitialIntervals()  local
572 range->AddUseInterval(start, end, zone()); in AddInitialIntervals()
677 LiveRange* range = LiveRangeFor(operand); in Define() local
678 if (range == NULL) return; in Define()
680 if (range->IsEmpty() || range->Start().Value() > position.Value()) { in Define()
682 range->AddUseInterval(position, position.NextInstruction(), zone()); in Define()
683 range->AddUsePosition(position.NextInstruction(), NULL, NULL, zone()); in Define()
685 range->ShortenTo(position); in Define()
690 range->AddUsePosition(position, unalloc_operand, hint, zone()); in Define()
699 LiveRange* range = LiveRangeFor(operand); in Use() local
700 if (range == NULL) return; in Use()
703 range->AddUsePosition(position, unalloc_operand, hint, zone()); in Use()
705 range->AddUseInterval(block_start, position, zone()); in Use()
764 LiveRange* range = LiveRangeFor(output_vreg); in MeetRegisterConstraintsForLastInstructionInBlock() local
770 range->SetSpillOperand(output); in MeetRegisterConstraintsForLastInstructionInBlock()
771 range->SetSpillStartIndex(end); in MeetRegisterConstraintsForLastInstructionInBlock()
798 range->SetSpillStartIndex(gap_index); in MeetRegisterConstraintsForLastInstructionInBlock()
807 move->AddMove(output, range->GetSpillOperand(), code_zone()); in MeetRegisterConstraintsForLastInstructionInBlock()
831 LiveRange* range = LiveRangeFor(output_vreg); in MeetConstraintsBetween() local
832 range->SetSpillStartIndex(gap_index - 1); in MeetConstraintsBetween()
833 range->SetSpillOperand(output); in MeetConstraintsBetween()
836 LiveRange* range = LiveRangeFor(first_output->virtual_register()); in MeetConstraintsBetween() local
846 range->SetSpillOperand(first_output); in MeetConstraintsBetween()
847 range->SetSpillStartIndex(gap_index - 1); in MeetConstraintsBetween()
856 range->SetSpillStartIndex(gap_index); in MeetConstraintsBetween()
865 move->AddMove(first_output, range->GetSpillOperand(), code_zone()); in MeetConstraintsBetween()
1011 LiveRange* range = FixedLiveRangeFor(i); in ProcessInstructions() local
1012 range->AddUseInterval(curr_position, curr_position.InstructionEnd(), in ProcessInstructions()
1021 LiveRange* range = FixedDoubleLiveRangeFor(i); in ProcessInstructions() local
1022 range->AddUseInterval(curr_position, curr_position.InstructionEnd(), in ProcessInstructions()
1150 void RegisterAllocator::ResolveControlFlow(LiveRange* range, BasicBlock* block, in ResolveControlFlow() argument
1158 LiveRange* cur_range = range; in ResolveControlFlow()
1345 LiveRange* range = LiveRangeFor(operand_index); in BuildLiveRanges() local
1346 range->EnsureInterval(start, end, zone()); in BuildLiveRanges()
1365 LiveRange* range = LiveRangeFor(operand_index); in BuildLiveRanges() local
1366 PrintF(" (first use is at %d)\n", range->first_pos()->pos().Value()); in BuildLiveRanges()
1396 LiveRange* range = live_ranges_[i]; in BuildLiveRanges() local
1397 if (range->HasAllocatedSpillOperand() && in BuildLiveRanges()
1398 range->GetSpillOperand()->IsConstant()) { in BuildLiveRanges()
1399 for (UsePosition* pos = range->first_pos(); pos != NULL; in BuildLiveRanges()
1434 LiveRange* range = live_ranges()->at(range_idx); in PopulatePointerMaps() local
1435 if (range == NULL) continue; in PopulatePointerMaps()
1437 if (range->parent() != NULL) continue; in PopulatePointerMaps()
1439 if (!HasTaggedValue(range->id())) continue; in PopulatePointerMaps()
1441 if (range->IsEmpty()) continue; in PopulatePointerMaps()
1444 int start = range->Start().InstructionIndex(); in PopulatePointerMaps()
1446 for (LiveRange* cur = range; cur != NULL; cur = cur->next()) { in PopulatePointerMaps()
1477 LiveRange* cur = range; in PopulatePointerMaps()
1485 if (range->HasAllocatedSpillOperand() && in PopulatePointerMaps()
1486 safe_point >= range->spill_start_index() && in PopulatePointerMaps()
1487 !range->GetSpillOperand()->IsConstant()) { in PopulatePointerMaps()
1489 range->id(), range->spill_start_index(), safe_point); in PopulatePointerMaps()
1490 map->RecordPointer(range->GetSpillOperand(), code_zone()); in PopulatePointerMaps()
1663 void RegisterAllocator::AddToActive(LiveRange* range) { in AddToActive() argument
1664 TraceAlloc("Add live range %d to active\n", range->id()); in AddToActive()
1665 active_live_ranges_.Add(range, zone()); in AddToActive()
1669 void RegisterAllocator::AddToInactive(LiveRange* range) { in AddToInactive() argument
1670 TraceAlloc("Add live range %d to inactive\n", range->id()); in AddToInactive()
1671 inactive_live_ranges_.Add(range, zone()); in AddToInactive()
1675 void RegisterAllocator::AddToUnhandledSorted(LiveRange* range) { in AddToUnhandledSorted() argument
1676 if (range == NULL || range->IsEmpty()) return; in AddToUnhandledSorted()
1677 DCHECK(!range->HasRegisterAssigned() && !range->IsSpilled()); in AddToUnhandledSorted()
1678 DCHECK(allocation_finger_.Value() <= range->Start().Value()); in AddToUnhandledSorted()
1681 if (range->ShouldBeAllocatedBefore(cur_range)) { in AddToUnhandledSorted()
1682 TraceAlloc("Add live range %d to unhandled at %d\n", range->id(), i + 1); in AddToUnhandledSorted()
1683 unhandled_live_ranges_.InsertAt(i + 1, range, zone()); in AddToUnhandledSorted()
1688 TraceAlloc("Add live range %d to unhandled at start\n", range->id()); in AddToUnhandledSorted()
1689 unhandled_live_ranges_.InsertAt(0, range, zone()); in AddToUnhandledSorted()
1694 void RegisterAllocator::AddToUnhandledUnsorted(LiveRange* range) { in AddToUnhandledUnsorted() argument
1695 if (range == NULL || range->IsEmpty()) return; in AddToUnhandledUnsorted()
1696 DCHECK(!range->HasRegisterAssigned() && !range->IsSpilled()); in AddToUnhandledUnsorted()
1697 TraceAlloc("Add live range %d to unhandled unsorted at end\n", range->id()); in AddToUnhandledUnsorted()
1698 unhandled_live_ranges_.Add(range, zone()); in AddToUnhandledUnsorted()
1731 void RegisterAllocator::FreeSpillSlot(LiveRange* range) { in FreeSpillSlot() argument
1733 if (range->next() != NULL) return; in FreeSpillSlot()
1735 if (!range->TopLevel()->HasAllocatedSpillOperand()) return; in FreeSpillSlot()
1737 InstructionOperand* spill_operand = range->TopLevel()->GetSpillOperand(); in FreeSpillSlot()
1740 reusable_slots_.Add(range, zone()); in FreeSpillSlot()
1745 InstructionOperand* RegisterAllocator::TryReuseSpillSlot(LiveRange* range) { in TryReuseSpillSlot() argument
1748 range->TopLevel()->Start().Value()) { in TryReuseSpillSlot()
1758 void RegisterAllocator::ActiveToHandled(LiveRange* range) { in ActiveToHandled() argument
1759 DCHECK(active_live_ranges_.Contains(range)); in ActiveToHandled()
1760 active_live_ranges_.RemoveElement(range); in ActiveToHandled()
1761 TraceAlloc("Moving live range %d from active to handled\n", range->id()); in ActiveToHandled()
1762 FreeSpillSlot(range); in ActiveToHandled()
1766 void RegisterAllocator::ActiveToInactive(LiveRange* range) { in ActiveToInactive() argument
1767 DCHECK(active_live_ranges_.Contains(range)); in ActiveToInactive()
1768 active_live_ranges_.RemoveElement(range); in ActiveToInactive()
1769 inactive_live_ranges_.Add(range, zone()); in ActiveToInactive()
1770 TraceAlloc("Moving live range %d from active to inactive\n", range->id()); in ActiveToInactive()
1774 void RegisterAllocator::InactiveToHandled(LiveRange* range) { in InactiveToHandled() argument
1775 DCHECK(inactive_live_ranges_.Contains(range)); in InactiveToHandled()
1776 inactive_live_ranges_.RemoveElement(range); in InactiveToHandled()
1777 TraceAlloc("Moving live range %d from inactive to handled\n", range->id()); in InactiveToHandled()
1778 FreeSpillSlot(range); in InactiveToHandled()
1782 void RegisterAllocator::InactiveToActive(LiveRange* range) { in InactiveToActive() argument
1783 DCHECK(inactive_live_ranges_.Contains(range)); in InactiveToActive()
1784 inactive_live_ranges_.RemoveElement(range); in InactiveToActive()
1785 active_live_ranges_.Add(range, zone()); in InactiveToActive()
1786 TraceAlloc("Moving live range %d from inactive to active\n", range->id()); in InactiveToActive()
1889 LiveRange* range = active_live_ranges_[i]; in AllocateBlockedReg() local
1890 int cur_reg = range->assigned_register(); in AllocateBlockedReg()
1891 if (range->IsFixed() || !range->CanBeSpilled(current->Start())) { in AllocateBlockedReg()
1896 range->NextUsePositionRegisterIsBeneficial(current->Start()); in AllocateBlockedReg()
1898 use_pos[cur_reg] = range->End(); in AllocateBlockedReg()
1906 LiveRange* range = inactive_live_ranges_.at(i); in AllocateBlockedReg() local
1907 DCHECK(range->End().Value() > current->Start().Value()); in AllocateBlockedReg()
1908 LifetimePosition next_intersection = range->FirstIntersection(current); in AllocateBlockedReg()
1910 int cur_reg = range->assigned_register(); in AllocateBlockedReg()
1911 if (range->IsFixed()) { in AllocateBlockedReg()
1958 LiveRange* range, LifetimePosition pos) { in FindOptimalSpillingPos() argument
1965 UsePosition* prev_use = range->PreviousUsePositionRegisterIsBeneficial(pos); in FindOptimalSpillingPos()
1974 if (range->Covers(loop_start)) { in FindOptimalSpillingPos()
1994 LiveRange* range = active_live_ranges_[i]; in SplitAndSpillIntersecting() local
1995 if (range->assigned_register() == reg) { in SplitAndSpillIntersecting()
1996 UsePosition* next_pos = range->NextRegisterPosition(current->Start()); in SplitAndSpillIntersecting()
1997 LifetimePosition spill_pos = FindOptimalSpillingPos(range, split_pos); in SplitAndSpillIntersecting()
1999 SpillAfter(range, spill_pos); in SplitAndSpillIntersecting()
2009 SpillBetweenUntil(range, spill_pos, current->Start(), next_pos->pos()); in SplitAndSpillIntersecting()
2012 ActiveToHandled(range); in SplitAndSpillIntersecting()
2018 LiveRange* range = inactive_live_ranges_[i]; in SplitAndSpillIntersecting() local
2019 DCHECK(range->End().Value() > current->Start().Value()); in SplitAndSpillIntersecting()
2020 if (range->assigned_register() == reg && !range->IsFixed()) { in SplitAndSpillIntersecting()
2021 LifetimePosition next_intersection = range->FirstIntersection(current); in SplitAndSpillIntersecting()
2023 UsePosition* next_pos = range->NextRegisterPosition(current->Start()); in SplitAndSpillIntersecting()
2025 SpillAfter(range, split_pos); in SplitAndSpillIntersecting()
2028 SpillBetween(range, split_pos, next_intersection); in SplitAndSpillIntersecting()
2031 InactiveToHandled(range); in SplitAndSpillIntersecting()
2045 LiveRange* RegisterAllocator::SplitRangeAt(LiveRange* range, in SplitRangeAt() argument
2047 DCHECK(!range->IsFixed()); in SplitRangeAt()
2048 TraceAlloc("Splitting live range %d at %d\n", range->id(), pos.Value()); in SplitRangeAt()
2050 if (pos.Value() <= range->Start().Value()) return range; in SplitRangeAt()
2060 range->SplitAt(pos, result, zone()); in SplitRangeAt()
2065 LiveRange* RegisterAllocator::SplitBetween(LiveRange* range, in SplitBetween() argument
2068 DCHECK(!range->IsFixed()); in SplitBetween()
2070 range->id(), start.Value(), end.Value()); in SplitBetween()
2074 return SplitRangeAt(range, split_pos); in SplitBetween()
2114 void RegisterAllocator::SpillAfter(LiveRange* range, LifetimePosition pos) { in SpillAfter() argument
2115 LiveRange* second_part = SplitRangeAt(range, pos); in SpillAfter()
2121 void RegisterAllocator::SpillBetween(LiveRange* range, LifetimePosition start, in SpillBetween() argument
2123 SpillBetweenUntil(range, start, start, end); in SpillBetween()
2127 void RegisterAllocator::SpillBetweenUntil(LiveRange* range, in SpillBetweenUntil() argument
2132 LiveRange* second_part = SplitRangeAt(range, start); in SpillBetweenUntil()
2156 void RegisterAllocator::Spill(LiveRange* range) { in Spill() argument
2157 DCHECK(!range->IsSpilled()); in Spill()
2158 TraceAlloc("Spilling live range %d\n", range->id()); in Spill()
2159 LiveRange* first = range->TopLevel(); in Spill()
2162 InstructionOperand* op = TryReuseSpillSlot(range); in Spill()
2165 RegisterKind kind = range->Kind(); in Spill()
2176 range->MakeSpilled(code_zone()); in Spill()
2197 void RegisterAllocator::SetLiveRangeAssignedRegister(LiveRange* range, in SetLiveRangeAssignedRegister() argument
2199 if (range->Kind() == DOUBLE_REGISTERS) { in SetLiveRangeAssignedRegister()
2202 DCHECK(range->Kind() == GENERAL_REGISTERS); in SetLiveRangeAssignedRegister()
2205 range->set_assigned_register(reg, code_zone()); in SetLiveRangeAssignedRegister()