V8 Project
v8::internal::compiler::UnallocatedOperand Class Reference

#include <instruction.h>

+ Inheritance diagram for v8::internal::compiler::UnallocatedOperand:
+ Collaboration diagram for v8::internal::compiler::UnallocatedOperand:

Classes

class  BasicPolicyField
 
class  ExtendedPolicyField
 
class  FixedRegisterField
 
class  FixedSlotIndexField
 
class  LifetimeField
 
class  VirtualRegisterField
 

Public Types

enum  BasicPolicy { FIXED_SLOT , EXTENDED_POLICY }
 
enum  ExtendedPolicy {
  NONE , ANY , FIXED_REGISTER , FIXED_DOUBLE_REGISTER ,
  MUST_HAVE_REGISTER , SAME_AS_FIRST_INPUT
}
 
enum  Lifetime { USED_AT_START , USED_AT_END }
 
- Public Types inherited from v8::internal::compiler::InstructionOperand
enum  Kind {
  INVALID , UNALLOCATED , CONSTANT , IMMEDIATE ,
  STACK_SLOT , DOUBLE_STACK_SLOT , REGISTER , DOUBLE_REGISTER
}
 

Public Member Functions

 UnallocatedOperand (ExtendedPolicy policy)
 
 UnallocatedOperand (BasicPolicy policy, int index)
 
 UnallocatedOperand (ExtendedPolicy policy, int index)
 
 UnallocatedOperand (ExtendedPolicy policy, Lifetime lifetime)
 
UnallocatedOperandCopyUnconstrained (Zone *zone)
 
 STATIC_ASSERT (KindField::kSize==3)
 
bool HasAnyPolicy () const
 
bool HasFixedPolicy () const
 
bool HasRegisterPolicy () const
 
bool HasSameAsInputPolicy () const
 
bool HasFixedSlotPolicy () const
 
bool HasFixedRegisterPolicy () const
 
bool HasFixedDoubleRegisterPolicy () const
 
BasicPolicy basic_policy () const
 
ExtendedPolicy extended_policy () const
 
int fixed_slot_index () const
 
int fixed_register_index () const
 
int virtual_register () const
 
void set_virtual_register (unsigned id)
 
bool IsUsedAtStart ()
 
- Public Member Functions inherited from v8::internal::compiler::InstructionOperand
 InstructionOperand ()
 
 InstructionOperand (Kind kind, int index)
 
Kind kind () const
 
int index () const
 
bool Equals (InstructionOperand *other) const
 
void ConvertTo (Kind kind, int index)
 
- Public Member Functions inherited from v8::internal::ZoneObject
 INLINE (void *operator new(size_t size, Zone *zone))
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)
 

Static Public Member Functions

static const UnallocatedOperandcast (const InstructionOperand *op)
 
static UnallocatedOperandcast (InstructionOperand *op)
 
- Static Public Member Functions inherited from v8::internal::compiler::InstructionOperand
static void SetUpCaches ()
 
static void TearDownCaches ()
 

Static Public Attributes

static const int kMaxVirtualRegisters = VirtualRegisterField::kMax + 1
 
static const int kFixedSlotIndexWidth = FixedSlotIndexField::kSize
 
static const int kMaxFixedSlotIndex = (1 << (kFixedSlotIndexWidth - 1)) - 1
 
static const int kMinFixedSlotIndex = -(1 << (kFixedSlotIndexWidth - 1))
 

Additional Inherited Members

- Protected Types inherited from v8::internal::compiler::InstructionOperand
typedef BitField< Kind, 0, 3 > KindField
 
- Protected Attributes inherited from v8::internal::compiler::InstructionOperand
unsigned value_
 

Detailed Description

Definition at line 96 of file instruction.h.

Member Enumeration Documentation

◆ BasicPolicy

◆ ExtendedPolicy

◆ Lifetime

Enumerator
USED_AT_START 
USED_AT_END 

Definition at line 110 of file instruction.h.

110  {
111  // USED_AT_START operand is guaranteed to be live only at
112  // instruction start. Register allocator is free to assign the same register
113  // to some other operand used inside instruction (i.e. temporary or
114  // output).
116 
117  // USED_AT_END operand is treated as live until the end of
118  // instruction. This means that register allocator will not reuse it's
119  // register for any other operand inside instruction.
121  };

Constructor & Destructor Documentation

◆ UnallocatedOperand() [1/4]

v8::internal::compiler::UnallocatedOperand::UnallocatedOperand ( ExtendedPolicy  policy)
inlineexplicit

Definition at line 123 of file instruction.h.

References v8::internal::BitFieldBase< T, shift, size, U >::encode(), EXTENDED_POLICY, USED_AT_END, and v8::internal::compiler::InstructionOperand::value_.

Referenced by CopyUnconstrained().

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

◆ UnallocatedOperand() [2/4]

v8::internal::compiler::UnallocatedOperand::UnallocatedOperand ( BasicPolicy  policy,
int  index 
)
inline

Definition at line 130 of file instruction.h.

132  DCHECK(policy == FIXED_SLOT);
133  value_ |= BasicPolicyField::encode(policy);
135  DCHECK(this->fixed_slot_index() == index);
136  }
static const U kShift
Definition: utils.h:204
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::encode(), FIXED_SLOT, fixed_slot_index(), v8::internal::compiler::InstructionOperand::index(), v8::internal::BitFieldBase< T, shift, size, U >::kShift, and v8::internal::compiler::InstructionOperand::value_.

+ Here is the call graph for this function:

◆ UnallocatedOperand() [3/4]

v8::internal::compiler::UnallocatedOperand::UnallocatedOperand ( ExtendedPolicy  policy,
int  index 
)
inline

Definition at line 138 of file instruction.h.

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::encode(), EXTENDED_POLICY, FIXED_DOUBLE_REGISTER, FIXED_REGISTER, v8::internal::compiler::InstructionOperand::index(), USED_AT_END, and v8::internal::compiler::InstructionOperand::value_.

+ Here is the call graph for this function:

◆ UnallocatedOperand() [4/4]

v8::internal::compiler::UnallocatedOperand::UnallocatedOperand ( ExtendedPolicy  policy,
Lifetime  lifetime 
)
inline

Definition at line 147 of file instruction.h.

References v8::internal::BitFieldBase< T, shift, size, U >::encode(), EXTENDED_POLICY, and v8::internal::compiler::InstructionOperand::value_.

+ Here is the call graph for this function:

Member Function Documentation

◆ basic_policy()

BasicPolicy v8::internal::compiler::UnallocatedOperand::basic_policy ( ) const
inline

Definition at line 236 of file instruction.h.

236 { return BasicPolicyField::decode(value_); }
static T decode(U value)
Definition: utils.h:228

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and v8::internal::compiler::InstructionOperand::value_.

Referenced by extended_policy(), HasAnyPolicy(), HasFixedDoubleRegisterPolicy(), HasFixedPolicy(), HasFixedRegisterPolicy(), HasFixedSlotPolicy(), HasRegisterPolicy(), HasSameAsInputPolicy(), IsUsedAtStart(), and v8::internal::compiler::operator<<().

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

◆ cast() [1/2]

static const UnallocatedOperand* v8::internal::compiler::UnallocatedOperand::cast ( const InstructionOperand op)
inlinestatic

Definition at line 160 of file instruction.h.

160  {
161  DCHECK(op->IsUnallocated());
162  return static_cast<const UnallocatedOperand*>(op);
163  }
UnallocatedOperand(ExtendedPolicy policy)
Definition: instruction.h:123

References DCHECK.

Referenced by v8::internal::compiler::operator<<(), v8::internal::compiler::TARGET_TEST_F(), v8::internal::compiler::TEST_F(), v8::internal::compiler::InstructionSelectorTest::FINAL::ToVreg(), and v8::internal::compiler::UsePosition::UsePosition().

+ Here is the caller graph for this function:

◆ cast() [2/2]

static UnallocatedOperand* v8::internal::compiler::UnallocatedOperand::cast ( InstructionOperand op)
inlinestatic

Definition at line 165 of file instruction.h.

165  {
166  DCHECK(op->IsUnallocated());
167  return static_cast<UnallocatedOperand*>(op);
168  }

References DCHECK.

◆ CopyUnconstrained()

UnallocatedOperand* v8::internal::compiler::UnallocatedOperand::CopyUnconstrained ( Zone zone)
inline

Definition at line 154 of file instruction.h.

154  {
155  UnallocatedOperand* result = new (zone) UnallocatedOperand(ANY);
156  result->set_virtual_register(virtual_register());
157  return result;
158  }

References ANY, set_virtual_register(), UnallocatedOperand(), and virtual_register().

+ Here is the call graph for this function:

◆ extended_policy()

ExtendedPolicy v8::internal::compiler::UnallocatedOperand::extended_policy ( ) const
inline

Definition at line 239 of file instruction.h.

239  {
242  }

References basic_policy(), DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::decode(), EXTENDED_POLICY, and v8::internal::compiler::InstructionOperand::value_.

Referenced by HasAnyPolicy(), HasFixedDoubleRegisterPolicy(), HasFixedPolicy(), HasFixedRegisterPolicy(), HasRegisterPolicy(), HasSameAsInputPolicy(), and v8::internal::compiler::operator<<().

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

◆ fixed_register_index()

int v8::internal::compiler::UnallocatedOperand::fixed_register_index ( ) const
inline

Definition at line 251 of file instruction.h.

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::decode(), HasFixedDoubleRegisterPolicy(), HasFixedRegisterPolicy(), and v8::internal::compiler::InstructionOperand::value_.

Referenced by v8::internal::compiler::operator<<().

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

◆ fixed_slot_index()

int v8::internal::compiler::UnallocatedOperand::fixed_slot_index ( ) const
inline

Definition at line 245 of file instruction.h.

245  {
247  return static_cast<int>(value_) >> FixedSlotIndexField::kShift;
248  }

References DCHECK, HasFixedSlotPolicy(), v8::internal::BitFieldBase< T, shift, size, U >::kShift, and v8::internal::compiler::InstructionOperand::value_.

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

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

◆ HasAnyPolicy()

bool v8::internal::compiler::UnallocatedOperand::HasAnyPolicy ( ) const
inline

Definition at line 209 of file instruction.h.

209  {
210  return basic_policy() == EXTENDED_POLICY && extended_policy() == ANY;
211  }

References ANY, basic_policy(), EXTENDED_POLICY, and extended_policy().

Referenced by v8::internal::compiler::UsePosition::UsePosition().

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

◆ HasFixedDoubleRegisterPolicy()

bool v8::internal::compiler::UnallocatedOperand::HasFixedDoubleRegisterPolicy ( ) const
inline

Definition at line 230 of file instruction.h.

230  {
231  return basic_policy() == EXTENDED_POLICY &&
233  }

References basic_policy(), EXTENDED_POLICY, extended_policy(), and FIXED_DOUBLE_REGISTER.

Referenced by fixed_register_index().

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

◆ HasFixedPolicy()

bool v8::internal::compiler::UnallocatedOperand::HasFixedPolicy ( ) const
inline

Definition at line 212 of file instruction.h.

212  {
213  return basic_policy() == FIXED_SLOT ||
216  }

References basic_policy(), extended_policy(), FIXED_DOUBLE_REGISTER, FIXED_REGISTER, and FIXED_SLOT.

+ Here is the call graph for this function:

◆ HasFixedRegisterPolicy()

bool v8::internal::compiler::UnallocatedOperand::HasFixedRegisterPolicy ( ) const
inline

Definition at line 226 of file instruction.h.

226  {
227  return basic_policy() == EXTENDED_POLICY &&
229  }

References basic_policy(), EXTENDED_POLICY, extended_policy(), and FIXED_REGISTER.

Referenced by fixed_register_index().

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

◆ HasFixedSlotPolicy()

bool v8::internal::compiler::UnallocatedOperand::HasFixedSlotPolicy ( ) const
inline

Definition at line 225 of file instruction.h.

225 { return basic_policy() == FIXED_SLOT; }

References basic_policy(), and FIXED_SLOT.

Referenced by fixed_slot_index().

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

◆ HasRegisterPolicy()

bool v8::internal::compiler::UnallocatedOperand::HasRegisterPolicy ( ) const
inline

Definition at line 217 of file instruction.h.

217  {
218  return basic_policy() == EXTENDED_POLICY &&
220  }

References basic_policy(), EXTENDED_POLICY, extended_policy(), and MUST_HAVE_REGISTER.

Referenced by v8::internal::compiler::UsePosition::UsePosition().

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

◆ HasSameAsInputPolicy()

bool v8::internal::compiler::UnallocatedOperand::HasSameAsInputPolicy ( ) const
inline

Definition at line 221 of file instruction.h.

221  {
222  return basic_policy() == EXTENDED_POLICY &&
224  }

References basic_policy(), EXTENDED_POLICY, extended_policy(), and SAME_AS_FIRST_INPUT.

+ Here is the call graph for this function:

◆ IsUsedAtStart()

bool v8::internal::compiler::UnallocatedOperand::IsUsedAtStart ( )
inline

Definition at line 263 of file instruction.h.

263  {
266  }

References basic_policy(), DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::decode(), EXTENDED_POLICY, USED_AT_START, and v8::internal::compiler::InstructionOperand::value_.

+ Here is the call graph for this function:

◆ set_virtual_register()

void v8::internal::compiler::UnallocatedOperand::set_virtual_register ( unsigned  id)
inline

Definition at line 258 of file instruction.h.

258  {
260  }
static U update(U previous, T value)
Definition: utils.h:223

References v8::internal::BitFieldBase< T, shift, size, U >::update(), and v8::internal::compiler::InstructionOperand::value_.

Referenced by CopyUnconstrained(), v8::internal::compiler::LiveRange::CreateAssignedOperand(), v8::internal::compiler::OperandGenerator::Define(), v8::internal::compiler::OperandGenerator::TempDoubleRegister(), v8::internal::compiler::OperandGenerator::TempRegister(), and v8::internal::compiler::OperandGenerator::Use().

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

◆ STATIC_ASSERT()

v8::internal::compiler::UnallocatedOperand::STATIC_ASSERT ( KindField::kSize  = =3)

◆ virtual_register()

int v8::internal::compiler::UnallocatedOperand::virtual_register ( ) const
inline

Definition at line 257 of file instruction.h.

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and v8::internal::compiler::InstructionOperand::value_.

Referenced by CopyUnconstrained(), v8::internal::compiler::operator<<(), v8::internal::compiler::OperandGenerator::TempDoubleRegister(), and v8::internal::compiler::InstructionSelectorTest::FINAL::ToVreg().

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

Member Data Documentation

◆ kFixedSlotIndexWidth

const int v8::internal::compiler::UnallocatedOperand::kFixedSlotIndexWidth = FixedSlotIndexField::kSize
static

Definition at line 204 of file instruction.h.

◆ kMaxFixedSlotIndex

const int v8::internal::compiler::UnallocatedOperand::kMaxFixedSlotIndex = (1 << (kFixedSlotIndexWidth - 1)) - 1
static

Definition at line 205 of file instruction.h.

◆ kMaxVirtualRegisters

const int v8::internal::compiler::UnallocatedOperand::kMaxVirtualRegisters = VirtualRegisterField::kMax + 1
static

◆ kMinFixedSlotIndex

const int v8::internal::compiler::UnallocatedOperand::kMinFixedSlotIndex = -(1 << (kFixedSlotIndexWidth - 1))
static

Definition at line 206 of file instruction.h.


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