V8 Project
v8::internal::CPURegList Class Reference

#include <assembler-arm64.h>

+ Collaboration diagram for v8::internal::CPURegList:

Public Member Functions

 CPURegList (CPURegister reg1, CPURegister reg2=NoCPUReg, CPURegister reg3=NoCPUReg, CPURegister reg4=NoCPUReg)
 
 CPURegList (CPURegister::RegisterType type, unsigned size, RegList list)
 
 CPURegList (CPURegister::RegisterType type, unsigned size, unsigned first_reg, unsigned last_reg)
 
CPURegister::RegisterType type () const
 
RegList list () const
 
void set_list (RegList new_list)
 
void Combine (const CPURegList &other)
 
void Remove (const CPURegList &other)
 
void Combine (const CPURegister &other)
 
void Remove (const CPURegister &other1, const CPURegister &other2=NoCPUReg, const CPURegister &other3=NoCPUReg, const CPURegister &other4=NoCPUReg)
 
void Combine (int code)
 
void Remove (int code)
 
void RemoveCalleeSaved ()
 
CPURegister PopLowestIndex ()
 
CPURegister PopHighestIndex ()
 
bool IsEmpty () const
 
bool IncludesAliasOf (const CPURegister &other1, const CPURegister &other2=NoCPUReg, const CPURegister &other3=NoCPUReg, const CPURegister &other4=NoCPUReg) const
 
int Count () const
 
unsigned RegisterSizeInBits () const
 
unsigned RegisterSizeInBytes () const
 
unsigned TotalSizeInBytes () const
 

Static Public Member Functions

static CPURegList GetCalleeSaved (unsigned size=kXRegSizeInBits)
 
static CPURegList GetCalleeSavedFP (unsigned size=kDRegSizeInBits)
 
static CPURegList GetCallerSaved (unsigned size=kXRegSizeInBits)
 
static CPURegList GetCallerSavedFP (unsigned size=kDRegSizeInBits)
 
static CPURegList GetSafepointSavedRegisters ()
 

Private Member Functions

bool IsValid () const
 

Private Attributes

RegList list_
 
unsigned size_
 
CPURegister::RegisterType type_
 

Detailed Description

Definition at line 451 of file assembler-arm64.h.

Constructor & Destructor Documentation

◆ CPURegList() [1/3]

v8::internal::CPURegList::CPURegList ( CPURegister  reg1,
CPURegister  reg2 = NoCPUReg,
CPURegister  reg3 = NoCPUReg,
CPURegister  reg4 = NoCPUReg 
)
inlineexplicit

Definition at line 453 of file assembler-arm64.h.

457  : list_(reg1.Bit() | reg2.Bit() | reg3.Bit() | reg4.Bit()),
458  size_(reg1.SizeInBits()), type_(reg1.type()) {
459  DCHECK(AreSameSizeAndType(reg1, reg2, reg3, reg4));
460  DCHECK(IsValid());
461  }
CPURegister::RegisterType type_
#define DCHECK(condition)
Definition: logging.h:205
bool AreSameSizeAndType(const CPURegister &reg1, const CPURegister &reg2, const CPURegister &reg3=NoCPUReg, const CPURegister &reg4=NoCPUReg, const CPURegister &reg5=NoCPUReg, const CPURegister &reg6=NoCPUReg, const CPURegister &reg7=NoCPUReg, const CPURegister &reg8=NoCPUReg)

References v8::internal::AreSameSizeAndType(), DCHECK, and IsValid().

+ Here is the call graph for this function:

◆ CPURegList() [2/3]

v8::internal::CPURegList::CPURegList ( CPURegister::RegisterType  type,
unsigned  size,
RegList  list 
)
inline

Definition at line 463 of file assembler-arm64.h.

464  : list_(list), size_(size), type_(type) {
465  DCHECK(IsValid());
466  }
CPURegister::RegisterType type() const
enable harmony numeric enable harmony object literal extensions Optimize object size

References DCHECK, and IsValid().

+ Here is the call graph for this function:

◆ CPURegList() [3/3]

v8::internal::CPURegList::CPURegList ( CPURegister::RegisterType  type,
unsigned  size,
unsigned  first_reg,
unsigned  last_reg 
)
inline

Definition at line 468 of file assembler-arm64.h.

470  : size_(size), type_(type) {
472  (last_reg < kNumberOfRegisters)) ||
474  (last_reg < kNumberOfFPRegisters)));
475  DCHECK(last_reg >= first_reg);
476  list_ = (1UL << (last_reg + 1)) - 1;
477  list_ &= ~((1UL << first_reg) - 1);
478  DCHECK(IsValid());
479  }
const unsigned kNumberOfFPRegisters
const unsigned kNumberOfRegisters

References DCHECK, IsValid(), v8::internal::CPURegister::kFPRegister, v8::internal::kNumberOfFPRegisters, v8::internal::kNumberOfRegisters, v8::internal::CPURegister::kRegister, list_, and type().

+ Here is the call graph for this function:

Member Function Documentation

◆ Combine() [1/3]

void v8::internal::CPURegList::Combine ( const CPURegister other)
inline

Definition at line 176 of file assembler-arm64-inl.h.

176  {
177  DCHECK(other.type() == type_);
178  DCHECK(other.SizeInBits() == size_);
179  Combine(other.code());
180 }
void Combine(const CPURegList &other)

References v8::internal::CPURegister::code(), Combine(), DCHECK, size_, v8::internal::CPURegister::SizeInBits(), v8::internal::CPURegister::type(), and type_.

+ Here is the call graph for this function:

◆ Combine() [2/3]

void v8::internal::CPURegList::Combine ( const CPURegList other)
inline

Definition at line 160 of file assembler-arm64-inl.h.

160  {
161  DCHECK(IsValid());
162  DCHECK(other.type() == type_);
163  DCHECK(other.RegisterSizeInBits() == size_);
164  list_ |= other.list();
165 }

References DCHECK, IsValid(), list(), list_, RegisterSizeInBits(), size_, type(), and type_.

Referenced by Combine().

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

◆ Combine() [3/3]

void v8::internal::CPURegList::Combine ( int  code)
inline

Definition at line 194 of file assembler-arm64-inl.h.

194  {
195  DCHECK(IsValid());
197  list_ |= (1UL << code);
198 }
static CPURegister Create(unsigned code, unsigned size, RegisterType type)

References v8::internal::CPURegister::Create(), DCHECK, IsValid(), list_, size_, and type_.

+ Here is the call graph for this function:

◆ Count()

int v8::internal::CPURegList::Count ( ) const
inline

Definition at line 554 of file assembler-arm64.h.

554  {
555  DCHECK(IsValid());
557  }
static const int kRegListSizeInBits
int CountSetBits(uint64_t value, int width)

References v8::internal::CountSetBits(), DCHECK, IsValid(), v8::internal::kRegListSizeInBits, and list_.

Referenced by TotalSizeInBytes().

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

◆ GetCalleeSaved()

static CPURegList v8::internal::CPURegList::GetCalleeSaved ( unsigned  size = kXRegSizeInBits)
static

◆ GetCalleeSavedFP()

static CPURegList v8::internal::CPURegList::GetCalleeSavedFP ( unsigned  size = kDRegSizeInBits)
static

◆ GetCallerSaved()

static CPURegList v8::internal::CPURegList::GetCallerSaved ( unsigned  size = kXRegSizeInBits)
static

◆ GetCallerSavedFP()

static CPURegList v8::internal::CPURegList::GetCallerSavedFP ( unsigned  size = kDRegSizeInBits)
static

◆ GetSafepointSavedRegisters()

static CPURegList v8::internal::CPURegList::GetSafepointSavedRegisters ( )
static

◆ IncludesAliasOf()

bool v8::internal::CPURegList::IncludesAliasOf ( const CPURegister other1,
const CPURegister other2 = NoCPUReg,
const CPURegister other3 = NoCPUReg,
const CPURegister other4 = NoCPUReg 
) const
inline

Definition at line 541 of file assembler-arm64.h.

544  {
545  DCHECK(IsValid());
546  RegList list = 0;
547  if (!other1.IsNone() && (other1.type() == type_)) list |= other1.Bit();
548  if (!other2.IsNone() && (other2.type() == type_)) list |= other2.Bit();
549  if (!other3.IsNone() && (other3.type() == type_)) list |= other3.Bit();
550  if (!other4.IsNone() && (other4.type() == type_)) list |= other4.Bit();
551  return (list_ & list) != 0;
552  }
uint32_t RegList
Definition: frames.h:18

References v8::internal::CPURegister::Bit(), DCHECK, v8::internal::CPURegister::IsNone(), IsValid(), list(), list_, v8::internal::CPURegister::type(), and type_.

+ Here is the call graph for this function:

◆ IsEmpty()

bool v8::internal::CPURegList::IsEmpty ( ) const
inline

Definition at line 536 of file assembler-arm64.h.

536  {
537  DCHECK(IsValid());
538  return list_ == 0;
539  }

References DCHECK, IsValid(), and list_.

+ Here is the call graph for this function:

◆ IsValid()

bool v8::internal::CPURegList::IsValid ( ) const
inlineprivate

Definition at line 580 of file assembler-arm64.h.

580  {
581  const RegList kValidRegisters = 0x8000000ffffffff;
582  const RegList kValidFPRegisters = 0x0000000ffffffff;
583  switch (type_) {
585  return (list_ & kValidRegisters) == list_;
587  return (list_ & kValidFPRegisters) == list_;
589  return list_ == 0;
590  default:
591  UNREACHABLE();
592  return false;
593  }
594  }
#define UNREACHABLE()
Definition: logging.h:30

References v8::internal::CPURegister::kFPRegister, v8::internal::CPURegister::kNoRegister, v8::internal::CPURegister::kRegister, list_, type_, and UNREACHABLE.

Referenced by Combine(), Count(), CPURegList(), IncludesAliasOf(), IsEmpty(), list(), RegisterSizeInBits(), Remove(), set_list(), TotalSizeInBytes(), and type().

+ Here is the caller graph for this function:

◆ list()

RegList v8::internal::CPURegList::list ( ) const
inline

Definition at line 486 of file assembler-arm64.h.

486  {
487  DCHECK(IsValid());
488  return list_;
489  }

References DCHECK, IsValid(), and list_.

Referenced by Combine(), IncludesAliasOf(), and Remove().

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

◆ PopHighestIndex()

CPURegister v8::internal::CPURegList::PopHighestIndex ( )

◆ PopLowestIndex()

CPURegister v8::internal::CPURegList::PopLowestIndex ( )

Referenced by v8::internal::RecordWriteStub::RegisterAllocation::RegisterAllocation().

+ Here is the caller graph for this function:

◆ RegisterSizeInBits()

unsigned v8::internal::CPURegList::RegisterSizeInBits ( ) const
inline

Definition at line 559 of file assembler-arm64.h.

559  {
560  DCHECK(IsValid());
561  return size_;
562  }

References DCHECK, IsValid(), and size_.

Referenced by Combine(), and RegisterSizeInBytes().

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

◆ RegisterSizeInBytes()

unsigned v8::internal::CPURegList::RegisterSizeInBytes ( ) const
inline

Definition at line 564 of file assembler-arm64.h.

564  {
565  int size_in_bits = RegisterSizeInBits();
566  DCHECK((size_in_bits % kBitsPerByte) == 0);
567  return size_in_bits / kBitsPerByte;
568  }
unsigned RegisterSizeInBits() const
const int kBitsPerByte
Definition: globals.h:162

References DCHECK, v8::internal::kBitsPerByte, and RegisterSizeInBits().

Referenced by TotalSizeInBytes().

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

◆ Remove() [1/3]

void v8::internal::CPURegList::Remove ( const CPURegister other1,
const CPURegister other2 = NoCPUReg,
const CPURegister other3 = NoCPUReg,
const CPURegister other4 = NoCPUReg 
)
inline

Definition at line 183 of file assembler-arm64-inl.h.

186  {
187  if (!other1.IsNone() && (other1.type() == type_)) Remove(other1.code());
188  if (!other2.IsNone() && (other2.type() == type_)) Remove(other2.code());
189  if (!other3.IsNone() && (other3.type() == type_)) Remove(other3.code());
190  if (!other4.IsNone() && (other4.type() == type_)) Remove(other4.code());
191 }
void Remove(const CPURegList &other)

References v8::internal::CPURegister::code(), v8::internal::CPURegister::IsNone(), Remove(), v8::internal::CPURegister::type(), and type_.

+ Here is the call graph for this function:

◆ Remove() [2/3]

void v8::internal::CPURegList::Remove ( const CPURegList other)
inline

Definition at line 168 of file assembler-arm64-inl.h.

168  {
169  DCHECK(IsValid());
170  if (other.type() == type_) {
171  list_ &= ~other.list();
172  }
173 }

References DCHECK, IsValid(), list(), list_, type(), and type_.

Referenced by v8::internal::RecordWriteStub::RegisterAllocation::GetValidRegistersForAllocation(), v8::internal::RecordWriteStub::RegisterAllocation::RegisterAllocation(), and Remove().

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

◆ Remove() [3/3]

void v8::internal::CPURegList::Remove ( int  code)
inline

Definition at line 201 of file assembler-arm64-inl.h.

201  {
202  DCHECK(IsValid());
204  list_ &= ~(1UL << code);
205 }

References v8::internal::CPURegister::Create(), DCHECK, IsValid(), list_, size_, and type_.

+ Here is the call graph for this function:

◆ RemoveCalleeSaved()

void v8::internal::CPURegList::RemoveCalleeSaved ( )

◆ set_list()

void v8::internal::CPURegList::set_list ( RegList  new_list)
inline

Definition at line 491 of file assembler-arm64.h.

491  {
492  DCHECK(IsValid());
493  list_ = new_list;
494  }

References DCHECK, IsValid(), and list_.

+ Here is the call graph for this function:

◆ TotalSizeInBytes()

unsigned v8::internal::CPURegList::TotalSizeInBytes ( ) const
inline

Definition at line 570 of file assembler-arm64.h.

570  {
571  DCHECK(IsValid());
572  return RegisterSizeInBytes() * Count();
573  }
unsigned RegisterSizeInBytes() const

References Count(), DCHECK, IsValid(), and RegisterSizeInBytes().

+ Here is the call graph for this function:

◆ type()

CPURegister::RegisterType v8::internal::CPURegList::type ( ) const
inline

Definition at line 481 of file assembler-arm64.h.

481  {
482  DCHECK(IsValid());
483  return type_;
484  }

References DCHECK, IsValid(), and type_.

Referenced by Combine(), CPURegList(), Remove(), and v8::internal::UseScratchRegisterScope::UseScratchRegisterScope().

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

Member Data Documentation

◆ list_

RegList v8::internal::CPURegList::list_
private

◆ size_

unsigned v8::internal::CPURegList::size_
private

Definition at line 577 of file assembler-arm64.h.

Referenced by Combine(), RegisterSizeInBits(), and Remove().

◆ type_

CPURegister::RegisterType v8::internal::CPURegList::type_
private

Definition at line 578 of file assembler-arm64.h.

Referenced by Combine(), IncludesAliasOf(), IsValid(), Remove(), and type().


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