OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/redundancy_elimination.h" | 5 #include "vm/redundancy_elimination.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/flow_graph.h" | 8 #include "vm/flow_graph.h" |
9 #include "vm/hash_map.h" | 9 #include "vm/hash_map.h" |
10 #include "vm/il_printer.h" | 10 #include "vm/il_printer.h" |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
996 | 996 |
997 return false; | 997 return false; |
998 } | 998 } |
999 | 999 |
1000 // Check if any use of the definition can create an alias. | 1000 // Check if any use of the definition can create an alias. |
1001 // Can add more objects into aliasing_worklist_. | 1001 // Can add more objects into aliasing_worklist_. |
1002 bool AnyUseCreatesAlias(Definition* defn) { | 1002 bool AnyUseCreatesAlias(Definition* defn) { |
1003 for (Value* use = defn->input_use_list(); use != NULL; | 1003 for (Value* use = defn->input_use_list(); use != NULL; |
1004 use = use->next_use()) { | 1004 use = use->next_use()) { |
1005 Instruction* instr = use->instruction(); | 1005 Instruction* instr = use->instruction(); |
1006 if (instr->IsPushArgument() || | 1006 if (instr->IsPushArgument() || instr->IsCheckedSmiOp() || |
1007 instr->IsCheckedSmiComparison() || | |
Vyacheslav Egorov (Google)
2016/11/15 21:58:34
We should consider making this a flag / function o
| |
1007 (instr->IsStoreIndexed() && | 1008 (instr->IsStoreIndexed() && |
1008 (use->use_index() == StoreIndexedInstr::kValuePos)) || | 1009 (use->use_index() == StoreIndexedInstr::kValuePos)) || |
1009 instr->IsStoreStaticField() || instr->IsPhi()) { | 1010 instr->IsStoreStaticField() || instr->IsPhi()) { |
1010 return true; | 1011 return true; |
1011 } else if ((instr->IsAssertAssignable() || instr->IsRedefinition()) && | 1012 } else if ((instr->IsAssertAssignable() || instr->IsRedefinition()) && |
1012 AnyUseCreatesAlias(instr->AsDefinition())) { | 1013 AnyUseCreatesAlias(instr->AsDefinition())) { |
1013 return true; | 1014 return true; |
1014 } else if ((instr->IsStoreInstanceField() && | 1015 } else if ((instr->IsStoreInstanceField() && |
1015 (use->use_index() != | 1016 (use->use_index() != |
1016 StoreInstanceFieldInstr::kInstancePos))) { | 1017 StoreInstanceFieldInstr::kInstancePos))) { |
(...skipping 2356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3373 join->phis_ = NULL; | 3374 join->phis_ = NULL; |
3374 } else { | 3375 } else { |
3375 join->phis_->TruncateTo(to_index); | 3376 join->phis_->TruncateTo(to_index); |
3376 } | 3377 } |
3377 } | 3378 } |
3378 } | 3379 } |
3379 } | 3380 } |
3380 | 3381 |
3381 | 3382 |
3382 } // namespace dart | 3383 } // namespace dart |
OLD | NEW |