OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
(...skipping 5966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5977 ComparisonInstr* comparison = branch->comparison(); | 5977 ComparisonInstr* comparison = branch->comparison(); |
5978 ComparisonInstr* new_comparison = NULL; | 5978 ComparisonInstr* new_comparison = NULL; |
5979 if (comparison->IsStrictCompare()) { | 5979 if (comparison->IsStrictCompare()) { |
5980 new_comparison = new StrictCompareInstr(comparison->kind(), left, right); | 5980 new_comparison = new StrictCompareInstr(comparison->kind(), left, right); |
5981 } else if (comparison->IsEqualityCompare()) { | 5981 } else if (comparison->IsEqualityCompare()) { |
5982 EqualityCompareInstr* equality_compare = comparison->AsEqualityCompare(); | 5982 EqualityCompareInstr* equality_compare = comparison->AsEqualityCompare(); |
5983 EqualityCompareInstr* new_equality_compare = | 5983 EqualityCompareInstr* new_equality_compare = |
5984 new EqualityCompareInstr(equality_compare->token_pos(), | 5984 new EqualityCompareInstr(equality_compare->token_pos(), |
5985 comparison->kind(), | 5985 comparison->kind(), |
5986 left, | 5986 left, |
5987 right); | 5987 right, |
| 5988 Array::Handle()); |
5988 new_equality_compare->set_ic_data(equality_compare->ic_data()); | 5989 new_equality_compare->set_ic_data(equality_compare->ic_data()); |
5989 new_comparison = new_equality_compare; | 5990 new_comparison = new_equality_compare; |
5990 } else { | 5991 } else { |
5991 ASSERT(comparison->IsRelationalOp()); | 5992 ASSERT(comparison->IsRelationalOp()); |
5992 RelationalOpInstr* relational_op = comparison->AsRelationalOp(); | 5993 RelationalOpInstr* relational_op = comparison->AsRelationalOp(); |
5993 RelationalOpInstr* new_relational_op = | 5994 RelationalOpInstr* new_relational_op = |
5994 new RelationalOpInstr(relational_op->token_pos(), | 5995 new RelationalOpInstr(relational_op->token_pos(), |
5995 comparison->kind(), | 5996 comparison->kind(), |
5996 left, | 5997 left, |
5997 right); | 5998 right, |
| 5999 Array::Handle()); |
5998 new_relational_op->set_ic_data(relational_op->ic_data()); | 6000 new_relational_op->set_ic_data(relational_op->ic_data()); |
5999 new_comparison = new_relational_op; | 6001 new_comparison = new_relational_op; |
6000 } | 6002 } |
6001 return new BranchInstr(new_comparison, branch->is_checked()); | 6003 return new BranchInstr(new_comparison, branch->is_checked()); |
6002 } | 6004 } |
6003 | 6005 |
6004 | 6006 |
6005 void BranchSimplifier::Simplify(FlowGraph* flow_graph) { | 6007 void BranchSimplifier::Simplify(FlowGraph* flow_graph) { |
6006 // Optimize some branches that test the value of a phi. When it is safe | 6008 // Optimize some branches that test the value of a phi. When it is safe |
6007 // to do so, push the branch to each of the predecessor blocks. This is | 6009 // to do so, push the branch to each of the predecessor blocks. This is |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6494 | 6496 |
6495 // Insert materializations at environment uses. | 6497 // Insert materializations at environment uses. |
6496 const Class& cls = Class::Handle(alloc->constructor().Owner()); | 6498 const Class& cls = Class::Handle(alloc->constructor().Owner()); |
6497 for (intptr_t i = 0; i < exits.length(); i++) { | 6499 for (intptr_t i = 0; i < exits.length(); i++) { |
6498 CreateMaterializationAt(exits[i], alloc, cls, *fields); | 6500 CreateMaterializationAt(exits[i], alloc, cls, *fields); |
6499 } | 6501 } |
6500 } | 6502 } |
6501 | 6503 |
6502 | 6504 |
6503 } // namespace dart | 6505 } // namespace dart |
OLD | NEW |