| 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 #ifndef VM_FLOW_GRAPH_OPTIMIZER_H_ | 5 #ifndef VM_FLOW_GRAPH_OPTIMIZER_H_ |
| 6 #define VM_FLOW_GRAPH_OPTIMIZER_H_ | 6 #define VM_FLOW_GRAPH_OPTIMIZER_H_ |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
| 10 | 10 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 template <typename T> class GrowableArray; | 13 template <typename T> class GrowableArray; |
| 14 template <typename T> class DirectChainedHashMap; | 14 template <typename T> class DirectChainedHashMap; |
| 15 template <typename T> class PointerKeyValueTrait; | 15 template <typename T> class PointerKeyValueTrait; |
| 16 | 16 |
| 17 class FlowGraphOptimizer : public FlowGraphVisitor { | 17 class FlowGraphOptimizer : public FlowGraphVisitor { |
| 18 public: | 18 public: |
| 19 explicit FlowGraphOptimizer(FlowGraph* flow_graph) | 19 explicit FlowGraphOptimizer(FlowGraph* flow_graph) |
| 20 : FlowGraphVisitor(flow_graph->reverse_postorder()), | 20 : FlowGraphVisitor(flow_graph->reverse_postorder()), |
| 21 flow_graph_(flow_graph) { } | 21 flow_graph_(flow_graph) { } |
| 22 virtual ~FlowGraphOptimizer() {} | 22 virtual ~FlowGraphOptimizer() {} |
| 23 | 23 |
| 24 // Use ICData to optimize, replace or eliminate instructions. | 24 // Use ICData to optimize, replace or eliminate instructions. |
| 25 void ApplyICData(); | 25 void ApplyICData(); |
| 26 | 26 |
| 27 // Use propagated class ids to optimize, replace or eliminate instructions. | 27 // Use propagated class ids to optimize, replace or eliminate instructions. |
| 28 void ApplyClassIds(); | 28 void ApplyClassIds(); |
| 29 | 29 |
| 30 void OptimizeComputations(); | 30 void CanonicalizeComputations(); |
| 31 | 31 |
| 32 void EliminateDeadPhis(); | 32 void EliminateDeadPhis(); |
| 33 | 33 |
| 34 void SelectRepresentations(); | 34 void SelectRepresentations(); |
| 35 | 35 |
| 36 void PropagateSminess(); | 36 void PropagateSminess(); |
| 37 | 37 |
| 38 void InferSmiRanges(); | 38 void InferSmiRanges(); |
| 39 | 39 |
| 40 virtual void VisitStaticCall(StaticCallInstr* instr); | 40 virtual void VisitStaticCall(StaticCallInstr* instr); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 // Worklists of blocks and definitions. | 236 // Worklists of blocks and definitions. |
| 237 GrowableArray<BlockEntryInstr*> block_worklist_; | 237 GrowableArray<BlockEntryInstr*> block_worklist_; |
| 238 GrowableArray<Definition*> definition_worklist_; | 238 GrowableArray<Definition*> definition_worklist_; |
| 239 }; | 239 }; |
| 240 | 240 |
| 241 | 241 |
| 242 } // namespace dart | 242 } // namespace dart |
| 243 | 243 |
| 244 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 244 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |