Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::AllocationFinger Class Reference

#include <linearscan.h>

Inheritance diagram for dart::AllocationFinger:
dart::ValueObject

Public Member Functions

 AllocationFinger ()
 
void Initialize (LiveRange *range)
 
void UpdateAfterSplit (intptr_t first_use_after_split_pos)
 
bool Advance (intptr_t start)
 
UseIntervalfirst_pending_use_interval () const
 
Location FirstHint ()
 
UsePositionFirstRegisterUse (intptr_t after_pos)
 
UsePositionFirstRegisterBeneficialUse (intptr_t after_pos)
 
UsePositionFirstInterferingUse (intptr_t after_pos)
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 462 of file linearscan.h.

Constructor & Destructor Documentation

◆ AllocationFinger()

dart::AllocationFinger::AllocationFinger ( )
inline

Definition at line 464 of file linearscan.h.

465 : first_pending_use_interval_(nullptr),
466 first_register_use_(nullptr),
467 first_register_beneficial_use_(nullptr),
468 first_hinted_use_(nullptr) {}

Member Function Documentation

◆ Advance()

bool dart::AllocationFinger::Advance ( intptr_t  start)

Definition at line 1771 of file linearscan.cc.

1771 {
1772 UseInterval* a = first_pending_use_interval_;
1773 while (a != nullptr && a->end() <= start)
1774 a = a->next();
1775 first_pending_use_interval_ = a;
1776 return (first_pending_use_interval_ == nullptr);
1777}
struct MyStruct a[10]

◆ first_pending_use_interval()

UseInterval * dart::AllocationFinger::first_pending_use_interval ( ) const
inline

Definition at line 474 of file linearscan.h.

474 {
475 return first_pending_use_interval_;
476 }

◆ FirstHint()

Location dart::AllocationFinger::FirstHint ( )

Definition at line 1779 of file linearscan.cc.

1779 {
1780 UsePosition* use = first_hinted_use_;
1781
1782 while (use != nullptr) {
1783 if (use->HasHint()) return use->hint();
1784 use = use->next();
1785 }
1786
1787 return Location::NoLocation();
1788}
static Location NoLocation()
Definition: locations.h:387
Location hint() const
Definition: linearscan.h:401

◆ FirstInterferingUse()

UsePosition * dart::AllocationFinger::FirstInterferingUse ( intptr_t  after_pos)

Definition at line 1823 of file linearscan.cc.

1823 {
1824 if (IsInstructionEndPosition(after)) {
1825 // If after is a position at the end of the instruction disregard
1826 // any use occurring at it.
1827 after += 1;
1828 }
1829 return FirstRegisterUse(after);
1830}
UsePosition * FirstRegisterUse(intptr_t after_pos)
Definition: linearscan.cc:1797
static bool IsInstructionEndPosition(intptr_t pos)
Definition: linearscan.cc:46

◆ FirstRegisterBeneficialUse()

UsePosition * dart::AllocationFinger::FirstRegisterBeneficialUse ( intptr_t  after_pos)

Definition at line 1811 of file linearscan.cc.

1811 {
1812 for (UsePosition* use = FirstUseAfter(first_register_beneficial_use_, after);
1813 use != nullptr; use = use->next()) {
1814 Location* loc = use->location_slot();
1815 if (loc->IsUnallocated() && loc->IsRegisterBeneficial()) {
1816 first_register_beneficial_use_ = use;
1817 return use;
1818 }
1819 }
1820 return nullptr;
1821}
UsePosition * next() const
Definition: linearscan.h:411
static UsePosition * FirstUseAfter(UsePosition *use, intptr_t after)
Definition: linearscan.cc:1790

◆ FirstRegisterUse()

UsePosition * dart::AllocationFinger::FirstRegisterUse ( intptr_t  after_pos)

Definition at line 1797 of file linearscan.cc.

1797 {
1798 for (UsePosition* use = FirstUseAfter(first_register_use_, after);
1799 use != nullptr; use = use->next()) {
1800 Location* loc = use->location_slot();
1801 if (loc->IsUnallocated() &&
1802 ((loc->policy() == Location::kRequiresRegister) ||
1803 (loc->policy() == Location::kRequiresFpuRegister))) {
1804 first_register_use_ = use;
1805 return use;
1806 }
1807 }
1808 return nullptr;
1809}
@ kRequiresFpuRegister
Definition: locations.h:332

◆ Initialize()

void dart::AllocationFinger::Initialize ( LiveRange range)

Definition at line 1764 of file linearscan.cc.

1764 {
1765 first_pending_use_interval_ = range->first_use_interval();
1766 first_register_use_ = range->first_use();
1767 first_register_beneficial_use_ = range->first_use();
1768 first_hinted_use_ = range->first_use();
1769}

◆ UpdateAfterSplit()

void dart::AllocationFinger::UpdateAfterSplit ( intptr_t  first_use_after_split_pos)

Definition at line 1832 of file linearscan.cc.

1832 {
1833 if ((first_register_use_ != nullptr) &&
1834 (first_register_use_->pos() >= first_use_after_split_pos)) {
1835 first_register_use_ = nullptr;
1836 }
1837
1838 if ((first_register_beneficial_use_ != nullptr) &&
1839 (first_register_beneficial_use_->pos() >= first_use_after_split_pos)) {
1840 first_register_beneficial_use_ = nullptr;
1841 }
1842}
intptr_t pos() const
Definition: linearscan.h:413

The documentation for this class was generated from the following files: