v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::compiler::LinearScanAllocator Class Referencefinal

#include <register-allocator.h>

Inheritance diagram for v8::internal::compiler::LinearScanAllocator:
Collaboration diagram for v8::internal::compiler::LinearScanAllocator:

Classes

struct  InactiveLiveRangeOrdering
 
struct  UnhandledLiveRangeOrdering
 

Public Member Functions

 LinearScanAllocator (RegisterAllocationData *data, RegisterKind kind, Zone *local_zone)
 
 LinearScanAllocator (const LinearScanAllocator &)=delete
 
LinearScanAllocatoroperator= (const LinearScanAllocator &)=delete
 
void AllocateRegisters ()
 
- Public Member Functions inherited from v8::internal::compiler::RegisterAllocator
 RegisterAllocator (RegisterAllocationData *data, RegisterKind kind)
 
 RegisterAllocator (const RegisterAllocator &)=delete
 
RegisterAllocatoroperator= (const RegisterAllocator &)=delete
 
- Public Member Functions inherited from v8::internal::ZoneObject
void * operator new (size_t, Zone *)=delete
 
void * operator new (size_t size, void *ptr)
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)=delete
 

Private Types

using UnhandledLiveRangeQueue
 
using InactiveLiveRangeQueue = ZoneVector<LiveRange*>
 

Private Member Functions

void MaybeSpillPreviousRanges (LiveRange *begin_range, LifetimePosition begin_pos, LiveRange *end_range)
 
void MaybeUndoPreviousSplit (LiveRange *range, Zone *zone)
 
void SpillNotLiveRanges (RangeRegisterSmallMap &to_be_live, LifetimePosition position, SpillMode spill_mode)
 
LiveRangeAssignRegisterOnReload (LiveRange *range, int reg)
 
void ReloadLiveRanges (RangeRegisterSmallMap const &to_be_live, LifetimePosition position)
 
void UpdateDeferredFixedRanges (SpillMode spill_mode, InstructionBlock *block)
 
bool BlockIsDeferredOrImmediatePredecessorIsNotDeferred (const InstructionBlock *block)
 
bool HasNonDeferredPredecessor (InstructionBlock *block)
 
UnhandledLiveRangeQueueunhandled_live_ranges ()
 
ZoneVector< LiveRange * > & active_live_ranges ()
 
InactiveLiveRangeQueueinactive_live_ranges (int reg)
 
void SlowDCheckInactiveLiveRangesIsSorted (int reg)
 
void SetLiveRangeAssignedRegister (LiveRange *range, int reg)
 
void AddToActive (LiveRange *range)
 
void AddToInactive (LiveRange *range)
 
void AddToUnhandled (LiveRange *range)
 
ZoneVector< LiveRange * >::iterator ActiveToHandled (ZoneVector< LiveRange * >::iterator it)
 
ZoneVector< LiveRange * >::iterator ActiveToInactive (ZoneVector< LiveRange * >::iterator it, LifetimePosition position)
 
InactiveLiveRangeQueue::iterator InactiveToHandled (InactiveLiveRangeQueue::iterator it)
 
InactiveLiveRangeQueue::iterator InactiveToActive (InactiveLiveRangeQueue::iterator it, LifetimePosition position)
 
void ForwardStateTo (LifetimePosition position)
 
int LastDeferredInstructionIndex (InstructionBlock *start)
 
bool ConsiderBlockForControlFlow (InstructionBlock *current_block, RpoNumber predecessor)
 
RpoNumber ChooseOneOfTwoPredecessorStates (InstructionBlock *current_block, LifetimePosition boundary)
 
bool CheckConflict (MachineRepresentation rep, int reg, const RangeRegisterSmallMap &to_be_live)
 
void ComputeStateFromManyPredecessors (InstructionBlock *current_block, RangeRegisterSmallMap &to_be_live)
 
bool TryReuseSpillForPhi (TopLevelLiveRange *range)
 
int PickRegisterThatIsAvailableLongest (LiveRange *current, int hint_reg, base::Vector< const LifetimePosition > free_until_pos)
 
bool TryAllocateFreeReg (LiveRange *range, base::Vector< const LifetimePosition > free_until_pos)
 
bool TryAllocatePreferredReg (LiveRange *range, base::Vector< const LifetimePosition > free_until_pos)
 
void GetFPRegisterSet (MachineRepresentation rep, int *num_regs, int *num_codes, const int **codes) const
 
void GetSIMD128RegisterSet (int *num_regs, int *num_codes, const int **codes) const
 
void FindFreeRegistersForRange (LiveRange *range, base::Vector< LifetimePosition > free_until_pos)
 
void ProcessCurrentRange (LiveRange *current, SpillMode spill_mode)
 
void AllocateBlockedReg (LiveRange *range, SpillMode spill_mode)
 
void SpillAfter (LiveRange *range, LifetimePosition pos, SpillMode spill_mode)
 
void SpillBetween (LiveRange *range, LifetimePosition start, LifetimePosition end, SpillMode spill_mode)
 
void SpillBetweenUntil (LiveRange *range, LifetimePosition start, LifetimePosition until, LifetimePosition end, SpillMode spill_mode)
 
void SplitAndSpillIntersecting (LiveRange *range, SpillMode spill_mode)
 
void PrintRangeRow (std::ostream &os, const TopLevelLiveRange *toplevel)
 
void PrintRangeOverview ()
 

Private Attributes

UnhandledLiveRangeQueue unhandled_live_ranges_
 
ZoneVector< LiveRange * > active_live_ranges_
 
ZoneVector< InactiveLiveRangeQueueinactive_live_ranges_
 
LifetimePosition next_active_ranges_change_
 
LifetimePosition next_inactive_ranges_change_
 

Additional Inherited Members

- Protected Types inherited from v8::internal::compiler::RegisterAllocator
using SpillMode = RegisterAllocationData::SpillMode
 
- Protected Member Functions inherited from v8::internal::compiler::RegisterAllocator
RegisterAllocationDatadata () const
 
InstructionSequencecode () const
 
RegisterKind mode () const
 
int num_registers () const
 
int num_allocatable_registers () const
 
const int * allocatable_register_codes () const
 
bool check_fp_aliasing () const
 
LifetimePosition GetSplitPositionForInstruction (const LiveRange *range, int instruction_index)
 
Zoneallocation_zone () const
 
void SplitAndSpillRangesDefinedByMemoryOperand ()
 
LiveRangeSplitRangeAt (LiveRange *range, LifetimePosition pos)
 
bool CanProcessRange (LiveRange *range) const
 
LiveRangeSplitBetween (LiveRange *range, LifetimePosition start, LifetimePosition end)
 
LifetimePosition FindOptimalSplitPos (LifetimePosition start, LifetimePosition end)
 
void Spill (LiveRange *range, SpillMode spill_mode)
 
LifetimePosition FindOptimalSpillingPos (LiveRange *range, LifetimePosition pos, SpillMode spill_mode, LiveRange **begin_spill_out)
 
const ZoneVector< TopLevelLiveRange * > & GetFixedRegisters () const
 
const char * RegisterName (int allocation_index) const
 

Detailed Description

Definition at line 1545 of file register-allocator.h.

Member Typedef Documentation

◆ InactiveLiveRangeQueue

◆ UnhandledLiveRangeQueue

Initial value:
ZoneMultiset<LiveRange*, UnhandledLiveRangeOrdering>

Definition at line 1587 of file register-allocator.h.

Constructor & Destructor Documentation

◆ LinearScanAllocator() [1/2]

v8::internal::compiler::LinearScanAllocator::LinearScanAllocator ( RegisterAllocationData * data,
RegisterKind kind,
Zone * local_zone )

Definition at line 2937 of file register-allocator.cc.

Here is the call graph for this function:

◆ LinearScanAllocator() [2/2]

v8::internal::compiler::LinearScanAllocator::LinearScanAllocator ( const LinearScanAllocator & )
delete

Member Function Documentation

◆ active_live_ranges()

ZoneVector< LiveRange * > & v8::internal::compiler::LinearScanAllocator::active_live_ranges ( )
inlineprivate

Definition at line 1595 of file register-allocator.h.

Here is the caller graph for this function:

◆ ActiveToHandled()

ZoneVector< LiveRange * >::iterator v8::internal::compiler::LinearScanAllocator::ActiveToHandled ( ZoneVector< LiveRange * >::iterator it)
private

Definition at line 3872 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ActiveToInactive()

ZoneVector< LiveRange * >::iterator v8::internal::compiler::LinearScanAllocator::ActiveToInactive ( ZoneVector< LiveRange * >::iterator it,
LifetimePosition position )
private

Definition at line 3879 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddToActive()

void v8::internal::compiler::LinearScanAllocator::AddToActive ( LiveRange * range)
private

Definition at line 3839 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddToInactive()

void v8::internal::compiler::LinearScanAllocator::AddToInactive ( LiveRange * range)
private

Definition at line 3847 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddToUnhandled()

void v8::internal::compiler::LinearScanAllocator::AddToUnhandled ( LiveRange * range)
private

Definition at line 3862 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AllocateBlockedReg()

void v8::internal::compiler::LinearScanAllocator::AllocateBlockedReg ( LiveRange * range,
SpillMode spill_mode )
private

Definition at line 4229 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AllocateRegisters()

void v8::internal::compiler::LinearScanAllocator::AllocateRegisters ( )

Definition at line 3557 of file register-allocator.cc.

◆ AssignRegisterOnReload()

LiveRange * v8::internal::compiler::LinearScanAllocator::AssignRegisterOnReload ( LiveRange * range,
int reg )
private

Definition at line 3075 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BlockIsDeferredOrImmediatePredecessorIsNotDeferred()

bool v8::internal::compiler::LinearScanAllocator::BlockIsDeferredOrImmediatePredecessorIsNotDeferred ( const InstructionBlock * block)
private

Definition at line 3535 of file register-allocator.cc.

Here is the call graph for this function:

◆ CheckConflict()

bool v8::internal::compiler::LinearScanAllocator::CheckConflict ( MachineRepresentation rep,
int reg,
const RangeRegisterSmallMap & to_be_live )
private

Definition at line 3275 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChooseOneOfTwoPredecessorStates()

RpoNumber v8::internal::compiler::LinearScanAllocator::ChooseOneOfTwoPredecessorStates ( InstructionBlock * current_block,
LifetimePosition boundary )
private

Definition at line 3186 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeStateFromManyPredecessors()

void v8::internal::compiler::LinearScanAllocator::ComputeStateFromManyPredecessors ( InstructionBlock * current_block,
RangeRegisterSmallMap & to_be_live )
private

Definition at line 3287 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConsiderBlockForControlFlow()

bool v8::internal::compiler::LinearScanAllocator::ConsiderBlockForControlFlow ( InstructionBlock * current_block,
RpoNumber predecessor )
private

Definition at line 3392 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindFreeRegistersForRange()

void v8::internal::compiler::LinearScanAllocator::FindFreeRegistersForRange ( LiveRange * range,
base::Vector< LifetimePosition > free_until_pos )
private

Definition at line 4017 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ForwardStateTo()

void v8::internal::compiler::LinearScanAllocator::ForwardStateTo ( LifetimePosition position)
private

Definition at line 3927 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFPRegisterSet()

void v8::internal::compiler::LinearScanAllocator::GetFPRegisterSet ( MachineRepresentation rep,
int * num_regs,
int * num_codes,
const int ** codes ) const
private

Definition at line 3987 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSIMD128RegisterSet()

void v8::internal::compiler::LinearScanAllocator::GetSIMD128RegisterSet ( int * num_regs,
int * num_codes,
const int ** codes ) const
private

Definition at line 4008 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasNonDeferredPredecessor()

bool v8::internal::compiler::LinearScanAllocator::HasNonDeferredPredecessor ( InstructionBlock * block)
private

Definition at line 3549 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inactive_live_ranges()

InactiveLiveRangeQueue & v8::internal::compiler::LinearScanAllocator::inactive_live_ranges ( int reg)
inlineprivate

Definition at line 1596 of file register-allocator.h.

Here is the caller graph for this function:

◆ InactiveToActive()

LinearScanAllocator::InactiveLiveRangeQueue::iterator v8::internal::compiler::LinearScanAllocator::InactiveToActive ( InactiveLiveRangeQueue::iterator it,
LifetimePosition position )
private

Definition at line 3910 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InactiveToHandled()

LinearScanAllocator::InactiveLiveRangeQueue::iterator v8::internal::compiler::LinearScanAllocator::InactiveToHandled ( InactiveLiveRangeQueue::iterator it)
private

Definition at line 3899 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LastDeferredInstructionIndex()

int v8::internal::compiler::LinearScanAllocator::LastDeferredInstructionIndex ( InstructionBlock * start)
private

Definition at line 3974 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MaybeSpillPreviousRanges()

void v8::internal::compiler::LinearScanAllocator::MaybeSpillPreviousRanges ( LiveRange * begin_range,
LifetimePosition begin_pos,
LiveRange * end_range )
private

Definition at line 2949 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MaybeUndoPreviousSplit()

void v8::internal::compiler::LinearScanAllocator::MaybeUndoPreviousSplit ( LiveRange * range,
Zone * zone )
private

Definition at line 2971 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

LinearScanAllocator & v8::internal::compiler::LinearScanAllocator::operator= ( const LinearScanAllocator & )
delete

◆ PickRegisterThatIsAvailableLongest()

int v8::internal::compiler::LinearScanAllocator::PickRegisterThatIsAvailableLongest ( LiveRange * current,
int hint_reg,
base::Vector< const LifetimePosition > free_until_pos )
private

Definition at line 4138 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintRangeOverview()

void v8::internal::compiler::LinearScanAllocator::PrintRangeOverview ( )
private

Definition at line 1015 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintRangeRow()

void v8::internal::compiler::LinearScanAllocator::PrintRangeRow ( std::ostream & os,
const TopLevelLiveRange * toplevel )
private

Definition at line 963 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessCurrentRange()

void v8::internal::compiler::LinearScanAllocator::ProcessCurrentRange ( LiveRange * current,
SpillMode spill_mode )
private

Definition at line 4099 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReloadLiveRanges()

void v8::internal::compiler::LinearScanAllocator::ReloadLiveRanges ( RangeRegisterSmallMap const & to_be_live,
LifetimePosition position )
private

Definition at line 3117 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetLiveRangeAssignedRegister()

void v8::internal::compiler::LinearScanAllocator::SetLiveRangeAssignedRegister ( LiveRange * range,
int reg )
private

Definition at line 3828 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SlowDCheckInactiveLiveRangesIsSorted()

void v8::internal::compiler::LinearScanAllocator::SlowDCheckInactiveLiveRangesIsSorted ( int reg)
inlineprivate

Definition at line 1605 of file register-allocator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SpillAfter()

void v8::internal::compiler::LinearScanAllocator::SpillAfter ( LiveRange * range,
LifetimePosition pos,
SpillMode spill_mode )
private

Definition at line 4530 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SpillBetween()

void v8::internal::compiler::LinearScanAllocator::SpillBetween ( LiveRange * range,
LifetimePosition start,
LifetimePosition end,
SpillMode spill_mode )
private

Definition at line 4536 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SpillBetweenUntil()

void v8::internal::compiler::LinearScanAllocator::SpillBetweenUntil ( LiveRange * range,
LifetimePosition start,
LifetimePosition until,
LifetimePosition end,
SpillMode spill_mode )
private

Definition at line 4542 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SpillNotLiveRanges()

void v8::internal::compiler::LinearScanAllocator::SpillNotLiveRanges ( RangeRegisterSmallMap & to_be_live,
LifetimePosition position,
SpillMode spill_mode )
private

Definition at line 2990 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SplitAndSpillIntersecting()

void v8::internal::compiler::LinearScanAllocator::SplitAndSpillIntersecting ( LiveRange * range,
SpillMode spill_mode )
private

Definition at line 4397 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryAllocateFreeReg()

bool v8::internal::compiler::LinearScanAllocator::TryAllocateFreeReg ( LiveRange * range,
base::Vector< const LifetimePosition > free_until_pos )
private

Definition at line 4185 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryAllocatePreferredReg()

bool v8::internal::compiler::LinearScanAllocator::TryAllocatePreferredReg ( LiveRange * range,
base::Vector< const LifetimePosition > free_until_pos )
private

Definition at line 4114 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryReuseSpillForPhi()

bool v8::internal::compiler::LinearScanAllocator::TryReuseSpillForPhi ( TopLevelLiveRange * range)
private

Definition at line 4480 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unhandled_live_ranges()

UnhandledLiveRangeQueue & v8::internal::compiler::LinearScanAllocator::unhandled_live_ranges ( )
inlineprivate

Definition at line 1592 of file register-allocator.h.

Here is the caller graph for this function:

◆ UpdateDeferredFixedRanges()

void v8::internal::compiler::LinearScanAllocator::UpdateDeferredFixedRanges ( SpillMode spill_mode,
InstructionBlock * block )
private

Definition at line 3403 of file register-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ active_live_ranges_

ZoneVector<LiveRange*> v8::internal::compiler::LinearScanAllocator::active_live_ranges_
private

Definition at line 1683 of file register-allocator.h.

◆ inactive_live_ranges_

ZoneVector<InactiveLiveRangeQueue> v8::internal::compiler::LinearScanAllocator::inactive_live_ranges_
private

Definition at line 1684 of file register-allocator.h.

◆ next_active_ranges_change_

LifetimePosition v8::internal::compiler::LinearScanAllocator::next_active_ranges_change_
private

Definition at line 1688 of file register-allocator.h.

◆ next_inactive_ranges_change_

LifetimePosition v8::internal::compiler::LinearScanAllocator::next_inactive_ranges_change_
private

Definition at line 1689 of file register-allocator.h.

◆ unhandled_live_ranges_

UnhandledLiveRangeQueue v8::internal::compiler::LinearScanAllocator::unhandled_live_ranges_
private

Definition at line 1682 of file register-allocator.h.


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