| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 BlockEntryInstr* header, | 140 BlockEntryInstr* header, |
| 141 BlockEntryInstr* pre_header, | 141 BlockEntryInstr* pre_header, |
| 142 Definition* current); | 142 Definition* current); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 | 145 |
| 146 // A simple common subexpression elimination based | 146 // A simple common subexpression elimination based |
| 147 // on the dominator tree. | 147 // on the dominator tree. |
| 148 class DominatorBasedCSE : public AllStatic { | 148 class DominatorBasedCSE : public AllStatic { |
| 149 public: | 149 public: |
| 150 static void Optimize(BlockEntryInstr* graph_entry); | 150 static void Optimize(FlowGraph* graph); |
| 151 | 151 |
| 152 private: | 152 private: |
| 153 static void OptimizeRecursive( | 153 static void OptimizeRecursive( |
| 154 BlockEntryInstr* entry, | 154 BlockEntryInstr* entry, |
| 155 DirectChainedHashMap<Definition*>* map); | 155 DirectChainedHashMap<Definition*>* map); |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 | 158 |
| 159 } // namespace dart | 159 } // namespace dart |
| 160 | 160 |
| 161 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 161 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |