V8 Project
v8::internal::LUnallocated Class Reference

#include <lithium.h>

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

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 , MUST_HAVE_DOUBLE_REGISTER , WRITABLE_REGISTER , SAME_AS_FIRST_INPUT
}
 
enum  Lifetime { USED_AT_START , USED_AT_END }
 
- Public Types inherited from v8::internal::LOperand
enum  Kind {
  INVALID , UNALLOCATED , CONSTANT_OPERAND , STACK_SLOT ,
  DOUBLE_STACK_SLOT , REGISTER , DOUBLE_REGISTER
}
 

Public Member Functions

 LUnallocated (ExtendedPolicy policy)
 
 LUnallocated (BasicPolicy policy, int index)
 
 LUnallocated (ExtendedPolicy policy, int index)
 
 LUnallocated (ExtendedPolicy policy, Lifetime lifetime)
 
LUnallocatedCopyUnconstrained (Zone *zone)
 
 STATIC_ASSERT (kKindFieldWidth==3)
 
bool HasAnyPolicy () const
 
bool HasFixedPolicy () const
 
bool HasRegisterPolicy () const
 
bool HasDoubleRegisterPolicy () const
 
bool HasSameAsInputPolicy () const
 
bool HasFixedSlotPolicy () const
 
bool HasFixedRegisterPolicy () const
 
bool HasFixedDoubleRegisterPolicy () const
 
bool HasWritableRegisterPolicy () 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::LOperand
 LOperand ()
 
Kind kind () const
 
int index () const
 
bool Equals (LOperand *other) const
 
void PrintTo (StringStream *stream)
 
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 LUnallocatedcast (LOperand *op)
 
- Static Public Member Functions inherited from v8::internal::LOperand
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 Member Functions inherited from v8::internal::LOperand
 LOperand (Kind kind, int index)
 
- Protected Attributes inherited from v8::internal::LOperand
unsigned value_
 
- Static Protected Attributes inherited from v8::internal::LOperand
static const int kKindFieldWidth = 3
 

Detailed Description

Definition at line 72 of file lithium.h.

Member Enumeration Documentation

◆ BasicPolicy

Enumerator
FIXED_SLOT 
EXTENDED_POLICY 

Definition at line 74 of file lithium.h.

◆ ExtendedPolicy

Enumerator
NONE 
ANY 
FIXED_REGISTER 
FIXED_DOUBLE_REGISTER 
MUST_HAVE_REGISTER 
MUST_HAVE_DOUBLE_REGISTER 
WRITABLE_REGISTER 
SAME_AS_FIRST_INPUT 

Definition at line 79 of file lithium.h.

◆ Lifetime

Enumerator
USED_AT_START 
USED_AT_END 

Definition at line 91 of file lithium.h.

91  {
92  // USED_AT_START operand is guaranteed to be live only at
93  // instruction start. Register allocator is free to assign the same register
94  // to some other operand used inside instruction (i.e. temporary or
95  // output).
97 
98  // USED_AT_END operand is treated as live until the end of
99  // instruction. This means that register allocator will not reuse it's
100  // register for any other operand inside instruction.
102  };

Constructor & Destructor Documentation

◆ LUnallocated() [1/4]

v8::internal::LUnallocated::LUnallocated ( ExtendedPolicy  policy)
inlineexplicit

Definition at line 104 of file lithium.h.

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

Referenced by CopyUnconstrained().

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

◆ LUnallocated() [2/4]

v8::internal::LUnallocated::LUnallocated ( BasicPolicy  policy,
int  index 
)
inline

Definition at line 110 of file lithium.h.

110  : LOperand(UNALLOCATED, 0) {
111  DCHECK(policy == FIXED_SLOT);
112  value_ |= BasicPolicyField::encode(policy);
114  DCHECK(this->fixed_slot_index() == index);
115  }
static const U kShift
Definition: utils.h:204
int index() const
Definition: lithium.h:41
int fixed_slot_index() const
Definition: lithium.h:231
#define DCHECK(condition)
Definition: logging.h:205

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

+ Here is the call graph for this function:

◆ LUnallocated() [3/4]

v8::internal::LUnallocated::LUnallocated ( ExtendedPolicy  policy,
int  index 
)
inline

Definition at line 117 of file lithium.h.

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

+ Here is the call graph for this function:

◆ LUnallocated() [4/4]

v8::internal::LUnallocated::LUnallocated ( ExtendedPolicy  policy,
Lifetime  lifetime 
)
inline

Definition at line 125 of file lithium.h.

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

+ Here is the call graph for this function:

Member Function Documentation

◆ basic_policy()

BasicPolicy v8::internal::LUnallocated::basic_policy ( ) const
inline

Definition at line 220 of file lithium.h.

220  {
222  }
static T decode(U value)
Definition: utils.h:228

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

Referenced by extended_policy(), HasAnyPolicy(), HasDoubleRegisterPolicy(), HasFixedDoubleRegisterPolicy(), HasFixedPolicy(), HasFixedRegisterPolicy(), HasFixedSlotPolicy(), HasRegisterPolicy(), HasSameAsInputPolicy(), HasWritableRegisterPolicy(), IsUsedAtStart(), and v8::internal::LOperand::PrintTo().

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

◆ cast()

static LUnallocated* v8::internal::LUnallocated::cast ( LOperand op)
inlinestatic

Definition at line 138 of file lithium.h.

138  {
139  DCHECK(op->IsUnallocated());
140  return reinterpret_cast<LUnallocated*>(op);
141  }
LUnallocated(ExtendedPolicy policy)
Definition: lithium.h:104

References DCHECK.

Referenced by v8::internal::LOperand::PrintTo(), and v8::internal::UsePosition::UsePosition().

+ Here is the caller graph for this function:

◆ CopyUnconstrained()

LUnallocated* v8::internal::LUnallocated::CopyUnconstrained ( Zone zone)
inline

Definition at line 132 of file lithium.h.

132  {
133  LUnallocated* result = new(zone) LUnallocated(ANY);
134  result->set_virtual_register(virtual_register());
135  return result;
136  }
int virtual_register() const
Definition: lithium.h:243

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

+ Here is the call graph for this function:

◆ extended_policy()

ExtendedPolicy v8::internal::LUnallocated::extended_policy ( ) const
inline

Definition at line 225 of file lithium.h.

225  {
228  }
BasicPolicy basic_policy() const
Definition: lithium.h:220

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

Referenced by HasAnyPolicy(), HasDoubleRegisterPolicy(), HasFixedDoubleRegisterPolicy(), HasFixedPolicy(), HasFixedRegisterPolicy(), HasRegisterPolicy(), HasSameAsInputPolicy(), HasWritableRegisterPolicy(), and v8::internal::LOperand::PrintTo().

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

◆ fixed_register_index()

int v8::internal::LUnallocated::fixed_register_index ( ) const
inline

Definition at line 237 of file lithium.h.

237  {
240  }
bool HasFixedDoubleRegisterPolicy() const
Definition: lithium.h:210
bool HasFixedRegisterPolicy() const
Definition: lithium.h:206

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

Referenced by v8::internal::LOperand::PrintTo().

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

◆ fixed_slot_index()

int v8::internal::LUnallocated::fixed_slot_index ( ) const
inline

Definition at line 231 of file lithium.h.

231  {
233  return static_cast<int>(value_) >> FixedSlotIndexField::kShift;
234  }
bool HasFixedSlotPolicy() const
Definition: lithium.h:203

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

Referenced by LUnallocated(), and v8::internal::LOperand::PrintTo().

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

◆ HasAnyPolicy()

bool v8::internal::LUnallocated::HasAnyPolicy ( ) const
inline

Definition at line 181 of file lithium.h.

181  {
182  return basic_policy() == EXTENDED_POLICY &&
183  extended_policy() == ANY;
184  }
ExtendedPolicy extended_policy() const
Definition: lithium.h:225

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

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

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

◆ HasDoubleRegisterPolicy()

bool v8::internal::LUnallocated::HasDoubleRegisterPolicy ( ) const
inline

Definition at line 195 of file lithium.h.

195  {
196  return basic_policy() == EXTENDED_POLICY &&
198  }

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

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

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

◆ HasFixedDoubleRegisterPolicy()

bool v8::internal::LUnallocated::HasFixedDoubleRegisterPolicy ( ) const
inline

Definition at line 210 of file lithium.h.

210  {
211  return basic_policy() == EXTENDED_POLICY &&
213  }

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::LUnallocated::HasFixedPolicy ( ) const
inline

Definition at line 185 of file lithium.h.

185  {
186  return basic_policy() == FIXED_SLOT ||
189  }

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::LUnallocated::HasFixedRegisterPolicy ( ) const
inline

Definition at line 206 of file lithium.h.

206  {
207  return basic_policy() == EXTENDED_POLICY &&
209  }

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::LUnallocated::HasFixedSlotPolicy ( ) const
inline

Definition at line 203 of file lithium.h.

203  {
204  return basic_policy() == FIXED_SLOT;
205  }

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::LUnallocated::HasRegisterPolicy ( ) const
inline

Definition at line 190 of file lithium.h.

190  {
191  return basic_policy() == EXTENDED_POLICY && (
194  }

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

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

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

◆ HasSameAsInputPolicy()

bool v8::internal::LUnallocated::HasSameAsInputPolicy ( ) const
inline

Definition at line 199 of file lithium.h.

199  {
200  return basic_policy() == EXTENDED_POLICY &&
202  }

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

+ Here is the call graph for this function:

◆ HasWritableRegisterPolicy()

bool v8::internal::LUnallocated::HasWritableRegisterPolicy ( ) const
inline

Definition at line 214 of file lithium.h.

214  {
215  return basic_policy() == EXTENDED_POLICY &&
217  }

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

+ Here is the call graph for this function:

◆ IsUsedAtStart()

bool v8::internal::LUnallocated::IsUsedAtStart ( )
inline

Definition at line 251 of file lithium.h.

251  {
254  }

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

+ Here is the call graph for this function:

◆ set_virtual_register()

void v8::internal::LUnallocated::set_virtual_register ( unsigned  id)
inline

Definition at line 246 of file lithium.h.

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

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

Referenced by CopyUnconstrained(), and v8::internal::LiveRange::CreateAssignedOperand().

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

◆ STATIC_ASSERT()

v8::internal::LUnallocated::STATIC_ASSERT ( kKindFieldWidth  = =3)

◆ virtual_register()

int v8::internal::LUnallocated::virtual_register ( ) const
inline

Definition at line 243 of file lithium.h.

243  {
245  }

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

Referenced by CopyUnconstrained(), and v8::internal::LOperand::PrintTo().

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

Member Data Documentation

◆ kFixedSlotIndexWidth

const int v8::internal::LUnallocated::kFixedSlotIndexWidth = FixedSlotIndexField::kSize
static

Definition at line 176 of file lithium.h.

◆ kMaxFixedSlotIndex

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

Definition at line 177 of file lithium.h.

Referenced by v8::internal::OptimizedCompileJob::CreateGraph().

◆ kMaxVirtualRegisters

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

◆ kMinFixedSlotIndex

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

Definition at line 178 of file lithium.h.

Referenced by v8::internal::OptimizedCompileJob::CreateGraph().


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