| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/cha.h" | 7 #include "vm/cha.h" |
| 8 #include "vm/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.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 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 if (current_iterator()->Current() == bind) { | 915 if (current_iterator()->Current() == bind) { |
| 916 // Current bind was not removed. | 916 // Current bind was not removed. |
| 917 // Cache propagated computation type. | 917 // Cache propagated computation type. |
| 918 AbstractType& computation_type = | 918 AbstractType& computation_type = |
| 919 AbstractType::Handle(bind->computation()->CompileType()); | 919 AbstractType::Handle(bind->computation()->CompileType()); |
| 920 bool changed = bind->SetPropagatedType(computation_type); | 920 bool changed = bind->SetPropagatedType(computation_type); |
| 921 if (changed) { | 921 if (changed) { |
| 922 still_changing_ = true; | 922 still_changing_ = true; |
| 923 } | 923 } |
| 924 // Propagate class ids. | 924 // Propagate class ids. |
| 925 intptr_t cid = bind->computation()->ResultCid(); | 925 const intptr_t cid = bind->computation()->ResultCid(); |
| 926 changed = bind->SetPropagatedCid(cid); | 926 changed = bind->SetPropagatedCid(cid); |
| 927 if (changed) { | 927 if (changed) { |
| 928 still_changing_ = true; | 928 still_changing_ = true; |
| 929 } | 929 } |
| 930 } | 930 } |
| 931 } | 931 } |
| 932 | 932 |
| 933 | 933 |
| 934 void FlowGraphTypePropagator::VisitPhi(PhiInstr* phi) { | 934 void FlowGraphTypePropagator::VisitPhi(PhiInstr* phi) { |
| 935 // We could set the propagated type of the phi to the least upper bound of its | 935 // We could set the propagated type of the phi to the least upper bound of its |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 DirectChainedHashMap<BindInstr*> child_map(*map); // Copy map. | 1063 DirectChainedHashMap<BindInstr*> child_map(*map); // Copy map. |
| 1064 OptimizeRecursive(child, &child_map); | 1064 OptimizeRecursive(child, &child_map); |
| 1065 } else { | 1065 } else { |
| 1066 OptimizeRecursive(child, map); // Reuse map for the last child. | 1066 OptimizeRecursive(child, map); // Reuse map for the last child. |
| 1067 } | 1067 } |
| 1068 } | 1068 } |
| 1069 } | 1069 } |
| 1070 | 1070 |
| 1071 | 1071 |
| 1072 } // namespace dart | 1072 } // namespace dart |
| OLD | NEW |