| 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->has_transition()) { | 243 if (instr->store_mode() == STORE_TO_INITIALIZED_ENTRY) { |
| 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 { | |
| 249 // Kill non-equivalent may-alias entries. | 244 // Kill non-equivalent may-alias entries. |
| 250 KillFieldInternal(object, field, value); | 245 KillFieldInternal(object, field, value); |
| 251 } | 246 } |
| 252 HFieldApproximation* approx = FindOrCreate(object, field); | 247 HFieldApproximation* approx = FindOrCreate(object, field); |
| 253 | 248 |
| 254 if (Equal(approx->last_value_, value)) { | 249 if (Equal(approx->last_value_, value)) { |
| 255 // The store is redundant because the field already has this value. | 250 // The store is redundant because the field already has this value. |
| 256 return NULL; | 251 return NULL; |
| 257 } else { | 252 } else { |
| 258 // The store is not redundant. Update the entry. | 253 // The store is not redundant. Update the entry. |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 } else { | 498 } else { |
| 504 // Perform only local analysis. | 499 // Perform only local analysis. |
| 505 for (int i = 0; i < graph()->blocks()->length(); i++) { | 500 for (int i = 0; i < graph()->blocks()->length(); i++) { |
| 506 table->Kill(); | 501 table->Kill(); |
| 507 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table); | 502 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table); |
| 508 } | 503 } |
| 509 } | 504 } |
| 510 } | 505 } |
| 511 | 506 |
| 512 } } // namespace v8::internal | 507 } } // namespace v8::internal |
| OLD | NEW |