V8 Project
v8::internal::LOperand Class Reference

#include <lithium.h>

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

Classes

class  KindField
 

Public Types

enum  Kind {
  INVALID , UNALLOCATED , CONSTANT_OPERAND , STACK_SLOT ,
  DOUBLE_STACK_SLOT , REGISTER , DOUBLE_REGISTER
}
 

Public Member Functions

 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 void SetUpCaches ()
 
static void TearDownCaches ()
 

Protected Member Functions

 LOperand (Kind kind, int index)
 

Protected Attributes

unsigned value_
 

Static Protected Attributes

static const int kKindFieldWidth = 3
 

Detailed Description

Definition at line 26 of file lithium.h.

Member Enumeration Documentation

◆ Kind

Enumerator
INVALID 
UNALLOCATED 
CONSTANT_OPERAND 
STACK_SLOT 
DOUBLE_STACK_SLOT 
REGISTER 
DOUBLE_REGISTER 

Definition at line 28 of file lithium.h.

Constructor & Destructor Documentation

◆ LOperand() [1/2]

v8::internal::LOperand::LOperand ( )
inline

Definition at line 38 of file lithium.h.

static U encode(T value)
Definition: utils.h:217

◆ LOperand() [2/2]

v8::internal::LOperand::LOperand ( Kind  kind,
int  index 
)
inlineprotected

Definition at line 66 of file lithium.h.

66 { ConvertTo(kind, index); }
void ConvertTo(Kind kind, int index)
Definition: lithium.h:51
Kind kind() const
Definition: lithium.h:40
int index() const
Definition: lithium.h:41

References ConvertTo(), index(), and kind().

+ Here is the call graph for this function:

Member Function Documentation

◆ ConvertTo()

void v8::internal::LOperand::ConvertTo ( Kind  kind,
int  index 
)
inline

Definition at line 51 of file lithium.h.

51  {
52  if (kind == REGISTER) DCHECK(index >= 0);
55  DCHECK(this->index() == index);
56  }
static const int kKindFieldWidth
Definition: lithium.h:63
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::encode(), index(), kind(), kKindFieldWidth, REGISTER, and value_.

Referenced by v8::internal::LiveRange::ConvertOperands(), LOperand(), and v8::internal::LiveRange::SetSpillOperand().

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

◆ Equals()

bool v8::internal::LOperand::Equals ( LOperand other) const
inline

Definition at line 48 of file lithium.h.

48 { return value_ == other->value_; }

References value_.

◆ index()

◆ kind()

Kind v8::internal::LOperand::kind ( ) const
inline

Definition at line 40 of file lithium.h.

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

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

Referenced by v8::internal::FINAL< kOperandKind, kNumCachedOperands >::cast(), v8::internal::LiveRange::ConvertOperands(), ConvertTo(), LOperand(), PrintTo(), and v8::internal::LiveRange::SetSpillOperand().

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

◆ PrintTo()

void v8::internal::LOperand::PrintTo ( StringStream *  stream)

Definition at line 41 of file lithium.cc.

41  {
42  LUnallocated* unalloc = NULL;
43  switch (kind()) {
44  case INVALID:
45  stream->Add("(0)");
46  break;
47  case UNALLOCATED:
48  unalloc = LUnallocated::cast(this);
49  stream->Add("v%d", unalloc->virtual_register());
50  if (unalloc->basic_policy() == LUnallocated::FIXED_SLOT) {
51  stream->Add("(=%dS)", unalloc->fixed_slot_index());
52  break;
53  }
54  switch (unalloc->extended_policy()) {
55  case LUnallocated::NONE:
56  break;
58  int reg_index = unalloc->fixed_register_index();
59  if (reg_index < 0 ||
61  stream->Add("(=invalid_reg#%d)", reg_index);
62  } else {
63  const char* register_name =
65  stream->Add("(=%s)", register_name);
66  }
67  break;
68  }
70  int reg_index = unalloc->fixed_register_index();
71  if (reg_index < 0 ||
73  stream->Add("(=invalid_double_reg#%d)", reg_index);
74  } else {
75  const char* double_register_name =
77  stream->Add("(=%s)", double_register_name);
78  }
79  break;
80  }
82  stream->Add("(R)");
83  break;
85  stream->Add("(D)");
86  break;
88  stream->Add("(WR)");
89  break;
91  stream->Add("(1)");
92  break;
93  case LUnallocated::ANY:
94  stream->Add("(-)");
95  break;
96  }
97  break;
98  case CONSTANT_OPERAND:
99  stream->Add("[constant:%d]", index());
100  break;
101  case STACK_SLOT:
102  stream->Add("[stack:%d]", index());
103  break;
104  case DOUBLE_STACK_SLOT:
105  stream->Add("[double_stack:%d]", index());
106  break;
107  case REGISTER: {
108  int reg_index = index();
109  if (reg_index < 0 || reg_index >= Register::kMaxNumAllocatableRegisters) {
110  stream->Add("(=invalid_reg#%d|R)", reg_index);
111  } else {
112  stream->Add("[%s|R]", Register::AllocationIndexToString(reg_index));
113  }
114  break;
115  }
116  case DOUBLE_REGISTER: {
117  int reg_index = index();
118  if (reg_index < 0 ||
120  stream->Add("(=invalid_double_reg#%d|R)", reg_index);
121  } else {
122  stream->Add("[%s|R]",
124  }
125  break;
126  }
127  }
128 }
static LUnallocated * cast(LOperand *op)
Definition: lithium.h:138
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
static const char * AllocationIndexToString(int index)
static const int kMaxNumAllocatableRegisters
static const char * AllocationIndexToString(int index)
static const int kMaxNumAllocatableRegisters
Definition: assembler-arm.h:96

References v8::internal::Register::AllocationIndexToString(), v8::internal::DwVfpRegister::AllocationIndexToString(), v8::internal::LUnallocated::ANY, v8::internal::LUnallocated::basic_policy(), v8::internal::LUnallocated::cast(), CONSTANT_OPERAND, DOUBLE_REGISTER, DOUBLE_STACK_SLOT, v8::internal::LUnallocated::extended_policy(), v8::internal::LUnallocated::FIXED_DOUBLE_REGISTER, v8::internal::LUnallocated::FIXED_REGISTER, v8::internal::LUnallocated::fixed_register_index(), v8::internal::LUnallocated::FIXED_SLOT, v8::internal::LUnallocated::fixed_slot_index(), index(), INVALID, kind(), v8::internal::Register::kMaxNumAllocatableRegisters, v8::internal::DwVfpRegister::kMaxNumAllocatableRegisters, v8::internal::LUnallocated::MUST_HAVE_DOUBLE_REGISTER, v8::internal::LUnallocated::MUST_HAVE_REGISTER, v8::internal::LUnallocated::NONE, NULL, REGISTER, v8::internal::LUnallocated::SAME_AS_FIRST_INPUT, STACK_SLOT, UNALLOCATED, v8::internal::LUnallocated::virtual_register(), and v8::internal::LUnallocated::WRITABLE_REGISTER.

Referenced by v8::internal::LInstruction::PrintDataTo(), and v8::internal::LInstruction::PrintOutputOperandTo().

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

◆ SetUpCaches()

void v8::internal::LOperand::SetUpCaches ( )
static

Definition at line 153 of file lithium.cc.

153  {
154 #define LITHIUM_OPERAND_SETUP(name, type, number) L##name::SetUpCache();
156 #undef LITHIUM_OPERAND_SETUP
157 }
#define LITHIUM_OPERAND_SETUP(name, type, number)
#define LITHIUM_OPERAND_LIST(V)
Definition: lithium.h:19

References LITHIUM_OPERAND_LIST, and LITHIUM_OPERAND_SETUP.

Referenced by v8::internal::V8::InitializeOncePerProcessImpl().

+ Here is the caller graph for this function:

◆ TearDownCaches()

void v8::internal::LOperand::TearDownCaches ( )
static

Definition at line 160 of file lithium.cc.

160  {
161 #define LITHIUM_OPERAND_TEARDOWN(name, type, number) L##name::TearDownCache();
163 #undef LITHIUM_OPERAND_TEARDOWN
164 }
#define LITHIUM_OPERAND_TEARDOWN(name, type, number)

References LITHIUM_OPERAND_LIST, and LITHIUM_OPERAND_TEARDOWN.

Referenced by v8::internal::V8::TearDown().

+ Here is the caller graph for this function:

Member Data Documentation

◆ kKindFieldWidth

const int v8::internal::LOperand::kKindFieldWidth = 3
staticprotected

Definition at line 63 of file lithium.h.

Referenced by ConvertTo(), and index().

◆ value_


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