38 #define LITHIUM_OPERAND_LIST(V) \
39 V(ConstantOperand, CONSTANT_OPERAND) \
40 V(StackSlot, STACK_SLOT) \
41 V(DoubleStackSlot, DOUBLE_STACK_SLOT) \
42 V(Register, REGISTER) \
43 V(DoubleRegister, DOUBLE_REGISTER)
63 #define LITHIUM_OPERAND_PREDICATE(name, type) \
64 bool Is##name() const { return kind() == type; }
69 #undef LITHIUM_OPERAND_PREDICATE
129 Initialize(policy, 0, lifetime);
147 :
public BitField<Lifetime, kLifetimeShift, kLifetimeWidth> {
152 kVirtualRegisterShift,
153 kVirtualRegisterWidth> {
197 ASSERT(op->IsUnallocated());
218 : source_(source), destination_(destination) {
230 return destination_ ==
NULL && source_ !=
NULL;
235 return !IsEliminated() && source()->Equals(operand);
241 return IsEliminated() || source_->Equals(destination_) || IsIgnored();
245 return destination_ !=
NULL && destination_->IsIgnored();
252 return source_ ==
NULL;
265 if (index < kNumCachedOperands)
return &cache[
index];
270 ASSERT(op->IsConstantOperand());
278 static const int kNumCachedOperands = 128;
301 if (index < kNumCachedOperands)
return &cache[
index];
306 ASSERT(op->IsStackSlot());
314 static const int kNumCachedOperands = 128;
326 if (index < kNumCachedOperands)
return &cache[
index];
331 ASSERT(op->IsStackSlot());
339 static const int kNumCachedOperands = 128;
351 if (index < kNumCachedOperands)
return &cache[
index];
364 static const int kNumCachedOperands = 16;
376 if (index < kNumCachedOperands)
return &cache[
index];
381 ASSERT(op->IsDoubleRegister());
389 static const int kNumCachedOperands = 16;
402 move_operands_.
Add(LMoveOperands(from, to), zone);
408 return &move_operands_;
421 : pointer_operands_(8, zone),
422 untagged_operands_(0, zone),
424 lithium_position_(-1) { }
427 for (
int i = 0; i < untagged_operands_.length(); ++i) {
430 untagged_operands_.Clear();
431 return &pointer_operands_;
437 ASSERT(lithium_position_ == -1);
438 lithium_position_ = pos;
450 int lithium_position_;
465 frame_type_(frame_type),
466 arguments_stack_height_(argument_count),
467 deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
468 translation_index_(-1),
470 parameter_count_(parameter_count),
472 values_(value_count, zone),
473 is_tagged_(value_count, closure->GetHeap()->isolate()->zone()),
474 spilled_registers_(
NULL),
475 spilled_double_registers_(
NULL),
489 return spilled_double_registers_;
495 values_.Add(operand,
zone());
497 is_tagged_.
Add(values_.length() - 1);
514 return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex;
519 spilled_registers_ = registers;
520 spilled_double_registers_ = double_registers;
530 int arguments_stack_height_;
531 int deoptimization_index_;
532 int translation_index_;
534 int parameter_count_;
543 LOperand** spilled_double_registers_;
556 limit_(env !=
NULL ? env->values()->length() : 0),
565 return env_->values()->at(
current_);
578 return op ==
NULL || op->IsConstantOperand() || op->IsArgument();
582 void SkipUninteresting() {
598 : current_iterator_(env) {
602 bool Done() {
return current_iterator_.Done(); }
605 ASSERT(!current_iterator_.Done());
606 return current_iterator_.Current();
610 current_iterator_.Advance();
615 void SkipUninteresting() {
616 while (current_iterator_.env() !=
NULL && current_iterator_.Done()) {
617 current_iterator_ = ShallowIterator(current_iterator_.env()->outer());
621 ShallowIterator current_iterator_;
630 #endif // V8_LITHIUM_H_
static const int kFixedIndexShift
static LUnallocated * cast(LOperand *op)
const ZoneList< LMoveOperands > * move_operands() const
static LArgument * cast(LOperand *op)
static LConstantOperand * Create(int index, Zone *zone)
void SetSpilledRegisters(LOperand **registers, LOperand **double_registers)
DeepIterator(LEnvironment *env)
const ZoneList< LOperand * > * GetNormalizedOperands()
static LDoubleRegister * cast(LOperand *op)
static void TearDownCaches()
int lithium_position() const
LUnallocated(Policy policy)
LParallelMove(Zone *zone)
LEnvironment * outer() const
static uint32_t encode(Kindvalue)
static const int kVirtualRegisterWidth
LEnvironment(Handle< JSFunction > closure, FrameType frame_type, int ast_id, int parameter_count, int argument_count, int value_count, LEnvironment *outer, Zone *zone)
LOperand(Kind kind, int index)
static const int kPolicyShift
void RemovePointer(LOperand *op)
LUnallocated * CopyUnconstrained(Zone *zone)
#define ASSERT(condition)
bool HasSameAsInputPolicy() const
static void SetUpCaches()
bool HasRegisterPolicy() const
static LDoubleRegister * Create(int index, Zone *zone)
void PrintTo(StringStream *stream)
static uint32_t update(uint32_t previous, Policyvalue)
bool Equals(LOperand *other) const
bool HasBeenRegistered() const
void RecordUntagged(LOperand *op, Zone *zone)
int translation_index() const
LOperand * destination() const
bool Contains(int i) const
void set_virtual_register(unsigned id)
static void TearDownCache()
#define LITHIUM_OPERAND_PREDICATE(name, type)
int virtual_register() const
void PrintTo(StringStream *stream)
static const int kMaxVirtualRegisters
void set_source(LOperand *operand)
void ConvertTo(Kind kind, int index)
LMoveOperands(LOperand *source, LOperand *destination)
void AddMove(LOperand *from, LOperand *to, Zone *zone)
static const int kLifetimeWidth
static LDoubleStackSlot * Create(int index, Zone *zone)
void RecordPointer(LOperand *op, Zone *zone)
const ZoneList< LOperand * > * values() const
static LConstantOperand * cast(LOperand *op)
static void TearDownCache()
bool Blocks(LOperand *operand) const
Handle< JSFunction > closure() const
static const int kPolicyWidth
static void TearDownCache()
static Kind decode(uint32_t value)
static const int kVirtualRegisterShift
void AddValue(LOperand *operand, Representation representation)
LPointerMap(int position, Zone *zone)
int ElementsKindToShiftSize(ElementsKind elements_kind)
int deoptimization_index() const
static LStackSlot * Create(int index, Zone *zone)
LOperand ** spilled_double_registers() const
static const int kMaxFixedIndex
static LDoubleStackSlot * cast(LOperand *op)
int parameter_count() const
ShallowIterator(LEnvironment *env)
static const int kLifetimeShift
bool HasTaggedValueAt(int index) const
void PrintDataTo(StringStream *stream) const
LOperand ** spilled_registers() const
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
static void TearDownCache()
void set_policy(Policy policy)
bool HasFixedPolicy() const
LOperand * source() const
static LRegister * Create(int index, Zone *zone)
bool IsEliminated() const
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
void Register(int deoptimization_index, int translation_index, int pc_offset)
bool HasAnyPolicy() const
FrameType frame_type() const
static LStackSlot * cast(LOperand *op)
static const int kMinFixedIndex
LUnallocated(Policy policy, int fixed_index)
LUnallocated(Policy policy, Lifetime lifetime)
#define LITHIUM_OPERAND_LIST(V)
void set_lithium_position(int pos)
void set_destination(LOperand *operand)
static LRegister * cast(LOperand *op)
static void TearDownCache()
void PrintTo(StringStream *stream)
int arguments_stack_height() const
static const int kKindFieldWidth