14 #define TRACE(x) if (FLAG_trace_load_elimination) PrintF x
48 case HValue::kLoadNamedField: {
49 HLoadNamedField* l = HLoadNamedField::cast(instr);
50 TRACE((
" process L%d field %d (o%d)\n",
53 l->object()->ActualValue()->id()));
55 if (result != instr && l->CanBeReplacedWith(result)) {
57 TRACE((
" replace L%d -> v%d\n", instr->
id(), result->
id()));
62 case HValue::kStoreNamedField: {
63 HStoreNamedField* s = HStoreNamedField::cast(instr);
64 TRACE((
" process S%d field %d (o%d) = v%d\n",
67 s->object()->ActualValue()->id(),
72 TRACE((
" remove S%d\n", instr->
id()));
77 case HValue::kTransitionElementsKind: {
78 HTransitionElementsKind* t = HTransitionElementsKind::cast(instr);
86 TRACE((
" kill-all i%d\n", instr->
id()));
91 TRACE((
" kill-maps i%d\n", instr->
id()));
95 TRACE((
" kill-elements-kind i%d\n", instr->
id()));
100 TRACE((
" kill-elements i%d\n", instr->
id()));
104 TRACE((
" kill-osr i%d\n", instr->
id()));
121 HBasicBlock* succ_block,
123 HBasicBlock* pred_block,
126 if (succ_state ==
NULL) {
127 return pred_state->
Copy(succ_block, pred_block, zone);
129 return succ_state->
Merge(succ_block, pred_state, pred_block, zone);
152 if (FLAG_trace_load_elimination) {
153 TRACE((
" copy-to B%d\n", succ->block_id()));
161 HBasicBlock* that_block,
Zone* zone) {
170 while (approx !=
NULL) {
180 approx = approx->
next_;
184 approx = approx->
next_;
187 if (FLAG_trace_load_elimination) {
188 TRACE((
" merge-to B%d\n", succ->block_id()));
203 DCHECK(!instr->access().IsInobject() ||
204 instr->access().existing_inobject_property());
206 int field =
FieldOf(instr->access());
207 if (field < 0)
return instr;
230 if (instr->access().IsInobject() &&
231 !instr->access().existing_inobject_property()) {
232 TRACE((
" skipping non existing property initialization store\n"));
236 int field =
FieldOf(instr->access());
240 HValue* value = instr->value();
242 if (instr->has_transition()) {
271 if (field >= 0 && field <
fields_.length()) {
278 int field =
FieldOf(s->access());
288 HObjectAccess access = instr->access();
289 if (access.IsInobject()) {
290 int offset = access.offset();
298 int size = access.representation().size();
310 while (approx !=
NULL) {
312 approx = approx->
next_;
324 while (approx !=
NULL) {
327 approx = approx->
next_;
350 if (field >=
fields_.length())
return;
354 while (approx !=
NULL) {
363 approx = approx->
next_;
368 approx = approx->
next_;
373 if (a == b)
return true;
390 approx = approx->
next_;
398 return access.IsInobject() ?
FieldOf(access.offset()) : -1;
411 if (
fields_.length() < num_fields) {
421 PrintF(
"[o%d =", a->object_->id());
422 if (a->last_value_ !=
NULL)
PrintF(
" v%d", a->last_value_->id());
447 if (instr->IsStoreNamedField()) {
478 for (
int i = 0;
i < that->
stores_.length();
i++) {
494 engine(
graph(), zone());
504 for (
int i = 0;
i <
graph()->blocks()->length();
i++) {
bool Contains(E element) const
bool MustAlias(HValue *a, HValue *b)
bool MayAlias(HValue *a, HValue *b)
HFieldApproximation * Copy(Zone *zone)
HFieldApproximation * next_
State * AnalyzeOneBlock(HBasicBlock *block, State *state)
void AnalyzeDominatedBlocks(HBasicBlock *root, State *initial)
HLoadEliminationEffects(Zone *zone)
void Apply(HLoadEliminationTable *table)
void Process(HInstruction *instr, Zone *zone)
ZoneList< HStoreNamedField * > stores_
void Union(HLoadEliminationEffects *that, Zone *zone)
HValue * KillIfMisaligned(HStoreNamedField *instr)
HAliasAnalyzer * aliasing_
int FieldOf(HObjectAccess access)
static HLoadEliminationTable * Finish(HLoadEliminationTable *state, HBasicBlock *block, Zone *zone)
HLoadEliminationTable * Copy(HBasicBlock *succ, HBasicBlock *from_block, Zone *zone)
HValue * store(HStoreNamedField *instr)
bool Equal(HValue *a, HValue *b)
ZoneList< HFieldApproximation * > fields_
HFieldApproximation * Find(HValue *object, int field)
void KillFieldInternal(HValue *object, int field, HValue *value)
static HLoadEliminationTable * Merge(HLoadEliminationTable *succ_state, HBasicBlock *succ_block, HLoadEliminationTable *pred_state, HBasicBlock *pred_block, Zone *zone)
HLoadEliminationTable(Zone *zone, HAliasAnalyzer *aliasing)
HLoadEliminationTable * Merge(HBasicBlock *succ, HLoadEliminationTable *that, HBasicBlock *that_block, Zone *zone)
HLoadEliminationTable * Process(HInstruction *instr, Zone *zone)
void KillStore(HStoreNamedField *s)
HValue * load(HLoadNamedField *instr)
void KillOffset(int offset)
void EnsureFields(int num_fields)
HFieldApproximation * ReuseLastApproximation(int field)
HFieldApproximation * FindOrCreate(HValue *object, int field)
bool Equals(HValue *other)
virtual Opcode opcode() const =0
HBasicBlock * block() const
GVNFlagSet ChangesFlags() const
bool CheckChangesFlag(GVNFlag f) const
bool CheckFlag(Flag f) const
void DeleteAndReplaceWith(HValue *other)
static const int kMapOffset
static const int kElementsOffset
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
enable harmony numeric enable harmony object literal extensions Optimize object size
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 DCHECK(condition)
static const int kMaxTrackedFields
void PrintF(const char *format,...)
static const int kMaxTrackedObjects
Debugger support for the V8 JavaScript engine.