OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 RUNTIME_VM_REDUNDANCY_ELIMINATION_H_ | 5 #ifndef RUNTIME_VM_REDUNDANCY_ELIMINATION_H_ |
6 #define RUNTIME_VM_REDUNDANCY_ELIMINATION_H_ | 6 #define RUNTIME_VM_REDUNDANCY_ELIMINATION_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 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 class CSEInstructionMap; | 13 class CSEInstructionMap; |
14 | 14 |
15 class AllocationSinking : public ZoneAllocated { | 15 class AllocationSinking : public ZoneAllocated { |
16 public: | 16 public: |
17 explicit AllocationSinking(FlowGraph* flow_graph) | 17 explicit AllocationSinking(FlowGraph* flow_graph) |
18 : flow_graph_(flow_graph), candidates_(5), materializations_(5) {} | 18 : flow_graph_(flow_graph), candidates_(5), materializations_(5) {} |
19 | 19 |
20 const GrowableArray<Definition*>& candidates() const { return candidates_; } | 20 const GrowableArray<Definition*>& candidates() const { return candidates_; } |
21 | 21 |
22 // Find the materialization insterted for the given allocation | 22 // Find the materialization inserted for the given allocation |
23 // at the given exit. | 23 // at the given exit. |
24 MaterializeObjectInstr* MaterializationFor(Definition* alloc, | 24 MaterializeObjectInstr* MaterializationFor(Definition* alloc, |
25 Instruction* exit); | 25 Instruction* exit); |
26 | 26 |
27 void Optimize(); | 27 void Optimize(); |
28 | 28 |
29 void DetachMaterializations(); | 29 void DetachMaterializations(); |
30 | 30 |
31 private: | 31 private: |
32 // Helper class to collect deoptimization exits that might need to | 32 // Helper class to collect deoptimization exits that might need to |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void TrySpecializeSmiPhi(PhiInstr* phi, | 134 void TrySpecializeSmiPhi(PhiInstr* phi, |
135 BlockEntryInstr* header, | 135 BlockEntryInstr* header, |
136 BlockEntryInstr* pre_header); | 136 BlockEntryInstr* pre_header); |
137 | 137 |
138 FlowGraph* const flow_graph_; | 138 FlowGraph* const flow_graph_; |
139 }; | 139 }; |
140 | 140 |
141 } // namespace dart | 141 } // namespace dart |
142 | 142 |
143 #endif // RUNTIME_VM_REDUNDANCY_ELIMINATION_H_ | 143 #endif // RUNTIME_VM_REDUNDANCY_ELIMINATION_H_ |
OLD | NEW |