| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 static bool Optimize(FlowGraph* graph); | 281 static bool Optimize(FlowGraph* graph); |
| 282 | 282 |
| 283 private: | 283 private: |
| 284 static bool OptimizeRecursive( | 284 static bool OptimizeRecursive( |
| 285 FlowGraph* graph, | 285 FlowGraph* graph, |
| 286 BlockEntryInstr* entry, | 286 BlockEntryInstr* entry, |
| 287 CSEInstructionMap* map); | 287 CSEInstructionMap* map); |
| 288 }; | 288 }; |
| 289 | 289 |
| 290 | 290 |
| 291 class DeadStoreElimination : public AllStatic { |
| 292 public: |
| 293 static void Optimize(FlowGraph* graph); |
| 294 }; |
| 295 |
| 296 |
| 291 // Sparse conditional constant propagation and unreachable code elimination. | 297 // Sparse conditional constant propagation and unreachable code elimination. |
| 292 // Assumes that use lists are computed and preserves them. | 298 // Assumes that use lists are computed and preserves them. |
| 293 class ConstantPropagator : public FlowGraphVisitor { | 299 class ConstantPropagator : public FlowGraphVisitor { |
| 294 public: | 300 public: |
| 295 ConstantPropagator(FlowGraph* graph, | 301 ConstantPropagator(FlowGraph* graph, |
| 296 const GrowableArray<BlockEntryInstr*>& ignored); | 302 const GrowableArray<BlockEntryInstr*>& ignored); |
| 297 | 303 |
| 298 static void Optimize(FlowGraph* graph); | 304 static void Optimize(FlowGraph* graph); |
| 299 | 305 |
| 300 // (1) Visit branches to optimize away unreachable blocks discovered by range | 306 // (1) Visit branches to optimize away unreachable blocks discovered by range |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 // Optimize spill stores inside try-blocks by identifying values that always | 435 // Optimize spill stores inside try-blocks by identifying values that always |
| 430 // contain a single known constant at catch block entry. | 436 // contain a single known constant at catch block entry. |
| 431 class TryCatchAnalyzer : public AllStatic { | 437 class TryCatchAnalyzer : public AllStatic { |
| 432 public: | 438 public: |
| 433 static void Optimize(FlowGraph* flow_graph); | 439 static void Optimize(FlowGraph* flow_graph); |
| 434 }; | 440 }; |
| 435 | 441 |
| 436 } // namespace dart | 442 } // namespace dart |
| 437 | 443 |
| 438 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 444 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |