V8 Project
v8::internal::Operand Class Reference

#include <assembler-arm64.h>

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

Public Member Functions

 Operand (Register reg, Shift shift=LSL, unsigned shift_amount=0)
 
 Operand (Register reg, Extend extend, unsigned shift_amount=0)
 
template<typename T >
 Operand (Handle< T > handle)
 
template<typename T >
 Operand (T t)
 
template<typename T >
 Operand (T t, RelocInfo::Mode rmode)
 
bool IsImmediate () const
 
bool IsShiftedRegister () const
 
bool IsExtendedRegister () const
 
bool IsZero () const
 
Operand ToExtendedRegister () const
 
Immediate immediate () const
 
int64_t ImmediateValue () const
 
Register reg () const
 
Shift shift () const
 
Extend extend () const
 
unsigned shift_amount () const
 
bool NeedsRelocation (const Assembler *assembler) const
 

Static Public Member Functions

static Operand UntagSmi (Register smi)
 
static Operand UntagSmiAndScale (Register smi, int scale)
 

Private Attributes

Immediate immediate_
 
Register reg_
 
Shift shift_
 
Extend extend_
 
unsigned shift_amount_
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Operand() [1/5]

v8::internal::Operand::Operand ( Register  reg,
Shift  shift = LSL,
unsigned  shift_amount = 0 
)
inline

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

339  : immediate_(0),
340  reg_(reg),
341  shift_(shift),
346  DCHECK(!reg.IsSP());
347 }
unsigned shift_amount() const
#define DCHECK(condition)
Definition: logging.h:205
const unsigned kXRegSizeInBits
const unsigned kWRegSizeInBits

References DCHECK, v8::internal::CPURegister::Is32Bits(), v8::internal::CPURegister::Is64Bits(), v8::internal::CPURegister::IsSP(), v8::internal::kWRegSizeInBits, v8::internal::kXRegSizeInBits, reg(), and shift_amount().

Referenced by v8::internal::BASE_EMBEDDED< Visitor >::ForCell(), v8::internal::BASE_EMBEDDED< Visitor >::ForRegisterPlusImmediate(), v8::internal::BASE_EMBEDDED< Visitor >::INLINE(), v8::internal::MemOperand::OffsetAsOperand(), v8::internal::BASE_EMBEDDED< Visitor >::StaticArray(), v8::internal::BASE_EMBEDDED< Visitor >::StaticVariable(), ToExtendedRegister(), UntagSmi(), and UntagSmiAndScale().

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

◆ Operand() [2/5]

v8::internal::Operand::Operand ( Register  reg,
Extend  extend,
unsigned  shift_amount = 0 
)
inline

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

351  : immediate_(0),
352  reg_(reg),
353  shift_(NO_SHIFT),
354  extend_(extend),
356  DCHECK(reg.IsValid());
357  DCHECK(shift_amount <= 4);
358  DCHECK(!reg.IsSP());
359 
360  // Extend modes SXTX and UXTX require a 64-bit register.
361  DCHECK(reg.Is64Bits() || ((extend != SXTX) && (extend != UXTX)));
362 }

References DCHECK, extend(), v8::internal::CPURegister::Is64Bits(), v8::internal::CPURegister::IsSP(), v8::internal::Register::IsValid(), reg(), shift_amount(), v8::internal::SXTX, and v8::internal::UXTX.

+ Here is the call graph for this function:

◆ Operand() [3/5]

template<typename T >
v8::internal::Operand::Operand ( Handle< T handle)
inlineexplicit

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

325 : immediate_(value), reg_(NoReg) {}

◆ Operand() [4/5]

template<typename T >
v8::internal::Operand::Operand ( T  t)
inline

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

329 : immediate_(t), reg_(NoReg) {}

◆ Operand() [5/5]

template<typename T >
v8::internal::Operand::Operand ( T  t,
RelocInfo::Mode  rmode 
)
inline

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

334  : immediate_(t, rmode),
335  reg_(NoReg) {}

Member Function Documentation

◆ extend()

Extend v8::internal::Operand::extend ( ) const
inline

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

420  {
422  return extend_;
423 }

References DCHECK, extend_, and IsExtendedRegister().

Referenced by Operand().

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

◆ immediate()

Immediate v8::internal::Operand::immediate ( ) const
inline

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

396  {
397  DCHECK(IsImmediate());
398  return immediate_;
399 }

References DCHECK, immediate_, and IsImmediate().

+ Here is the call graph for this function:

◆ ImmediateValue()

int64_t v8::internal::Operand::ImmediateValue ( ) const
inline

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

402  {
403  DCHECK(IsImmediate());
404  return immediate_.value();
405 }

References DCHECK, immediate_, IsImmediate(), and v8::internal::Immediate::value().

Referenced by v8::internal::MacroAssembler::Add(), v8::internal::MacroAssembler::Adds(), v8::internal::MacroAssembler::Ccmn(), v8::internal::MacroAssembler::Ccmp(), v8::internal::MacroAssembler::CompareAndBranch(), IsZero(), v8::internal::MacroAssembler::Neg(), v8::internal::MacroAssembler::Sub(), and v8::internal::MacroAssembler::Subs().

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

◆ IsExtendedRegister()

bool v8::internal::Operand::IsExtendedRegister ( ) const
inline

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

375  {
376  return reg_.IsValid() && (extend_ != NO_EXTEND);
377 }

References extend_, v8::internal::Register::IsValid(), v8::internal::NO_EXTEND, and reg_.

Referenced by extend(), reg(), and shift_amount().

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

◆ IsImmediate()

bool v8::internal::Operand::IsImmediate ( ) const
inline

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

365  {
366  return reg_.Is(NoReg);
367 }
bool Is(const CPURegister &other) const

References v8::internal::CPURegister::Is(), and reg_.

Referenced by v8::internal::MacroAssembler::Add(), v8::internal::MacroAssembler::Adds(), v8::internal::MacroAssembler::Ccmn(), v8::internal::MacroAssembler::Ccmp(), v8::internal::MacroAssembler::CompareAndBranch(), immediate(), ImmediateValue(), IsZero(), v8::internal::MacroAssembler::Neg(), v8::internal::MacroAssembler::Sub(), and v8::internal::MacroAssembler::Subs().

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

◆ IsShiftedRegister()

bool v8::internal::Operand::IsShiftedRegister ( ) const
inline

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

370  {
371  return reg_.IsValid() && (shift_ != NO_SHIFT);
372 }

References v8::internal::Register::IsValid(), v8::internal::NO_SHIFT, reg_, and shift_.

Referenced by reg(), shift(), shift_amount(), and ToExtendedRegister().

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

◆ IsZero()

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

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

380  {
381  if (IsImmediate()) {
382  return ImmediateValue() == 0;
383  } else {
384  return reg().IsZero();
385  }
386 }
int64_t ImmediateValue() const

References ImmediateValue(), IsImmediate(), v8::internal::CPURegister::IsZero(), and reg().

+ Here is the call graph for this function:

◆ NeedsRelocation()

bool v8::internal::Operand::NeedsRelocation ( const Assembler assembler) const

◆ reg()

Register v8::internal::Operand::reg ( ) const
inline

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

408  {
410  return reg_;
411 }

References DCHECK, IsExtendedRegister(), IsShiftedRegister(), and reg_.

Referenced by IsZero(), and Operand().

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

◆ shift()

Shift v8::internal::Operand::shift ( ) const
inline

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

414  {
416  return shift_;
417 }

References DCHECK, IsShiftedRegister(), and shift_.

+ Here is the call graph for this function:

◆ shift_amount()

unsigned v8::internal::Operand::shift_amount ( ) const
inline

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

426  {
428  return shift_amount_;
429 }

References DCHECK, IsExtendedRegister(), IsShiftedRegister(), and shift_amount_.

Referenced by Operand().

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

◆ ToExtendedRegister()

Operand v8::internal::Operand::ToExtendedRegister ( ) const
inline

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

389  {
391  DCHECK((shift_ == LSL) && (shift_amount_ <= 4));
392  return Operand(reg_, reg_.Is64Bits() ? UXTX : UXTW, shift_amount_);
393 }
Operand(Register reg, Shift shift=LSL, unsigned shift_amount=0)

References DCHECK, v8::internal::CPURegister::Is64Bits(), IsShiftedRegister(), v8::internal::LSL, Operand(), reg_, shift_, shift_amount_, v8::internal::UXTW, and v8::internal::UXTX.

+ Here is the call graph for this function:

◆ UntagSmi()

Operand v8::internal::Operand::UntagSmi ( Register  smi)
inlinestatic

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

432  {
433  STATIC_ASSERT(kXRegSizeInBits == static_cast<unsigned>(kSmiShift +
434  kSmiValueSize));
435  DCHECK(smi.Is64Bits());
436  return Operand(smi, ASR, kSmiShift);
437 }
const int kSmiShift
const int kSmiValueSize
Definition: v8.h:5806
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))

References v8::internal::ASR, DCHECK, v8::internal::CPURegister::Is64Bits(), v8::internal::kSmiShift, v8::internal::kSmiValueSize, v8::internal::kXRegSizeInBits, Operand(), and v8::internal::STATIC_ASSERT().

+ Here is the call graph for this function:

◆ UntagSmiAndScale()

Operand v8::internal::Operand::UntagSmiAndScale ( Register  smi,
int  scale 
)
inlinestatic

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

440  {
441  STATIC_ASSERT(kXRegSizeInBits == static_cast<unsigned>(kSmiShift +
442  kSmiValueSize));
443  DCHECK(smi.Is64Bits());
444  DCHECK((scale >= 0) && (scale <= (64 - kSmiValueSize)));
445  if (scale > kSmiShift) {
446  return Operand(smi, LSL, scale - kSmiShift);
447  } else if (scale < kSmiShift) {
448  return Operand(smi, ASR, kSmiShift - scale);
449  }
450  return Operand(smi);
451 }

References v8::internal::ASR, DCHECK, v8::internal::CPURegister::Is64Bits(), v8::internal::kSmiShift, v8::internal::kSmiValueSize, v8::internal::kXRegSizeInBits, v8::internal::LSL, Operand(), and v8::internal::STATIC_ASSERT().

Referenced by v8::internal::LCodeGen::PrepareKeyedArrayOperand(), and v8::internal::LCodeGen::PrepareKeyedExternalArrayOperand().

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

Member Data Documentation

◆ extend_

Extend v8::internal::Operand::extend_
private

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

Referenced by extend(), and IsExtendedRegister().

◆ immediate_

Immediate v8::internal::Operand::immediate_
private

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

Referenced by immediate(), and ImmediateValue().

◆ reg_

Register v8::internal::Operand::reg_
private

◆ shift_

Shift v8::internal::Operand::shift_
private

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

Referenced by IsShiftedRegister(), shift(), and ToExtendedRegister().

◆ shift_amount_

unsigned v8::internal::Operand::shift_amount_
private

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

Referenced by shift_amount(), and ToExtendedRegister().


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