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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 HLoadNamedField* l = HLoadNamedField::cast(instr); | 50 HLoadNamedField* l = HLoadNamedField::cast(instr); |
51 TRACE((" process L%d field %d (o%d)\n", | 51 TRACE((" process L%d field %d (o%d)\n", |
52 instr->id(), | 52 instr->id(), |
53 FieldOf(l->access()), | 53 FieldOf(l->access()), |
54 l->object()->ActualValue()->id())); | 54 l->object()->ActualValue()->id())); |
55 HValue* result = load(l); | 55 HValue* result = load(l); |
56 if (result != instr && | 56 if (result != instr && |
57 result->type().Equals(instr->type()) && | 57 result->type().Equals(instr->type()) && |
58 result->representation().Equals(instr->representation()) && | 58 result->representation().Equals(instr->representation()) && |
59 (!result->IsLoadNamedField() || | 59 (!result->IsLoadNamedField() || |
60 HLoadNamedField::cast(instr)->maps()->IsSubset( | 60 HLoadNamedField::cast(instr)->CanBeReplacedWith( |
61 HLoadNamedField::cast(result)->maps()))) { | 61 HLoadNamedField::cast(result)))) { |
62 // The load can be replaced with a previous load or a value. | 62 // The load can be replaced with a previous load or a value. |
63 TRACE((" replace L%d -> v%d\n", instr->id(), result->id())); | 63 TRACE((" replace L%d -> v%d\n", instr->id(), result->id())); |
64 instr->DeleteAndReplaceWith(result); | 64 instr->DeleteAndReplaceWith(result); |
65 } | 65 } |
66 break; | 66 break; |
67 } | 67 } |
68 case HValue::kStoreNamedField: { | 68 case HValue::kStoreNamedField: { |
69 HStoreNamedField* s = HStoreNamedField::cast(instr); | 69 HStoreNamedField* s = HStoreNamedField::cast(instr); |
70 TRACE((" process S%d field %d (o%d) = v%d\n", | 70 TRACE((" process S%d field %d (o%d) = v%d\n", |
71 instr->id(), | 71 instr->id(), |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 } else { | 508 } else { |
509 // Perform only local analysis. | 509 // Perform only local analysis. |
510 for (int i = 0; i < graph()->blocks()->length(); i++) { | 510 for (int i = 0; i < graph()->blocks()->length(); i++) { |
511 table->Kill(); | 511 table->Kill(); |
512 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table); | 512 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table); |
513 } | 513 } |
514 } | 514 } |
515 } | 515 } |
516 | 516 |
517 } } // namespace v8::internal | 517 } } // namespace v8::internal |
OLD | NEW |