| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 CheckEitherNonSmiInstr* instr) { } | 251 CheckEitherNonSmiInstr* instr) { } |
| 252 | 252 |
| 253 | 253 |
| 254 void ConstantPropagator::VisitCheckArrayBound(CheckArrayBoundInstr* instr) { } | 254 void ConstantPropagator::VisitCheckArrayBound(CheckArrayBoundInstr* instr) { } |
| 255 | 255 |
| 256 | 256 |
| 257 void ConstantPropagator::VisitDeoptimize(DeoptimizeInstr* instr) { | 257 void ConstantPropagator::VisitDeoptimize(DeoptimizeInstr* instr) { |
| 258 // TODO(vegorov) remove all code after DeoptimizeInstr as dead. | 258 // TODO(vegorov) remove all code after DeoptimizeInstr as dead. |
| 259 } | 259 } |
| 260 | 260 |
| 261 void ConstantPropagator::VisitGrowRegExpStack(GrowRegExpStackInstr* instr) { } |
| 261 | 262 |
| 262 Definition* ConstantPropagator::UnwrapPhi(Definition* defn) { | 263 Definition* ConstantPropagator::UnwrapPhi(Definition* defn) { |
| 263 if (defn->IsPhi()) { | 264 if (defn->IsPhi()) { |
| 264 JoinEntryInstr* block = defn->AsPhi()->block(); | 265 JoinEntryInstr* block = defn->AsPhi()->block(); |
| 265 | 266 |
| 266 Definition* input = NULL; | 267 Definition* input = NULL; |
| 267 for (intptr_t i = 0; i < defn->InputCount(); ++i) { | 268 for (intptr_t i = 0; i < defn->InputCount(); ++i) { |
| 268 if (reachable_->Contains(block->PredecessorAt(i)->preorder_number())) { | 269 if (reachable_->Contains(block->PredecessorAt(i)->preorder_number())) { |
| 269 if (input == NULL) { | 270 if (input == NULL) { |
| 270 input = defn->InputAt(i)->definition(); | 271 input = defn->InputAt(i)->definition(); |
| (...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 graph_->ComputeDominators(&dominance_frontier); | 1635 graph_->ComputeDominators(&dominance_frontier); |
| 1635 | 1636 |
| 1636 if (FLAG_trace_constant_propagation) { | 1637 if (FLAG_trace_constant_propagation) { |
| 1637 OS::Print("\n==== After constant propagation ====\n"); | 1638 OS::Print("\n==== After constant propagation ====\n"); |
| 1638 FlowGraphPrinter printer(*graph_); | 1639 FlowGraphPrinter printer(*graph_); |
| 1639 printer.PrintBlocks(); | 1640 printer.PrintBlocks(); |
| 1640 } | 1641 } |
| 1641 } | 1642 } |
| 1642 | 1643 |
| 1643 } // namespace dart | 1644 } // namespace dart |
| OLD | NEW |