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/constant_propagator.h" | 5 #include "vm/constant_propagator.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
9 #include "vm/flow_graph_compiler.h" | 9 #include "vm/flow_graph_compiler.h" |
10 #include "vm/flow_graph_range_analysis.h" | 10 #include "vm/flow_graph_range_analysis.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 void ConstantPropagator::VisitThrow(ThrowInstr* instr) { | 175 void ConstantPropagator::VisitThrow(ThrowInstr* instr) { |
176 // Nothing to do. | 176 // Nothing to do. |
177 } | 177 } |
178 | 178 |
179 | 179 |
180 void ConstantPropagator::VisitReThrow(ReThrowInstr* instr) { | 180 void ConstantPropagator::VisitReThrow(ReThrowInstr* instr) { |
181 // Nothing to do. | 181 // Nothing to do. |
182 } | 182 } |
183 | 183 |
184 | 184 |
| 185 void ConstantPropagator::VisitStop(StopInstr* instr) { |
| 186 // Nothing to do. |
| 187 } |
| 188 |
| 189 |
185 void ConstantPropagator::VisitGoto(GotoInstr* instr) { | 190 void ConstantPropagator::VisitGoto(GotoInstr* instr) { |
186 SetReachable(instr->successor()); | 191 SetReachable(instr->successor()); |
187 | 192 |
188 // Phi value depends on the reachability of a predecessor. We have | 193 // Phi value depends on the reachability of a predecessor. We have |
189 // to revisit phis every time a predecessor becomes reachable. | 194 // to revisit phis every time a predecessor becomes reachable. |
190 for (PhiIterator it(instr->successor()); !it.Done(); it.Advance()) { | 195 for (PhiIterator it(instr->successor()); !it.Done(); it.Advance()) { |
191 it.Current()->Accept(this); | 196 it.Current()->Accept(this); |
192 } | 197 } |
193 } | 198 } |
194 | 199 |
(...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 graph_->MergeBlocks(); | 1663 graph_->MergeBlocks(); |
1659 GrowableArray<BitVector*> dominance_frontier; | 1664 GrowableArray<BitVector*> dominance_frontier; |
1660 graph_->ComputeDominators(&dominance_frontier); | 1665 graph_->ComputeDominators(&dominance_frontier); |
1661 | 1666 |
1662 if (FLAG_trace_constant_propagation) { | 1667 if (FLAG_trace_constant_propagation) { |
1663 FlowGraphPrinter::PrintGraph("After CP", graph_); | 1668 FlowGraphPrinter::PrintGraph("After CP", graph_); |
1664 } | 1669 } |
1665 } | 1670 } |
1666 | 1671 |
1667 } // namespace dart | 1672 } // namespace dart |
OLD | NEW |