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 12 matching lines...) Expand all Loading... |
23 : FlowGraphVisitor(flow_graph->reverse_postorder()), | 23 : FlowGraphVisitor(flow_graph->reverse_postorder()), |
24 flow_graph_(flow_graph), | 24 flow_graph_(flow_graph), |
25 use_speculative_inlining_(use_speculative_inlining), | 25 use_speculative_inlining_(use_speculative_inlining), |
26 inlining_black_list_(inlining_black_list) { | 26 inlining_black_list_(inlining_black_list) { |
27 ASSERT(!use_speculative_inlining || (inlining_black_list != NULL)); | 27 ASSERT(!use_speculative_inlining || (inlining_black_list != NULL)); |
28 } | 28 } |
29 virtual ~FlowGraphOptimizer() {} | 29 virtual ~FlowGraphOptimizer() {} |
30 | 30 |
31 FlowGraph* flow_graph() const { return flow_graph_; } | 31 FlowGraph* flow_graph() const { return flow_graph_; } |
32 | 32 |
33 // Add ICData to InstanceCalls, so that optimizations can be run on them. | |
34 // TODO(srdjan): StaticCals as well? | |
35 void PopulateWithICData(); | |
36 | |
37 // Use ICData to optimize, replace or eliminate instructions. | 33 // Use ICData to optimize, replace or eliminate instructions. |
38 void ApplyICData(); | 34 void ApplyICData(); |
39 | 35 |
40 // Use propagated class ids to optimize, replace or eliminate instructions. | 36 // Use propagated class ids to optimize, replace or eliminate instructions. |
41 void ApplyClassIds(); | 37 void ApplyClassIds(); |
42 | 38 |
43 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the | 39 // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the |
44 // shift can be a truncating Smi shift-left and result is always Smi. | 40 // shift can be a truncating Smi shift-left and result is always Smi. |
45 // Merge instructions (only per basic-block). | 41 // Merge instructions (only per basic-block). |
46 void TryOptimizePatterns(); | 42 void TryOptimizePatterns(); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 175 |
180 GrowableArray<intptr_t>* inlining_black_list_; | 176 GrowableArray<intptr_t>* inlining_black_list_; |
181 | 177 |
182 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); | 178 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); |
183 }; | 179 }; |
184 | 180 |
185 | 181 |
186 } // namespace dart | 182 } // namespace dart |
187 | 183 |
188 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ | 184 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ |
OLD | NEW |