OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "hydrogen-alias-analysis.h" | 5 #include "hydrogen-alias-analysis.h" |
6 #include "hydrogen-load-elimination.h" | 6 #include "hydrogen-load-elimination.h" |
7 #include "hydrogen-instructions.h" | 7 #include "hydrogen-instructions.h" |
8 #include "hydrogen-flow-engine.h" | 8 #include "hydrogen-flow-engine.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 TRACE((" skipping non existing property initialization store\n")); | 233 TRACE((" skipping non existing property initialization store\n")); |
234 return instr; | 234 return instr; |
235 } | 235 } |
236 | 236 |
237 int field = FieldOf(instr->access()); | 237 int field = FieldOf(instr->access()); |
238 if (field < 0) return KillIfMisaligned(instr); | 238 if (field < 0) return KillIfMisaligned(instr); |
239 | 239 |
240 HValue* object = instr->object()->ActualValue(); | 240 HValue* object = instr->object()->ActualValue(); |
241 HValue* value = instr->value(); | 241 HValue* value = instr->value(); |
242 | 242 |
243 if (instr->store_mode() == STORE_TO_INITIALIZED_ENTRY) { | 243 if (instr->has_transition()) { |
| 244 // A transition introduces a new field and alters the map of the object. |
| 245 // Since the field in the object is new, it cannot alias existing entries. |
| 246 // TODO(titzer): introduce a constant for the new map and remember it. |
| 247 KillFieldInternal(object, FieldOf(JSObject::kMapOffset), NULL); |
| 248 } else { |
244 // Kill non-equivalent may-alias entries. | 249 // Kill non-equivalent may-alias entries. |
245 KillFieldInternal(object, field, value); | 250 KillFieldInternal(object, field, value); |
246 } | 251 } |
247 HFieldApproximation* approx = FindOrCreate(object, field); | 252 HFieldApproximation* approx = FindOrCreate(object, field); |
248 | 253 |
249 if (Equal(approx->last_value_, value)) { | 254 if (Equal(approx->last_value_, value)) { |
250 // The store is redundant because the field already has this value. | 255 // The store is redundant because the field already has this value. |
251 return NULL; | 256 return NULL; |
252 } else { | 257 } else { |
253 // The store is not redundant. Update the entry. | 258 // The store is not redundant. Update the entry. |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 } else { | 503 } else { |
499 // Perform only local analysis. | 504 // Perform only local analysis. |
500 for (int i = 0; i < graph()->blocks()->length(); i++) { | 505 for (int i = 0; i < graph()->blocks()->length(); i++) { |
501 table->Kill(); | 506 table->Kill(); |
502 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table); | 507 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table); |
503 } | 508 } |
504 } | 509 } |
505 } | 510 } |
506 | 511 |
507 } } // namespace v8::internal | 512 } } // namespace v8::internal |
OLD | NEW |