| 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 11 matching lines...) Expand all Loading... |
| 22 virtual ~FlowGraphOptimizer() {} | 22 virtual ~FlowGraphOptimizer() {} |
| 23 | 23 |
| 24 FlowGraph* flow_graph() const { return flow_graph_; } | 24 FlowGraph* flow_graph() const { return flow_graph_; } |
| 25 | 25 |
| 26 // Use ICData to optimize, replace or eliminate instructions. | 26 // Use ICData to optimize, replace or eliminate instructions. |
| 27 void ApplyICData(); | 27 void ApplyICData(); |
| 28 | 28 |
| 29 // Use propagated class ids to optimize, replace or eliminate instructions. | 29 // Use propagated class ids to optimize, replace or eliminate instructions. |
| 30 void ApplyClassIds(); | 30 void ApplyClassIds(); |
| 31 | 31 |
| 32 // Use propagated constants to optimize instructions |
| 33 void ApplyConstants(); |
| 34 |
| 32 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the | 35 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the |
| 33 // shift can be a truncating Smi shift-left and result is always Smi. | 36 // shift can be a truncating Smi shift-left and result is always Smi. |
| 34 // Merge instructions (only per basic-block). | 37 // Merge instructions (only per basic-block). |
| 35 void TryOptimizePatterns(); | 38 void TryOptimizePatterns(); |
| 36 | 39 |
| 37 // Returns true if any instructions were canonicalized away. | 40 // Returns true if any instructions were canonicalized away. |
| 38 bool Canonicalize(); | 41 bool Canonicalize(); |
| 39 | 42 |
| 40 void EliminateDeadPhis(); | 43 void EliminateDeadPhis(); |
| 41 | 44 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 // Optimize spill stores inside try-blocks by identifying values that always | 438 // Optimize spill stores inside try-blocks by identifying values that always |
| 436 // contain a single known constant at catch block entry. | 439 // contain a single known constant at catch block entry. |
| 437 class TryCatchAnalyzer : public AllStatic { | 440 class TryCatchAnalyzer : public AllStatic { |
| 438 public: | 441 public: |
| 439 static void Optimize(FlowGraph* flow_graph); | 442 static void Optimize(FlowGraph* flow_graph); |
| 440 }; | 443 }; |
| 441 | 444 |
| 442 } // namespace dart | 445 } // namespace dart |
| 443 | 446 |
| 444 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 447 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
| OLD | NEW |