Chromium Code Reviews| 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 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 BlockEntryInstr* header, | 148 BlockEntryInstr* header, |
| 149 BlockEntryInstr* pre_header, | 149 BlockEntryInstr* pre_header, |
| 150 CheckSmiInstr* current); | 150 CheckSmiInstr* current); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 | 153 |
| 154 // A simple common subexpression elimination based | 154 // A simple common subexpression elimination based |
| 155 // on the dominator tree. | 155 // on the dominator tree. |
| 156 class DominatorBasedCSE : public AllStatic { | 156 class DominatorBasedCSE : public AllStatic { |
| 157 public: | 157 public: |
| 158 static void Optimize(FlowGraph* graph); | 158 static bool Optimize(FlowGraph* graph); |
|
srdjan
2012/10/19 14:45:50
Describe in comment what result true/false means
Florian Schneider
2012/10/22 10:31:55
Done.
| |
| 159 | 159 |
| 160 private: | 160 private: |
| 161 static void OptimizeRecursive( | 161 static bool OptimizeRecursive( |
| 162 BlockEntryInstr* entry, | 162 BlockEntryInstr* entry, |
| 163 DirectChainedHashMap<Instruction*>* map); | 163 DirectChainedHashMap<Instruction*>* map); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 | 166 |
| 167 // Sparse conditional constant propagation and unreachable code elimination. | 167 // Sparse conditional constant propagation and unreachable code elimination. |
| 168 // Assumes that use lists are computed and preserves them. | 168 // Assumes that use lists are computed and preserves them. |
| 169 class ConstantPropagator : public FlowGraphVisitor { | 169 class ConstantPropagator : public FlowGraphVisitor { |
| 170 public: | 170 public: |
| 171 ConstantPropagator(FlowGraph* graph, | 171 ConstantPropagator(FlowGraph* graph, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 | 220 |
| 221 // Worklists of blocks and definitions. | 221 // Worklists of blocks and definitions. |
| 222 GrowableArray<BlockEntryInstr*> block_worklist_; | 222 GrowableArray<BlockEntryInstr*> block_worklist_; |
| 223 GrowableArray<Definition*> definition_worklist_; | 223 GrowableArray<Definition*> definition_worklist_; |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 | 226 |
| 227 } // namespace dart | 227 } // namespace dart |
| 228 | 228 |
| 229 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 229 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |