V8 Project
v8::internal::CPURegister Struct Reference

#include <assembler-arm64.h>

+ Inheritance diagram for v8::internal::CPURegister:
+ Collaboration diagram for v8::internal::CPURegister:

Public Types

enum  RegisterType { kInvalid = 0 , kRegister , kFPRegister , kNoRegister }
 

Public Member Functions

unsigned code () const
 
RegisterType type () const
 
RegList Bit () const
 
unsigned SizeInBits () const
 
int SizeInBytes () const
 
bool Is32Bits () const
 
bool Is64Bits () const
 
bool IsValid () const
 
bool IsValidOrNone () const
 
bool IsValidRegister () const
 
bool IsValidFPRegister () const
 
bool IsNone () const
 
bool Is (const CPURegister &other) const
 
bool Aliases (const CPURegister &other) const
 
bool IsZero () const
 
bool IsSP () const
 
bool IsRegister () const
 
bool IsFPRegister () const
 
Register X () const
 
Register W () const
 
FPRegister D () const
 
FPRegister S () const
 
bool IsSameSizeAndType (const CPURegister &other) const
 
bool is (const CPURegister &other) const
 
bool is_valid () const
 

Static Public Member Functions

static CPURegister Create (unsigned code, unsigned size, RegisterType type)
 

Public Attributes

unsigned reg_code
 
unsigned reg_size
 
RegisterType reg_type
 

Detailed Description

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

Member Enumeration Documentation

◆ RegisterType

Enumerator
kInvalid 
kRegister 
kFPRegister 
kNoRegister 

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

42  {
43  // The kInvalid value is used to detect uninitialized static instances,
44  // which are always zero-initialized before any constructors are called.
45  kInvalid = 0,
46  kRegister,
49  };

Member Function Documentation

◆ Aliases()

bool v8::internal::CPURegister::Aliases ( const CPURegister other) const
inline

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

122  {
123  DCHECK(IsValidOrNone() && other.IsValidOrNone());
124  return (reg_code == other.reg_code) && (reg_type == other.reg_type);
125 }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, IsValidOrNone(), reg_code, and reg_type.

Referenced by Is().

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

◆ Bit()

RegList v8::internal::CPURegister::Bit ( ) const
inline

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

51  {
52  DCHECK(reg_code < (sizeof(RegList) * kBitsPerByte));
53  return IsValid() ? 1UL << reg_code : 0;
54 }
uint32_t RegList
Definition: frames.h:18
const int kBitsPerByte
Definition: globals.h:162

References DCHECK, IsValid(), v8::internal::kBitsPerByte, and reg_code.

Referenced by v8::internal::CPURegList::IncludesAliasOf(), and v8::internal::FPRegister::IsAllocatable().

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

◆ code()

unsigned v8::internal::CPURegister::code ( ) const
inline

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

39  {
40  DCHECK(IsValid());
41  return reg_code;
42 }

References DCHECK, IsValid(), and reg_code.

Referenced by v8::internal::CPURegList::Combine(), v8::internal::FPRegister::Create(), Create(), v8::internal::FPRegister::DRegFromCode(), v8::internal::FPRegister::from_code(), v8::internal::Assembler::Ra(), v8::internal::Assembler::Rd(), v8::internal::CPURegList::Remove(), v8::internal::Assembler::Rm(), v8::internal::Assembler::Rn(), v8::internal::Assembler::Rt(), v8::internal::Assembler::Rt2(), v8::internal::FPRegister::SRegFromCode(), and v8::internal::FPRegister::ToAllocationIndex().

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

◆ Create()

static CPURegister v8::internal::CPURegister::Create ( unsigned  code,
unsigned  size,
RegisterType  type 
)
inlinestatic

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

51  {
52  CPURegister r = {code, size, type};
53  return r;
54  }
enable harmony numeric enable harmony object literal extensions Optimize object size
RegisterType type() const

References code(), size, and type().

Referenced by v8::internal::CPURegList::Combine(), v8::internal::Register::Create(), v8::internal::FPRegister::Create(), and v8::internal::CPURegList::Remove().

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

◆ D()

FPRegister v8::internal::CPURegister::D ( ) const
inline

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

258  {
261 }
static FPRegister DRegFromCode(unsigned code)

References DCHECK, v8::internal::FPRegister::DRegFromCode(), IsValidFPRegister(), and reg_code.

Referenced by v8::internal::UseScratchRegisterScope::AcquireD().

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

◆ Is()

bool v8::internal::CPURegister::Is ( const CPURegister other) const
inline

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

116  {
117  DCHECK(IsValidOrNone() && other.IsValidOrNone());
118  return Aliases(other) && (reg_size == other.reg_size);
119 }
bool Aliases(const CPURegister &other) const

References Aliases(), DCHECK, IsValidOrNone(), and reg_size.

Referenced by v8::internal::LCodeGen::CallKnownFunction(), v8::internal::LCodeGen::DoDeferredInstanceOfKnownGlobal(), v8::internal::MacroAssembler::Fmov(), is(), v8::internal::Operand::IsImmediate(), v8::internal::MemOperand::IsImmediateOffset(), v8::internal::MemOperand::IsRegisterOffset(), v8::internal::BASE_EMBEDDED< Visitor >::IsScratchRegister(), and v8::internal::MacroAssembler::Mov().

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

◆ is()

bool v8::internal::CPURegister::is ( const CPURegister other) const
inline

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

85 { return Is(other); }
bool Is(const CPURegister &other) const

References Is().

+ Here is the call graph for this function:

◆ Is32Bits()

bool v8::internal::CPURegister::Is32Bits ( ) const
inline

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

70  {
71  DCHECK(IsValid());
72  return reg_size == 32;
73 }

References DCHECK, IsValid(), and reg_size.

Referenced by v8::internal::MacroAssembler::Fmov(), v8::internal::Operand::Operand(), v8::internal::MacroAssembler::SmiUntagToFloat(), and v8::internal::MacroAssembler::TryRepresentDoubleAsInt32().

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

◆ Is64Bits()

bool v8::internal::CPURegister::Is64Bits ( ) const
inline

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

76  {
77  DCHECK(IsValid());
78  return reg_size == 64;
79 }

References DCHECK, IsValid(), and reg_size.

Referenced by v8::internal::Assembler::AppropriateZeroRegFor(), v8::internal::MacroAssembler::CmovX(), v8::internal::MacroAssembler::CzeroX(), v8::internal::LCodeGen::DeoptimizeIfNegative(), v8::internal::MacroAssembler::Fmov(), v8::internal::Assembler::FPType(), v8::internal::MacroAssembler::Ldr(), v8::internal::Assembler::LoadLiteralOpFor(), v8::internal::Assembler::LoadOpFor(), v8::internal::Assembler::LoadPairNonTemporalOpFor(), v8::internal::Assembler::LoadPairOpFor(), v8::internal::MemOperand::MemOperand(), v8::internal::MacroAssembler::Mov(), v8::internal::Operand::Operand(), v8::internal::RecordWriteStub::RecordWriteStub(), v8::internal::Assembler::SF(), v8::internal::MacroAssembler::SmiTag(), v8::internal::MacroAssembler::SmiUntag(), v8::internal::MacroAssembler::SmiUntagToDouble(), v8::internal::MacroAssembler::SmiUntagToFloat(), v8::internal::Assembler::StoreOpFor(), v8::internal::Assembler::StorePairNonTemporalOpFor(), v8::internal::Assembler::StorePairOpFor(), v8::internal::Operand::ToExtendedRegister(), v8::internal::MacroAssembler::TryRepresentDoubleAsInt64(), v8::internal::Operand::UntagSmi(), and v8::internal::Operand::UntagSmiAndScale().

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

◆ is_valid()

bool v8::internal::CPURegister::is_valid ( ) const
inline

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

86 { return IsValid(); }

References IsValid().

+ Here is the call graph for this function:

◆ IsFPRegister()

bool v8::internal::CPURegister::IsFPRegister ( ) const
inline

◆ IsNone()

bool v8::internal::CPURegister::IsNone ( ) const
inline

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

107  {
108  // kNoRegister types should always have size 0 and code 0.
109  DCHECK((reg_type != kNoRegister) || (reg_code == 0));
110  DCHECK((reg_type != kNoRegister) || (reg_size == 0));
111 
112  return reg_type == kNoRegister;
113 }

References DCHECK, kNoRegister, reg_code, reg_size, and reg_type.

Referenced by v8::internal::LCodeGen::CallKnownFunction(), v8::internal::CPURegList::IncludesAliasOf(), IsValid(), v8::internal::Register::IsValid(), v8::internal::FPRegister::IsValid(), IsValidOrNone(), and v8::internal::CPURegList::Remove().

+ Here is the caller graph for this function:

◆ IsRegister()

bool v8::internal::CPURegister::IsRegister ( ) const
inline

◆ IsSameSizeAndType()

bool v8::internal::CPURegister::IsSameSizeAndType ( const CPURegister other) const
inline

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

138  {
139  return (reg_size == other.reg_size) && (reg_type == other.reg_type);
140 }

References reg_size, and reg_type.

◆ IsSP()

bool v8::internal::CPURegister::IsSP ( ) const
inline

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

154  {
155  DCHECK(IsValid());
156  return IsRegister() && (reg_code == kSPRegInternalCode);
157 }
const unsigned kSPRegInternalCode

References DCHECK, IsRegister(), IsValid(), v8::internal::kSPRegInternalCode, and reg_code.

Referenced by v8::internal::MacroAssembler::CmovX(), v8::internal::MacroAssembler::CzeroX(), v8::internal::MemOperand::MemOperand(), and v8::internal::Operand::Operand().

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

◆ IsValid()

bool v8::internal::CPURegister::IsValid ( ) const
inline

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

82  {
84  DCHECK(!IsNone());
85  return true;
86  } else {
87  DCHECK(IsNone());
88  return false;
89  }
90 }

References DCHECK, IsNone(), IsValidFPRegister(), and IsValidRegister().

Referenced by Bit(), code(), Is32Bits(), Is64Bits(), is_valid(), IsSP(), IsValidOrNone(), IsZero(), v8::internal::Assembler::LoadOpFor(), SizeInBits(), SizeInBytes(), and v8::internal::Assembler::StoreOpFor().

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

◆ IsValidFPRegister()

bool v8::internal::CPURegister::IsValidFPRegister ( ) const
inline

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

100  {
101  return IsFPRegister() &&
104 }
const unsigned kDRegSizeInBits
const unsigned kSRegSizeInBits
const unsigned kNumberOfFPRegisters

References IsFPRegister(), v8::internal::kDRegSizeInBits, v8::internal::kNumberOfFPRegisters, v8::internal::kSRegSizeInBits, reg_code, and reg_size.

Referenced by D(), IsValid(), v8::internal::FPRegister::IsValid(), and S().

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

◆ IsValidOrNone()

bool v8::internal::CPURegister::IsValidOrNone ( ) const
inline

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

143  {
144  return IsValid() || IsNone();
145 }

References IsNone(), and IsValid().

Referenced by Aliases(), v8::internal::FPRegister::FPRegister(), Is(), v8::internal::Register::Register(), and type().

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

◆ IsValidRegister()

bool v8::internal::CPURegister::IsValidRegister ( ) const
inline

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

93  {
94  return IsRegister() &&
97 }
const unsigned kXRegSizeInBits
const unsigned kWRegSizeInBits
const unsigned kNumberOfRegisters

References IsRegister(), v8::internal::kNumberOfRegisters, v8::internal::kSPRegInternalCode, v8::internal::kWRegSizeInBits, v8::internal::kXRegSizeInBits, reg_code, and reg_size.

Referenced by IsValid(), v8::internal::Register::IsValid(), W(), and X().

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

◆ IsZero()

bool v8::internal::CPURegister::IsZero ( ) const
inline

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

148  {
149  DCHECK(IsValid());
150  return IsRegister() && (reg_code == kZeroRegCode);
151 }
const unsigned kZeroRegCode

References DCHECK, IsRegister(), IsValid(), v8::internal::kZeroRegCode, and reg_code.

Referenced by v8::internal::MacroAssembler::Adc(), v8::internal::MacroAssembler::Adcs(), v8::internal::MacroAssembler::And(), v8::internal::MacroAssembler::Ands(), v8::internal::MacroAssembler::Asr(), v8::internal::MacroAssembler::Bfi(), v8::internal::MacroAssembler::Bfxil(), v8::internal::MacroAssembler::Bic(), v8::internal::MacroAssembler::Bics(), v8::internal::MacroAssembler::Blr(), v8::internal::MacroAssembler::Br(), v8::internal::MacroAssembler::Cinc(), v8::internal::MacroAssembler::Cinv(), v8::internal::MacroAssembler::Cls(), v8::internal::MacroAssembler::Clz(), v8::internal::MacroAssembler::Cneg(), v8::internal::MacroAssembler::Cset(), v8::internal::MacroAssembler::Csetm(), v8::internal::MacroAssembler::Csinc(), v8::internal::MacroAssembler::Csinv(), v8::internal::MacroAssembler::Csneg(), v8::internal::MacroAssembler::Eon(), v8::internal::MacroAssembler::Eor(), v8::internal::MacroAssembler::Extr(), v8::internal::MacroAssembler::Fcvtas(), v8::internal::MacroAssembler::Fcvtau(), v8::internal::MacroAssembler::Fcvtms(), v8::internal::MacroAssembler::Fcvtmu(), v8::internal::MacroAssembler::Fcvtns(), v8::internal::MacroAssembler::Fcvtnu(), v8::internal::MacroAssembler::Fcvtzs(), v8::internal::MacroAssembler::Fcvtzu(), v8::internal::MacroAssembler::Fmov(), v8::internal::Operand::IsZero(), v8::internal::MacroAssembler::Lsl(), v8::internal::MacroAssembler::Lsr(), v8::internal::MacroAssembler::Madd(), v8::internal::MemOperand::MemOperand(), v8::internal::MacroAssembler::Mneg(), v8::internal::MacroAssembler::Mov(), v8::internal::MacroAssembler::Movk(), v8::internal::MacroAssembler::Mrs(), v8::internal::MacroAssembler::Msub(), v8::internal::MacroAssembler::Mul(), v8::internal::MacroAssembler::Mvn(), v8::internal::MacroAssembler::Neg(), v8::internal::MacroAssembler::Ngc(), v8::internal::MacroAssembler::Ngcs(), v8::internal::MacroAssembler::Orn(), v8::internal::MacroAssembler::Orr(), v8::internal::MacroAssembler::Rbit(), v8::internal::Assembler::RdSP(), v8::internal::MacroAssembler::Ret(), v8::internal::MacroAssembler::Rev(), v8::internal::MacroAssembler::Rev16(), v8::internal::MacroAssembler::Rev32(), v8::internal::Assembler::RnSP(), v8::internal::MacroAssembler::Ror(), v8::internal::MacroAssembler::Sbc(), v8::internal::MacroAssembler::Sbcs(), v8::internal::MacroAssembler::Sbfiz(), v8::internal::MacroAssembler::Sbfx(), v8::internal::MacroAssembler::Sdiv(), v8::internal::MacroAssembler::Smaddl(), v8::internal::MacroAssembler::Smsubl(), v8::internal::MacroAssembler::Smulh(), v8::internal::MacroAssembler::Smull(), v8::internal::MacroAssembler::Sxtb(), v8::internal::MacroAssembler::Sxth(), v8::internal::MacroAssembler::Sxtw(), v8::internal::MacroAssembler::Ubfiz(), v8::internal::MacroAssembler::Ubfx(), v8::internal::MacroAssembler::Udiv(), v8::internal::MacroAssembler::Umaddl(), v8::internal::MacroAssembler::Umsubl(), v8::internal::MacroAssembler::Uxtb(), v8::internal::MacroAssembler::Uxth(), and v8::internal::MacroAssembler::Uxtw().

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

◆ S()

FPRegister v8::internal::CPURegister::S ( ) const
inline

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

252  {
255 }
static FPRegister SRegFromCode(unsigned code)

References DCHECK, IsValidFPRegister(), reg_code, and v8::internal::FPRegister::SRegFromCode().

Referenced by v8::internal::UseScratchRegisterScope::AcquireS().

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

◆ SizeInBits()

unsigned v8::internal::CPURegister::SizeInBits ( ) const
inline

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

57  {
58  DCHECK(IsValid());
59  return reg_size;
60 }

References DCHECK, IsValid(), and reg_size.

Referenced by v8::internal::Assembler::asr(), v8::internal::Assembler::bfi(), v8::internal::Assembler::bfxil(), v8::internal::CPURegList::Combine(), v8::internal::Assembler::lsl(), v8::internal::Assembler::lsr(), v8::internal::Assembler::sbfiz(), v8::internal::Assembler::sbfx(), SizeInBytes(), v8::internal::MacroAssembler::TestAndBranchIfAllClear(), v8::internal::MacroAssembler::TestAndBranchIfAnySet(), v8::internal::Assembler::ubfiz(), and v8::internal::Assembler::ubfx().

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

◆ SizeInBytes()

int v8::internal::CPURegister::SizeInBytes ( ) const
inline

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

63  {
64  DCHECK(IsValid());
65  DCHECK(SizeInBits() % 8 == 0);
66  return reg_size / 8;
67 }

References DCHECK, IsValid(), reg_size, and SizeInBits().

Referenced by v8::internal::MacroAssembler::PushPopQueue::Queue().

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

◆ type()

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

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

45  {
47  return reg_type;
48 }

References DCHECK, IsValidOrNone(), and reg_type.

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

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

◆ W()

Register v8::internal::CPURegister::W ( ) const
inline

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

240  {
243 }
static Register WRegFromCode(unsigned code)

References DCHECK, IsValidRegister(), reg_code, and v8::internal::Register::WRegFromCode().

Referenced by v8::internal::UseScratchRegisterScope::AcquireW(), v8::internal::compiler::FINAL< kOperandKind, kNumCachedOperands >::InputRegister32(), v8::internal::MacroAssembler::IsObjectJSStringType(), v8::internal::compiler::FINAL< kOperandKind, kNumCachedOperands >::OutputRegister32(), v8::internal::MacroAssembler::SmiTagAndPush(), and v8::internal::LCodeGen::ToRegister32().

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

◆ X()

Register v8::internal::CPURegister::X ( ) const
inline

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

246  {
249 }
static Register XRegFromCode(unsigned code)

References DCHECK, IsValidRegister(), reg_code, and v8::internal::Register::XRegFromCode().

Referenced by v8::internal::UseScratchRegisterScope::AcquireX().

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

Member Data Documentation

◆ reg_code

◆ reg_size

◆ reg_type


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