V8 Project
v8::internal::Register Struct Reference

#include <assembler-arm.h>

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

Public Member Functions

bool is_valid () const
 
bool is (Register reg) const
 
int code () const
 
int bit () const
 
void set_code (int code)
 
 Register ()
 
 Register (const CPURegister &r)
 
 Register (const Register &r)
 
bool IsValid () const
 
bool IsAllocatable () const
 
bool is_valid () const
 
bool is (Register reg) const
 
bool is_byte_register () const
 
int code () const
 
int bit () const
 
bool is_valid () const
 
bool is (Register reg) const
 
int code () const
 
int bit () const
 
bool is_valid () const
 
bool is (Register reg) const
 
int code () const
 
int bit () const
 
bool is_valid () const
 
bool is (Register reg) const
 
bool is_byte_register () const
 
int code () const
 
int bit () const
 
int high_bit () const
 
int low_bits () const
 
bool is_valid () const
 
bool is (Register reg) const
 
bool is_byte_register () const
 
int code () const
 
int bit () const
 
- Public Member Functions inherited from v8::internal::CPURegister
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 int NumAllocatableRegisters ()
 
static int ToAllocationIndex (Register reg)
 
static Register FromAllocationIndex (int index)
 
static const char * AllocationIndexToString (int index)
 
static Register from_code (int code)
 
static Register Create (unsigned code, unsigned size)
 
static Register XRegFromCode (unsigned code)
 
static Register WRegFromCode (unsigned code)
 
static int NumRegisters ()
 
static int NumAllocatableRegisters ()
 
static Register FromAllocationIndex (unsigned index)
 
static const char * AllocationIndexToString (int index)
 
static int ToAllocationIndex (Register reg)
 
static Register from_code (int code)
 
static int NumAllocatableRegisters ()
 
static const char * AllocationIndexToString (int index)
 
static int ToAllocationIndex (Register reg)
 
static Register FromAllocationIndex (int index)
 
static Register from_code (int code)
 
static int NumAllocatableRegisters ()
 
static int ToAllocationIndex (Register reg)
 
static Register FromAllocationIndex (int index)
 
static const char * AllocationIndexToString (int index)
 
static Register from_code (int code)
 
static int NumAllocatableRegisters ()
 
static int ToAllocationIndex (Register reg)
 
static Register FromAllocationIndex (int index)
 
static const char * AllocationIndexToString (int index)
 
static Register from_code (int code)
 
static int NumAllocatableRegisters ()
 
static int ToAllocationIndex (Register reg)
 
static Register FromAllocationIndex (int index)
 
static const char * AllocationIndexToString (int index)
 
static Register from_code (int code)
 
static int NumAllocatableRegisters ()
 
static const char * AllocationIndexToString (int index)
 
static int ToAllocationIndex (Register reg)
 
static Register FromAllocationIndex (int index)
 
static Register from_code (int code)
 
- Static Public Member Functions inherited from v8::internal::CPURegister
static CPURegister Create (unsigned code, unsigned size, RegisterType type)
 

Public Attributes

int code_
 
- Public Attributes inherited from v8::internal::CPURegister
unsigned reg_code
 
unsigned reg_size
 
RegisterType reg_type
 

Static Public Attributes

static const int kNumRegisters = 16
 
static const int kMaxNumAllocatableRegisters
 
static const int kSizeInBytes = 4
 
static const unsigned kAllocatableLowRangeBegin = 0
 
static const unsigned kAllocatableLowRangeEnd = 15
 
static const unsigned kAllocatableHighRangeBegin = 18
 
static const unsigned kAllocatableHighRangeEnd = 24
 
static const unsigned kAllocatableContext = 27
 
static const int kAllocatableRangeGapSize
 
static const int kCpRegister = 23
 

Static Private Attributes

static const int kRegisterCodeByAllocationIndex [kMaxNumAllocatableRegisters]
 
static const int kAllocationIndexByRegisterCode [kNumRegisters]
 

Additional Inherited Members

- Public Types inherited from v8::internal::CPURegister
enum  RegisterType { kInvalid = 0 , kRegister , kFPRegister , kNoRegister }
 

Detailed Description

Definition at line 94 of file assembler-arm.h.

Constructor & Destructor Documentation

◆ Register() [1/3]

v8::internal::Register::Register ( )
inline

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

References v8::internal::CPURegister::kNoRegister, v8::internal::CPURegister::reg_code, v8::internal::CPURegister::reg_size, and v8::internal::CPURegister::reg_type.

Referenced by Create().

+ Here is the caller graph for this function:

◆ Register() [2/3]

v8::internal::Register::Register ( const CPURegister r)
inlineexplicit

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

105  {
106  reg_code = r.reg_code;
107  reg_size = r.reg_size;
108  reg_type = r.reg_type;
110  }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, v8::internal::CPURegister::IsValidOrNone(), v8::internal::CPURegister::reg_code, v8::internal::CPURegister::reg_size, and v8::internal::CPURegister::reg_type.

+ Here is the call graph for this function:

◆ Register() [3/3]

v8::internal::Register::Register ( const Register r)
inline

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

112  { // NOLINT(runtime/explicit)
113  reg_code = r.reg_code;
114  reg_size = r.reg_size;
115  reg_type = r.reg_type;
117  }

References DCHECK, v8::internal::CPURegister::IsValidOrNone(), v8::internal::CPURegister::reg_code, v8::internal::CPURegister::reg_size, and v8::internal::CPURegister::reg_type.

+ Here is the call graph for this function:

Member Function Documentation

◆ AllocationIndexToString() [1/7]

const char * v8::internal::Register::AllocationIndexToString ( int  index)
inlinestatic

Definition at line 112 of file assembler-arm.h.

112  {
113  DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters);
114  const char* const names[] = {
115  "r0",
116  "r1",
117  "r2",
118  "r3",
119  "r4",
120  "r5",
121  "r6",
122  "r7",
123  "r8",
124  };
125  if (FLAG_enable_ool_constant_pool && (index >= 7)) {
126  return names[index + 1];
127  }
128  return names[index];
129  }
static const int kMaxNumAllocatableRegisters
Definition: assembler-arm.h:96

References DCHECK, and kMaxNumAllocatableRegisters.

Referenced by v8::internal::compiler::operator<<(), and v8::internal::LOperand::PrintTo().

+ Here is the caller graph for this function:

◆ AllocationIndexToString() [2/7]

static const char* v8::internal::Register::AllocationIndexToString ( int  index)
inlinestatic

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

184  {
185  DCHECK((index >= 0) && (index < NumAllocatableRegisters()));
187  (kAllocatableLowRangeEnd == 15) &&
188  (kAllocatableHighRangeBegin == 18) &&
189  (kAllocatableHighRangeEnd == 24) &&
190  (kAllocatableContext == 27));
191  const char* const names[] = {
192  "x0", "x1", "x2", "x3", "x4",
193  "x5", "x6", "x7", "x8", "x9",
194  "x10", "x11", "x12", "x13", "x14",
195  "x15", "x18", "x19", "x20", "x21",
196  "x22", "x23", "x24", "x27",
197  };
198  return names[index];
199  }
static const unsigned kAllocatableHighRangeBegin
static const unsigned kAllocatableLowRangeEnd
static const unsigned kAllocatableHighRangeEnd
static int NumAllocatableRegisters()
static const unsigned kAllocatableContext
static const unsigned kAllocatableLowRangeBegin

References DCHECK, kAllocatableContext, kAllocatableHighRangeBegin, kAllocatableHighRangeEnd, kAllocatableLowRangeBegin, kAllocatableLowRangeEnd, and NumAllocatableRegisters().

+ Here is the call graph for this function:

◆ AllocationIndexToString() [3/7]

static const char* v8::internal::Register::AllocationIndexToString ( int  index)
inlinestatic

◆ AllocationIndexToString() [4/7]

static const char* v8::internal::Register::AllocationIndexToString ( int  index)
inlinestatic

Definition at line 107 of file assembler-mips.h.

107  {
108  DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters);
109  const char* const names[] = {
110  "v0",
111  "v1",
112  "a0",
113  "a1",
114  "a2",
115  "a3",
116  "t0",
117  "t1",
118  "t2",
119  "t3",
120  "t4",
121  "t5",
122  "t6",
123  "s7",
124  };
125  return names[index];
126  }

References DCHECK, and kMaxNumAllocatableRegisters.

◆ AllocationIndexToString() [5/7]

static const char* v8::internal::Register::AllocationIndexToString ( int  index)
inlinestatic

Definition at line 96 of file assembler-mips64.h.

96  {
97  DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters);
98  const char* const names[] = {
99  "v0",
100  "v1",
101  "a0",
102  "a1",
103  "a2",
104  "a3",
105  "a4",
106  "a5",
107  "a6",
108  "a7",
109  "t0",
110  "t1",
111  "t2",
112  "s7",
113  };
114  return names[index];
115  }

References DCHECK, and kMaxNumAllocatableRegisters.

◆ AllocationIndexToString() [6/7]

static const char* v8::internal::Register::AllocationIndexToString ( int  index)
inlinestatic

Definition at line 92 of file assembler-x64.h.

92  {
93  DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters);
94  const char* const names[] = {
95  "rax",
96  "rbx",
97  "rdx",
98  "rcx",
99  "rsi",
100  "rdi",
101  "r8",
102  "r9",
103  "r11",
104  "r14",
105  "r15"
106  };
107  return names[index];
108  }

References DCHECK, and kMaxNumAllocatableRegisters.

◆ AllocationIndexToString() [7/7]

static const char* v8::internal::Register::AllocationIndexToString ( int  index)
inlinestatic

◆ bit() [1/6]

int v8::internal::Register::bit ( ) const
inline

Definition at line 142 of file assembler-arm.h.

142  {
143  DCHECK(is_valid());
144  return 1 << code_;
145  }

References code_, DCHECK, and is_valid().

Referenced by v8::internal::compiler::ArmLinkageHelperTraits::CCalleeSaveRegisters(), v8::internal::compiler::IA32LinkageHelperTraits::CCalleeSaveRegisters(), v8::internal::compiler::X64LinkageHelperTraits::CCalleeSaveRegisters(), v8::internal::MacroAssembler::Pop(), v8::internal::MacroAssembler::Push(), v8::internal::RecordWriteStub::RegisterAllocation::RestoreCallerSaveRegisters(), and v8::internal::RecordWriteStub::RegisterAllocation::SaveCallerSaveRegisters().

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

◆ bit() [2/6]

int v8::internal::Register::bit ( ) const
inline

Definition at line 94 of file assembler-ia32.h.

94  {
95  DCHECK(is_valid());
96  return 1 << code_;
97  }

References code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ bit() [3/6]

int v8::internal::Register::bit ( ) const
inline

Definition at line 139 of file assembler-mips.h.

139  {
140  DCHECK(is_valid());
141  return 1 << code_;
142  }

References code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ bit() [4/6]

int v8::internal::Register::bit ( ) const
inline

Definition at line 128 of file assembler-mips64.h.

128  {
129  DCHECK(is_valid());
130  return 1 << code_;
131  }

References code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ bit() [5/6]

int v8::internal::Register::bit ( ) const
inline

Definition at line 122 of file assembler-x64.h.

122  {
123  return 1 << code_;
124  }

References code_.

◆ bit() [6/6]

int v8::internal::Register::bit ( ) const
inline

Definition at line 94 of file assembler-x87.h.

94  {
95  DCHECK(is_valid());
96  return 1 << code_;
97  }

References code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ code() [1/6]

int v8::internal::Register::code ( ) const
inline

◆ code() [2/6]

int v8::internal::Register::code ( ) const
inline

Definition at line 90 of file assembler-ia32.h.

90  {
91  DCHECK(is_valid());
92  return code_;
93  }

References code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ code() [3/6]

int v8::internal::Register::code ( ) const
inline

Definition at line 135 of file assembler-mips.h.

135  {
136  DCHECK(is_valid());
137  return code_;
138  }

References code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ code() [4/6]

int v8::internal::Register::code ( ) const
inline

Definition at line 124 of file assembler-mips64.h.

124  {
125  DCHECK(is_valid());
126  return code_;
127  }

References code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ code() [5/6]

int v8::internal::Register::code ( ) const
inline

Definition at line 118 of file assembler-x64.h.

118  {
119  DCHECK(is_valid());
120  return code_;
121  }

References code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ code() [6/6]

int v8::internal::Register::code ( ) const
inline

Definition at line 90 of file assembler-x87.h.

90  {
91  DCHECK(is_valid());
92  return code_;
93  }

References code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ Create()

static Register v8::internal::Register::Create ( unsigned  code,
unsigned  size 
)
inlinestatic

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

95  {
97  }
enable harmony numeric enable harmony object literal extensions Optimize object size
static CPURegister Create(unsigned code, unsigned size, RegisterType type)

References code(), v8::internal::CPURegister::Create(), v8::internal::CPURegister::kRegister, Register(), and size.

Referenced by from_code(), WRegFromCode(), and XRegFromCode().

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

◆ from_code() [1/7]

static Register v8::internal::Register::from_code ( int  code)
inlinestatic

Definition at line 131 of file assembler-arm.h.

131  {
132  Register r = { code };
133  return r;
134  }

References code().

Referenced by v8::internal::RecordWriteStub::address(), v8::internal::DoubleToIStub::destination(), v8::internal::NameDictionaryLookupStub::dictionary(), FromAllocationIndex(), v8::internal::NameDictionaryLookupStub::index(), v8::internal::RecordWriteStub::object(), v8::internal::NameDictionaryLookupStub::result(), v8::internal::WriteInt32ToHeapNumberStub::scratch(), v8::internal::WriteInt32ToHeapNumberStub::sign(), v8::internal::DoubleToIStub::source(), v8::internal::WriteInt32ToHeapNumberStub::the_heap_number(), v8::internal::WriteInt32ToHeapNumberStub::the_int(), ToAllocationIndex(), and v8::internal::RecordWriteStub::value().

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

◆ from_code() [2/7]

static Register v8::internal::Register::from_code ( int  code)
inlinestatic

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

213  {
214  // Always return an X register.
216  }
const unsigned kXRegSizeInBits
static Register Create(unsigned code, unsigned size)

References code(), Create(), and v8::internal::kXRegSizeInBits.

+ Here is the call graph for this function:

◆ from_code() [3/7]

static Register v8::internal::Register::from_code ( int  code)
inlinestatic

Definition at line 80 of file assembler-ia32.h.

80  {
81  DCHECK(code >= 0);
83  Register r = { code };
84  return r;
85  }
static const int kNumRegisters
Definition: assembler-arm.h:95

References code(), DCHECK, and kNumRegisters.

+ Here is the call graph for this function:

◆ from_code() [4/7]

static Register v8::internal::Register::from_code ( int  code)
inlinestatic

Definition at line 128 of file assembler-mips.h.

128  {
129  Register r = { code };
130  return r;
131  }

References code().

+ Here is the call graph for this function:

◆ from_code() [5/7]

static Register v8::internal::Register::from_code ( int  code)
inlinestatic

Definition at line 117 of file assembler-mips64.h.

117  {
118  Register r = { code };
119  return r;
120  }

References code().

+ Here is the call graph for this function:

◆ from_code() [6/7]

static Register v8::internal::Register::from_code ( int  code)
inlinestatic

Definition at line 110 of file assembler-x64.h.

110  {
111  Register r = { code };
112  return r;
113  }

References code().

+ Here is the call graph for this function:

◆ from_code() [7/7]

static Register v8::internal::Register::from_code ( int  code)
inlinestatic

Definition at line 80 of file assembler-x87.h.

80  {
81  DCHECK(code >= 0);
83  Register r = { code };
84  return r;
85  }

References code(), DCHECK, and kNumRegisters.

+ Here is the call graph for this function:

◆ FromAllocationIndex() [1/7]

Register v8::internal::Register::FromAllocationIndex ( int  index)
inlinestatic

Definition at line 107 of file assembler-arm.h.

107  {
108  DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters);
109  return from_code(index);
110  }
static Register from_code(int code)

References DCHECK, from_code(), and kMaxNumAllocatableRegisters.

Referenced by v8::internal::RecordWriteStub::RegisterAllocation::GetRegThatIsNotEcxOr(), v8::internal::RecordWriteStub::RegisterAllocation::GetRegThatIsNotRcxOr(), v8::internal::compiler::InstructionOperandConverter::ToRegister(), and v8::internal::LCodeGen::ToRegister().

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

◆ FromAllocationIndex() [2/7]

static Register v8::internal::Register::FromAllocationIndex ( int  index)
inlinestatic

◆ FromAllocationIndex() [3/7]

static Register v8::internal::Register::FromAllocationIndex ( int  index)
inlinestatic

Definition at line 100 of file assembler-mips.h.

100  {
101  DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters);
102  return index == kMaxNumAllocatableRegisters - 1 ?
103  from_code(kCpRegister) : // Last index is always the 'cp' register.
104  from_code(index + 2); // zero_reg and 'at' are skipped.
105  }
static const int kCpRegister

References DCHECK, from_code(), kCpRegister, and kMaxNumAllocatableRegisters.

+ Here is the call graph for this function:

◆ FromAllocationIndex() [4/7]

static Register v8::internal::Register::FromAllocationIndex ( int  index)
inlinestatic

Definition at line 89 of file assembler-mips64.h.

89  {
90  DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters);
91  return index == kMaxNumAllocatableRegisters - 1 ?
92  from_code(kCpRegister) : // Last index is always the 'cp' register.
93  from_code(index + 2); // zero_reg and 'at' are skipped.
94  }

References DCHECK, from_code(), kCpRegister, and kMaxNumAllocatableRegisters.

+ Here is the call graph for this function:

◆ FromAllocationIndex() [5/7]

static Register v8::internal::Register::FromAllocationIndex ( int  index)
inlinestatic

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

86  {
87  DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters);
88  Register result = { kRegisterCodeByAllocationIndex[index] };
89  return result;
90  }
static const int kRegisterCodeByAllocationIndex[kMaxNumAllocatableRegisters]

References DCHECK, kMaxNumAllocatableRegisters, and kRegisterCodeByAllocationIndex.

◆ FromAllocationIndex() [6/7]

static Register v8::internal::Register::FromAllocationIndex ( int  index)
inlinestatic

◆ FromAllocationIndex() [7/7]

static Register v8::internal::Register::FromAllocationIndex ( unsigned  index)
inlinestatic

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

171  {
172  DCHECK(index < static_cast<unsigned>(NumAllocatableRegisters()));
173  // cp is the last allocatable register.
174  if (index == (static_cast<unsigned>(NumAllocatableRegisters() - 1))) {
176  }
177 
178  // Handle low and high ranges.
179  return (index <= kAllocatableLowRangeEnd)
180  ? from_code(index)
182  }
static const int kAllocatableRangeGapSize

References DCHECK, from_code(), kAllocatableContext, kAllocatableLowRangeEnd, kAllocatableRangeGapSize, and NumAllocatableRegisters().

+ Here is the call graph for this function:

◆ high_bit()

int v8::internal::Register::high_bit ( ) const
inline

Definition at line 128 of file assembler-x64.h.

128  {
129  return code_ >> 3;
130  }

References code_.

Referenced by v8::internal::MacroAssembler::CallSize(), v8::internal::Assembler::emit_optional_rex_32(), v8::internal::Assembler::emit_rex_32(), and v8::internal::Assembler::emit_rex_64().

+ Here is the caller graph for this function:

◆ is() [1/6]

bool v8::internal::Register::is ( Register  reg) const
inline

Definition at line 137 of file assembler-arm.h.

137 { return code_ == reg.code_; }

References code_.

Referenced by v8::internal::LCodeGen::BuildSeqStringOperand(), v8::internal::MacroAssembler::CmovX(), v8::internal::LCodeGen::DoDeferredInstanceOfKnownGlobal(), v8::internal::LCodeGen::DoDeferredMathAbsTagged(), v8::internal::LCodeGen::DoDeferredMathAbsTaggedHeapNumber(), v8::internal::LCodeGen::DoDeferredNumberTagIU(), v8::internal::LCodeGen::DoDeferredTaggedToI(), v8::internal::LCodeGen::EmitClassOfTest(), v8::internal::LCodeGen::EmitIsConstructCall(), v8::internal::LCodeGen::EmitVectorLoadICRegisters(), v8::internal::RecordWriteStub::RegisterAllocation::GetRegThatIsNotEcxOr(), v8::internal::RecordWriteStub::RegisterAllocation::GetRegThatIsNotRcxOr(), v8::internal::CodeStubDescriptor::IsEnvironmentParameterCountRegister(), v8::internal::MacroAssembler::Move(), v8::internal::MacroAssembler::Pop(), v8::internal::MacroAssembler::Push(), v8::internal::RecordWriteStub::RegisterAllocation::RegisterAllocation(), v8::internal::RecordWriteStub::RegisterAllocation::Restore(), v8::internal::RecordWriteStub::RegisterAllocation::RestoreCallerSaveRegisters(), v8::internal::RecordWriteStub::RegisterAllocation::Save(), v8::internal::RecordWriteStub::RegisterAllocation::SaveCallerSaveRegisters(), v8::internal::StringCharCodeAtGenerator::StringCharCodeAtGenerator(), and v8::internal::StringCharFromCodeGenerator::StringCharFromCodeGenerator().

+ Here is the caller graph for this function:

◆ is() [2/6]

bool v8::internal::Register::is ( Register  reg) const
inline

Definition at line 87 of file assembler-ia32.h.

87 { return code_ == reg.code_; }

References code_.

◆ is() [3/6]

bool v8::internal::Register::is ( Register  reg) const
inline

Definition at line 134 of file assembler-mips.h.

134 { return code_ == reg.code_; }

References code_.

◆ is() [4/6]

bool v8::internal::Register::is ( Register  reg) const
inline

Definition at line 123 of file assembler-mips64.h.

123 { return code_ == reg.code_; }

References code_.

◆ is() [5/6]

bool v8::internal::Register::is ( Register  reg) const
inline

Definition at line 115 of file assembler-x64.h.

115 { return code_ == reg.code_; }

References code_.

◆ is() [6/6]

bool v8::internal::Register::is ( Register  reg) const
inline

Definition at line 87 of file assembler-x87.h.

87 { return code_ == reg.code_; }

References code_.

◆ is_byte_register() [1/3]

bool v8::internal::Register::is_byte_register ( ) const
inline

Definition at line 89 of file assembler-ia32.h.

89 { return code_ <= 3; }

References code_.

◆ is_byte_register() [2/3]

bool v8::internal::Register::is_byte_register ( ) const
inline

Definition at line 117 of file assembler-x64.h.

117 { return code_ <= 3; }

References code_.

◆ is_byte_register() [3/3]

bool v8::internal::Register::is_byte_register ( ) const
inline

Definition at line 89 of file assembler-x87.h.

89 { return code_ <= 3; }

References code_.

◆ is_valid() [1/6]

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

Definition at line 136 of file assembler-arm.h.

136 { return 0 <= code_ && code_ < kNumRegisters; }

References code_, and kNumRegisters.

Referenced by bit(), v8::internal::CodeStubGraphBuilderBase::BuildGraph(), code(), v8::internal::Deoptimizer::DoComputeCompiledStubFrame(), v8::internal::DoGenerateCode(), set_code(), and v8::internal::CodeStubDescriptor::SetMissHandler().

+ Here is the caller graph for this function:

◆ is_valid() [2/6]

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

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

86 { return 0 <= code_ && code_ < kNumRegisters; }

References code_, and kNumRegisters.

◆ is_valid() [3/6]

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

Definition at line 133 of file assembler-mips.h.

133 { return 0 <= code_ && code_ < kNumRegisters; }

References code_, and kNumRegisters.

◆ is_valid() [4/6]

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

Definition at line 122 of file assembler-mips64.h.

122 { return 0 <= code_ && code_ < kNumRegisters; }

References code_, and kNumRegisters.

◆ is_valid() [5/6]

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

Definition at line 114 of file assembler-x64.h.

114 { return 0 <= code_ && code_ < kNumRegisters; }

References code_, and kNumRegisters.

◆ is_valid() [6/6]

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

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

86 { return 0 <= code_ && code_ < kNumRegisters; }

References code_, and kNumRegisters.

◆ IsAllocatable()

bool v8::internal::Register::IsAllocatable ( ) const
inline

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

164  {
165  return ((reg_code == kAllocatableContext) ||
169  }

References kAllocatableContext, kAllocatableHighRangeBegin, kAllocatableHighRangeEnd, kAllocatableLowRangeEnd, and v8::internal::CPURegister::reg_code.

Referenced by ToAllocationIndex().

+ Here is the caller graph for this function:

◆ IsValid()

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

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

119  {
120  DCHECK(IsRegister() || IsNone());
121  return IsValidRegister();
122  }

References DCHECK, v8::internal::CPURegister::IsNone(), v8::internal::CPURegister::IsRegister(), and v8::internal::CPURegister::IsValidRegister().

Referenced by v8::internal::Operand::IsExtendedRegister(), v8::internal::Operand::IsShiftedRegister(), and v8::internal::Operand::Operand().

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

◆ low_bits()

int v8::internal::Register::low_bits ( ) const
inline

Definition at line 133 of file assembler-x64.h.

133  {
134  return code_ & 0x7;
135  }

References code_.

◆ NumAllocatableRegisters() [1/7]

int v8::internal::Register::NumAllocatableRegisters ( )
inlinestatic

Definition at line 53 of file assembler-arm-inl.h.

53  {
55 }

References kMaxNumAllocatableRegisters.

Referenced by AllocationIndexToString(), FromAllocationIndex(), v8::internal::RecordWriteStub::RegisterAllocation::GetRegThatIsNotEcxOr(), v8::internal::RecordWriteStub::RegisterAllocation::GetRegThatIsNotRcxOr(), and ToAllocationIndex().

+ Here is the caller graph for this function:

◆ NumAllocatableRegisters() [2/7]

static int v8::internal::Register::NumAllocatableRegisters ( )
inlinestatic

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

161 { return kMaxNumAllocatableRegisters; }

References kMaxNumAllocatableRegisters.

◆ NumAllocatableRegisters() [3/7]

static int v8::internal::Register::NumAllocatableRegisters ( )
inlinestatic

Definition at line 69 of file assembler-ia32.h.

69  {
71  }

References kMaxNumAllocatableRegisters.

◆ NumAllocatableRegisters() [4/7]

static int v8::internal::Register::NumAllocatableRegisters ( )
inlinestatic

◆ NumAllocatableRegisters() [5/7]

static int v8::internal::Register::NumAllocatableRegisters ( )
inlinestatic

◆ NumAllocatableRegisters() [6/7]

static int v8::internal::Register::NumAllocatableRegisters ( )
inlinestatic

Definition at line 77 of file assembler-x64.h.

77  {
79  }

References kMaxNumAllocatableRegisters.

◆ NumAllocatableRegisters() [7/7]

static int v8::internal::Register::NumAllocatableRegisters ( )
inlinestatic

Definition at line 69 of file assembler-x87.h.

69  {
71  }

References kMaxNumAllocatableRegisters.

◆ NumRegisters()

static int v8::internal::Register::NumRegisters ( )
inlinestatic

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

132 { return kNumRegisters; }

References kNumRegisters.

◆ set_code()

void v8::internal::Register::set_code ( int  code)
inline

Definition at line 147 of file assembler-arm.h.

147  {
148  code_ = code;
149  DCHECK(is_valid());
150  }

References code(), code_, DCHECK, and is_valid().

+ Here is the call graph for this function:

◆ ToAllocationIndex() [1/7]

int v8::internal::Register::ToAllocationIndex ( Register  reg)
inlinestatic

Definition at line 102 of file assembler-arm.h.

102  {
103  DCHECK(reg.code() < kMaxNumAllocatableRegisters);
104  return reg.code();
105  }

References code(), DCHECK, and kMaxNumAllocatableRegisters.

Referenced by v8::internal::compiler::OperandGenerator::DefineAsFixed(), v8::internal::compiler::LinkageHelper< LinkageTraits >::regloc(), v8::internal::compiler::OperandGenerator::TempRegister(), v8::internal::compiler::FINAL< kOperandKind, kNumCachedOperands >::TempRegister(), and v8::internal::compiler::OperandGenerator::UseFixed().

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

◆ ToAllocationIndex() [2/7]

static int v8::internal::Register::ToAllocationIndex ( Register  reg)
inlinestatic

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

201  {
202  DCHECK(reg.IsAllocatable());
203  unsigned code = reg.code();
204  if (code == kAllocatableContext) {
205  return NumAllocatableRegisters() - 1;
206  }
207 
208  return (code <= kAllocatableLowRangeEnd)
209  ? code
211  }

References code(), DCHECK, IsAllocatable(), kAllocatableContext, kAllocatableLowRangeEnd, kAllocatableRangeGapSize, and NumAllocatableRegisters().

+ Here is the call graph for this function:

◆ ToAllocationIndex() [3/7]

static int v8::internal::Register::ToAllocationIndex ( Register  reg)
inlinestatic

◆ ToAllocationIndex() [4/7]

static int v8::internal::Register::ToAllocationIndex ( Register  reg)
inlinestatic

Definition at line 92 of file assembler-mips.h.

92  {
93  DCHECK((reg.code() - 2) < (kMaxNumAllocatableRegisters - 1) ||
94  reg.is(from_code(kCpRegister)));
95  return reg.is(from_code(kCpRegister)) ?
96  kMaxNumAllocatableRegisters - 1 : // Return last index for 'cp'.
97  reg.code() - 2; // zero_reg and 'at' are skipped.
98  }

References DCHECK, from_code(), kCpRegister, and kMaxNumAllocatableRegisters.

+ Here is the call graph for this function:

◆ ToAllocationIndex() [5/7]

static int v8::internal::Register::ToAllocationIndex ( Register  reg)
inlinestatic

Definition at line 81 of file assembler-mips64.h.

81  {
82  DCHECK((reg.code() - 2) < (kMaxNumAllocatableRegisters - 1) ||
83  reg.is(from_code(kCpRegister)));
84  return reg.is(from_code(kCpRegister)) ?
85  kMaxNumAllocatableRegisters - 1 : // Return last index for 'cp'.
86  reg.code() - 2; // zero_reg and 'at' are skipped.
87  }

References DCHECK, from_code(), kCpRegister, and kMaxNumAllocatableRegisters.

+ Here is the call graph for this function:

◆ ToAllocationIndex() [6/7]

static int v8::internal::Register::ToAllocationIndex ( Register  reg)
inlinestatic

Definition at line 82 of file assembler-x64.h.

82  {
83  return kAllocationIndexByRegisterCode[reg.code()];
84  }
static const int kAllocationIndexByRegisterCode[kNumRegisters]

References kAllocationIndexByRegisterCode.

◆ ToAllocationIndex() [7/7]

static int v8::internal::Register::ToAllocationIndex ( Register  reg)
inlinestatic

◆ WRegFromCode()

Register v8::internal::Register::WRegFromCode ( unsigned  code)
inlinestatic

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

218  {
219  if (code == kSPRegInternalCode) {
220  return wcsp;
221  } else {
224  }
225 }
const unsigned kSPRegInternalCode
const unsigned kWRegSizeInBits
const unsigned kNumberOfRegisters

References code(), Create(), DCHECK, v8::internal::kNumberOfRegisters, v8::internal::kSPRegInternalCode, and v8::internal::kWRegSizeInBits.

Referenced by v8::internal::CPURegister::W().

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

◆ XRegFromCode()

Register v8::internal::Register::XRegFromCode ( unsigned  code)
inlinestatic

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

208  {
209  if (code == kSPRegInternalCode) {
210  return csp;
211  } else {
214  }
215 }

References code(), Create(), DCHECK, v8::internal::kNumberOfRegisters, v8::internal::kSPRegInternalCode, and v8::internal::kXRegSizeInBits.

Referenced by v8::internal::Assembler::nop(), and v8::internal::CPURegister::X().

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

Member Data Documentation

◆ code_

int v8::internal::Register::code_

Definition at line 153 of file assembler-arm.h.

Referenced by bit(), code(), high_bit(), is(), is_byte_register(), is_valid(), low_bits(), and set_code().

◆ kAllocatableContext

const unsigned v8::internal::Register::kAllocatableContext = 27
static

◆ kAllocatableHighRangeBegin

const unsigned v8::internal::Register::kAllocatableHighRangeBegin = 18
static

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

Referenced by AllocationIndexToString(), and IsAllocatable().

◆ kAllocatableHighRangeEnd

const unsigned v8::internal::Register::kAllocatableHighRangeEnd = 24
static

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

Referenced by AllocationIndexToString(), and IsAllocatable().

◆ kAllocatableLowRangeBegin

const unsigned v8::internal::Register::kAllocatableLowRangeBegin = 0
static

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

Referenced by AllocationIndexToString().

◆ kAllocatableLowRangeEnd

const unsigned v8::internal::Register::kAllocatableLowRangeEnd = 15
static

◆ kAllocatableRangeGapSize

const int v8::internal::Register::kAllocatableRangeGapSize
static
Initial value:

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

Referenced by FromAllocationIndex(), and ToAllocationIndex().

◆ kAllocationIndexByRegisterCode

const int v8::internal::Register::kAllocationIndexByRegisterCode[kNumRegisters]
staticprivate

Definition at line 143 of file assembler-x64.h.

Referenced by ToAllocationIndex().

◆ kCpRegister

static const int v8::internal::Register::kCpRegister = 23
static

Definition at line 78 of file assembler-mips.h.

Referenced by FromAllocationIndex(), and ToAllocationIndex().

◆ kMaxNumAllocatableRegisters

static const int v8::internal::Register::kMaxNumAllocatableRegisters
static
Initial value:
=
FLAG_enable_ool_constant_pool ? 8 : 9

Definition at line 96 of file assembler-arm.h.

Referenced by AllocationIndexToString(), FromAllocationIndex(), NumAllocatableRegisters(), v8::internal::LOperand::PrintTo(), and ToAllocationIndex().

◆ kNumRegisters

static const int v8::internal::Register::kNumRegisters = 16
static

◆ kRegisterCodeByAllocationIndex

const int v8::internal::Register::kRegisterCodeByAllocationIndex[kMaxNumAllocatableRegisters]
staticprivate

Definition at line 142 of file assembler-x64.h.

Referenced by FromAllocationIndex().

◆ kSizeInBytes

static const int v8::internal::Register::kSizeInBytes = 4
static

Definition at line 98 of file assembler-arm.h.


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