| 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" |
| 11 #include "vm/il_printer.h" | 11 #include "vm/il_printer.h" |
| 12 #include "vm/intermediate_language.h" | 12 #include "vm/intermediate_language.h" |
| 13 #include "vm/parser.h" | 13 #include "vm/parser.h" |
| 14 #include "vm/symbols.h" | 14 #include "vm/symbols.h" |
| 15 | 15 |
| 16 namespace dart { | 16 namespace dart { |
| 17 | 17 |
| 18 DEFINE_FLAG(bool, remove_redundant_phis, true, "Remove redundant phis."); | 18 DEFINE_FLAG(bool, remove_redundant_phis, true, "Remove redundant phis."); |
| 19 DEFINE_FLAG(bool, trace_constant_propagation, false, | 19 DEFINE_FLAG(bool, trace_constant_propagation, false, |
| 20 "Print constant propagation and useless code elimination."); | 20 "Print constant propagation and useless code elimination."); |
| 21 | 21 |
| 22 DECLARE_FLAG(bool, fields_may_be_reset); | |
| 23 | |
| 24 // Quick access to the current zone and isolate. | 22 // Quick access to the current zone and isolate. |
| 25 #define I (isolate()) | 23 #define I (isolate()) |
| 26 #define Z (graph_->zone()) | 24 #define Z (graph_->zone()) |
| 27 | 25 |
| 28 | 26 |
| 29 ConstantPropagator::ConstantPropagator( | 27 ConstantPropagator::ConstantPropagator( |
| 30 FlowGraph* graph, | 28 FlowGraph* graph, |
| 31 const GrowableArray<BlockEntryInstr*>& ignored) | 29 const GrowableArray<BlockEntryInstr*>& ignored) |
| 32 : FlowGraphVisitor(ignored), | 30 : FlowGraphVisitor(ignored), |
| 33 graph_(graph), | 31 graph_(graph), |
| (...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 graph_->MergeBlocks(); | 1680 graph_->MergeBlocks(); |
| 1683 GrowableArray<BitVector*> dominance_frontier; | 1681 GrowableArray<BitVector*> dominance_frontier; |
| 1684 graph_->ComputeDominators(&dominance_frontier); | 1682 graph_->ComputeDominators(&dominance_frontier); |
| 1685 | 1683 |
| 1686 if (FLAG_trace_constant_propagation) { | 1684 if (FLAG_trace_constant_propagation) { |
| 1687 FlowGraphPrinter::PrintGraph("After CP", graph_); | 1685 FlowGraphPrinter::PrintGraph("After CP", graph_); |
| 1688 } | 1686 } |
| 1689 } | 1687 } |
| 1690 | 1688 |
| 1691 } // namespace dart | 1689 } // namespace dart |
| OLD | NEW |