19 #define LITHIUM_OPERAND_LIST(V) \
20 V(ConstantOperand, CONSTANT_OPERAND, 128) \
21 V(StackSlot, STACK_SLOT, 128) \
22 V(DoubleStackSlot, DOUBLE_STACK_SLOT, 128) \
23 V(Register, REGISTER, 16) \
24 V(DoubleRegister, DOUBLE_REGISTER, 16)
42 #define LITHIUM_OPERAND_PREDICATE(name, type, number) \
43 bool Is##name() const { return kind() == type; }
47 #undef LITHIUM_OPERAND_PREDICATE
50 void PrintTo(StringStream* stream);
139 DCHECK(op->IsUnallocated());
261 : source_(source), destination_(destination) {
273 return destination_ ==
NULL && source_ !=
NULL;
278 return !IsEliminated() && source()->Equals(operand);
284 return IsEliminated() || source_->Equals(destination_) || IsIgnored() ||
285 (destination_ !=
NULL && destination_->IsConstantOperand());
289 return destination_ !=
NULL && destination_->IsIgnored();
296 return source_ ==
NULL;
305 template<LOperand::Kind kOperandKind,
int kNumCachedOperands>
310 if (index < kNumCachedOperands)
return &cache[index];
311 return new(zone) LSubKindOperand(index);
316 return reinterpret_cast<LSubKindOperand*
>(op);
330 #define LITHIUM_TYPEDEF_SUBKIND_OPERAND_CLASS(name, type, number) \
331 typedef LSubKindOperand<LOperand::type, number> L##name;
333 #undef LITHIUM_TYPEDEF_SUBKIND_OPERAND_CLASS
336 class LParallelMove
FINAL :
public ZoneObject {
341 move_operands_.Add(LMoveOperands(from,
to), zone);
358 : pointer_operands_(8, zone),
359 untagged_operands_(0, zone),
360 lithium_position_(-1) { }
363 for (
int i = 0;
i < untagged_operands_.length(); ++
i) {
364 RemovePointer(untagged_operands_[
i]);
366 untagged_operands_.Clear();
367 return &pointer_operands_;
372 DCHECK(lithium_position_ == -1);
373 lithium_position_ = pos;
397 HEnterInlined* entry,
400 frame_type_(frame_type),
401 arguments_stack_height_(argument_count),
402 deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
403 translation_index_(-1),
405 translation_size_(value_count),
406 parameter_count_(parameter_count),
408 values_(value_count, zone),
409 is_tagged_(value_count, zone),
410 is_uint32_(value_count, zone),
411 object_mapping_(0, zone),
415 has_been_used_(
false) { }
427 LEnvironment*
outer()
const {
return outer_; }
428 HEnterInlined*
entry() {
return entry_; }
437 values_.Add(operand, zone());
440 is_tagged_.Add(values_.length() - 1, zone());
444 is_uint32_.Add(values_.length() - 1, zone());
449 return is_tagged_.Contains(index);
453 return is_uint32_.Contains(index);
457 uint32_t encoded = LengthOrDupeField::encode(length) |
458 IsArgumentsField::encode(is_arguments) |
459 IsDuplicateField::encode(
false);
460 object_mapping_.Add(encoded, zone());
464 uint32_t encoded = LengthOrDupeField::encode(dupe_of) |
465 IsDuplicateField::encode(
true);
466 object_mapping_.Add(encoded, zone());
470 DCHECK(ObjectIsDuplicateAt(index));
471 return LengthOrDupeField::decode(object_mapping_[index]);
475 DCHECK(!ObjectIsDuplicateAt(index));
476 return LengthOrDupeField::decode(object_mapping_[index]);
480 DCHECK(!ObjectIsDuplicateAt(index));
481 return IsArgumentsField::decode(object_mapping_[index]);
485 return IsDuplicateField::decode(object_mapping_[index]);
489 int translation_index,
491 DCHECK(!HasBeenRegistered());
492 deoptimization_index_ = deoptimization_index;
493 translation_index_ = translation_index;
494 pc_offset_ = pc_offset;
497 return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex;
518 int parameter_count_;
531 HEnterInlined* entry_;
542 limit_(env !=
NULL ? env->values()->length() : 0),
547 bool Done() {
return current_ >= limit_; }
552 return env_->values()->at(current_);
561 LEnvironment*
env() {
return env_; }
565 return op ==
NULL || op->IsConstantOperand();
570 while (current_ < limit_ && ShouldSkip(env_->values()->at(current_))) {
585 : current_iterator_(env) {
589 bool Done() {
return current_iterator_.Done(); }
592 DCHECK(!current_iterator_.Done());
594 return current_iterator_.Current();
598 current_iterator_.Advance();
604 while (current_iterator_.env() !=
NULL && current_iterator_.Done()) {
605 current_iterator_ = ShallowIterator(current_iterator_.env()->outer());
613 class LPlatformChunk;
641 LLabel*
GetLabel(
int block_id)
const;
655 if (!
map->CanBeDeprecated())
return;
662 if (!
map->CanTransition())
return;
702 : argument_count_(0),
707 zone_(graph->zone()) {}
717 LPlatformChunk*
chunk()
const {
return chunk_; }
719 HGraph*
graph()
const {
return graph_; }
734 int* argument_index_accumulator,
738 LEnvironment* result);
743 LPlatformChunk* chunk_;
TempIterator(LInstruction *instr)
InputIterator input_iterator_
Isolate * isolate() const
void set_destination(LOperand *operand)
virtual MUST_USE_RESULT LOperand * UseAny(HValue *value)=0
void AddObjectToMaterialize(HValue *value, ZoneList< HValue * > *objects_to_materialize, LEnvironment *result)
virtual ~LChunkBuilderBase()
LPlatformChunk * chunk() const
UseIterator(LInstruction *instr)
CompilationInfo * info() const
int argument_count() const
LChunkBuilderBase(CompilationInfo *info, HGraph *graph)
LOperand * destination() const
ShallowIterator current_iterator_
InputIterator(LInstruction *instr)
ShallowIterator(LEnvironment *env)
void Abort(BailoutReason reason)
DeepIterator env_iterator_
void set_source(LOperand *operand)
LMoveOperands(LOperand *source, LOperand *destination)
void Retry(BailoutReason reason)
DeepIterator(LEnvironment *env)
LOperand * source() const
bool ShouldSkip(LOperand *op)
bool IsEliminated() const
bool Blocks(LOperand *operand) const
LEnvironment * CreateEnvironment(HEnvironment *hydrogen_env, int *argument_index_accumulator, ZoneList< HValue * > *objects_to_materialize)
static U update(U previous, T value)
Source to read snapshot and builtins files from.
bool HasUint32ValueAt(int index) const
int lithium_position() const
void AddMove(LOperand *from, LOperand *to, Zone *zone)
bool HasBeenRegistered() const
const ZoneList< LOperand * > * values() const
int arguments_stack_height() const
LSubKindOperand(int index)
bool ObjectIsArgumentsAt(int index)
int arguments_stack_height_
ZoneList< LOperand * > values_
LEnvironment(Handle< JSFunction > closure, FrameType frame_type, BailoutId ast_id, int parameter_count, int argument_count, int value_count, LEnvironment *outer, HEnterInlined *entry, Zone *zone)
LParallelMove(Zone *zone)
void PrintTo(StringStream *stream)
void AddValue(LOperand *operand, Representation representation, bool is_uint32)
static LSubKindOperand * cache
void set_lithium_position(int pos)
void AddNewObject(int length, bool is_arguments)
const ZoneList< LOperand * > * GetNormalizedOperands()
int ObjectDuplicateOfAt(int index)
void RecordPointer(LOperand *op, Zone *zone)
int translation_size() const
static void TearDownCache()
int ObjectLengthAt(int index)
ZoneList< LOperand * > untagged_operands_
Handle< JSFunction > closure() const
void AddDuplicateObject(int dupe_of)
void PrintDataTo(StringStream *stream) const
ZoneList< LMoveOperands > move_operands_
static LOperand * materialization_marker()
GrowableBitVector is_tagged_
static LSubKindOperand * cast(LOperand *op)
int translation_index() const
FrameType frame_type() const
bool HasTaggedValueAt(int index) const
ZoneList< LOperand * > pointer_operands_
int deoptimization_index() const
bool has_been_used() const
ZoneList< LMoveOperands > * move_operands()
void Register(int deoptimization_index, int translation_index, int pc_offset)
LEnvironment * outer() const
GrowableBitVector is_uint32_
int parameter_count() const
static LSubKindOperand * Create(int index, Zone *zone)
bool ObjectIsDuplicateAt(int index)
void RemovePointer(LOperand *op)
ZoneList< uint32_t > object_mapping_
int deoptimization_index_
void RecordUntagged(LOperand *op, Zone *zone)
LConstantOperand * DefineConstantOperand(HConstant *constant)
LChunk(CompilationInfo *info, HGraph *graph)
int LookupDestination(int block_id) const
MapSet stability_dependencies_
void set_allocated_double_registers(BitVector *allocated_registers)
bool IsGapAt(int index) const
const ZoneList< LPointerMap * > * pointer_maps() const
BitVector * allocated_double_registers()
ZoneList< LInstruction * > instructions_
HConstant * LookupConstant(LConstantOperand *operand) const
MapSet deprecation_dependencies_
int GetParameterStackSlot(int index) const
ZoneList< Handle< JSFunction > > inlined_closures_
zone_allocator< Handle< Map > > MapAllocator
CompilationInfo * info() const
void AddDeprecationDependency(Handle< Map > map)
const ZoneList< Handle< JSFunction > > * inlined_closures() const
void AddGapMove(int index, LOperand *from, LOperand *to)
ZoneList< LPointerMap * > pointer_maps_
std::less< Handle< Map > > MapLess
int ParameterAt(int index)
LLabel * GetLabel(int block_id) const
Label * GetAssemblyLabel(int block_id) const
static LChunk * NewChunk(HGraph *graph)
void AddInlinedClosure(Handle< JSFunction > closure)
void CommitDependencies(Handle< Code > code) const
Representation LookupLiteralRepresentation(LConstantOperand *operand) const
std::set< Handle< Map >, MapLess, MapAllocator > MapSet
int NearestGapPos(int index) const
BitVector * allocated_double_registers_
const ZoneList< LInstruction * > * instructions() const
void AddStabilityDependency(Handle< Map > map)
void AddInstruction(LInstruction *instruction, HBasicBlock *block)
LGap * GetGapAt(int index) const
Isolate * isolate() const
int spill_slot_count() const
void ConvertTo(Kind kind, int index)
static const int kKindFieldWidth
bool Equals(LOperand *other) const
void PrintTo(StringStream *stream)
static void TearDownCaches()
static void SetUpCaches()
LOperand(Kind kind, int index)
DISALLOW_COPY_AND_ASSIGN(LPhase)
LPhase(const char *name, LChunk *chunk)
bool HasSameAsInputPolicy() const
LUnallocated(ExtendedPolicy policy, int index)
bool HasWritableRegisterPolicy() const
static const int kMinFixedSlotIndex
static LUnallocated * cast(LOperand *op)
LUnallocated(ExtendedPolicy policy)
int virtual_register() const
LUnallocated(BasicPolicy policy, int index)
bool HasRegisterPolicy() const
void set_virtual_register(unsigned id)
static const int kMaxVirtualRegisters
@ MUST_HAVE_DOUBLE_REGISTER
LUnallocated(ExtendedPolicy policy, Lifetime lifetime)
bool HasFixedDoubleRegisterPolicy() const
bool HasFixedSlotPolicy() const
bool HasFixedRegisterPolicy() const
bool HasAnyPolicy() const
int fixed_slot_index() const
static const int kFixedSlotIndexWidth
ExtendedPolicy extended_policy() const
STATIC_ASSERT(kKindFieldWidth==3)
static const int kMaxFixedSlotIndex
bool HasDoubleRegisterPolicy() const
bool HasFixedPolicy() const
LUnallocated * CopyUnconstrained(Zone *zone)
BasicPolicy basic_policy() const
int fixed_register_index() const
bool IsSmiOrTagged() const
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 map
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 expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
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 expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
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
#define LITHIUM_TYPEDEF_SUBKIND_OPERAND_CLASS(name, type, number)
#define LITHIUM_OPERAND_PREDICATE(name, type, number)
#define LITHIUM_OPERAND_LIST(V)
#define DCHECK(condition)
int StackSlotOffset(int index)
@ NUMBER_CANDIDATE_IS_SMI
@ NUMBER_CANDIDATE_IS_ANY_TAGGED
Debugger support for the V8 JavaScript engine.