| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 261 } |
| 262 | 262 |
| 263 | 263 |
| 264 void ConstantPropagator::VisitCheckArrayBound(CheckArrayBoundInstr* instr) {} | 264 void ConstantPropagator::VisitCheckArrayBound(CheckArrayBoundInstr* instr) {} |
| 265 | 265 |
| 266 | 266 |
| 267 void ConstantPropagator::VisitDeoptimize(DeoptimizeInstr* instr) { | 267 void ConstantPropagator::VisitDeoptimize(DeoptimizeInstr* instr) { |
| 268 // TODO(vegorov) remove all code after DeoptimizeInstr as dead. | 268 // TODO(vegorov) remove all code after DeoptimizeInstr as dead. |
| 269 } | 269 } |
| 270 | 270 |
| 271 void ConstantPropagator::VisitGrowRegExpStack(GrowRegExpStackInstr* instr) {} | |
| 272 | 271 |
| 273 Definition* ConstantPropagator::UnwrapPhi(Definition* defn) { | 272 Definition* ConstantPropagator::UnwrapPhi(Definition* defn) { |
| 274 if (defn->IsPhi()) { | 273 if (defn->IsPhi()) { |
| 275 JoinEntryInstr* block = defn->AsPhi()->block(); | 274 JoinEntryInstr* block = defn->AsPhi()->block(); |
| 276 | 275 |
| 277 Definition* input = NULL; | 276 Definition* input = NULL; |
| 278 for (intptr_t i = 0; i < defn->InputCount(); ++i) { | 277 for (intptr_t i = 0; i < defn->InputCount(); ++i) { |
| 279 if (reachable_->Contains(block->PredecessorAt(i)->preorder_number())) { | 278 if (reachable_->Contains(block->PredecessorAt(i)->preorder_number())) { |
| 280 if (input == NULL) { | 279 if (input == NULL) { |
| 281 input = defn->InputAt(i)->definition(); | 280 input = defn->InputAt(i)->definition(); |
| (...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1735 GrowableArray<BitVector*> dominance_frontier; | 1734 GrowableArray<BitVector*> dominance_frontier; |
| 1736 graph_->ComputeDominators(&dominance_frontier); | 1735 graph_->ComputeDominators(&dominance_frontier); |
| 1737 | 1736 |
| 1738 if (FLAG_trace_constant_propagation && | 1737 if (FLAG_trace_constant_propagation && |
| 1739 FlowGraphPrinter::ShouldPrint(graph_->function())) { | 1738 FlowGraphPrinter::ShouldPrint(graph_->function())) { |
| 1740 FlowGraphPrinter::PrintGraph("After CP", graph_); | 1739 FlowGraphPrinter::PrintGraph("After CP", graph_); |
| 1741 } | 1740 } |
| 1742 } | 1741 } |
| 1743 | 1742 |
| 1744 } // namespace dart | 1743 } // namespace dart |
| OLD | NEW |