OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_H_ | 5 #ifndef VM_FLOW_GRAPH_H_ |
6 #define VM_FLOW_GRAPH_H_ | 6 #define VM_FLOW_GRAPH_H_ |
7 | 7 |
8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void set_current_ssa_temp_index(intptr_t index) { | 91 void set_current_ssa_temp_index(intptr_t index) { |
92 current_ssa_temp_index_ = index; | 92 current_ssa_temp_index_ = index; |
93 } | 93 } |
94 | 94 |
95 intptr_t max_virtual_register_number() const { | 95 intptr_t max_virtual_register_number() const { |
96 return current_ssa_temp_index(); | 96 return current_ssa_temp_index(); |
97 } | 97 } |
98 | 98 |
99 intptr_t max_block_id() const { return max_block_id_; } | 99 intptr_t max_block_id() const { return max_block_id_; } |
100 void set_max_block_id(intptr_t id) { max_block_id_ = id; } | 100 void set_max_block_id(intptr_t id) { max_block_id_ = id; } |
| 101 intptr_t allocate_block_id() { return ++max_block_id_; } |
101 | 102 |
102 GraphEntryInstr* graph_entry() const { | 103 GraphEntryInstr* graph_entry() const { |
103 return graph_entry_; | 104 return graph_entry_; |
104 } | 105 } |
105 | 106 |
106 ConstantInstr* constant_null() const { | 107 ConstantInstr* constant_null() const { |
107 return constant_null_; | 108 return constant_null_; |
108 } | 109 } |
109 | 110 |
110 intptr_t alloc_ssa_temp_index() { return current_ssa_temp_index_++; } | 111 intptr_t alloc_ssa_temp_index() { return current_ssa_temp_index_++; } |
(...skipping 28 matching lines...) Expand all Loading... |
139 bool VerifyUseLists(); | 140 bool VerifyUseLists(); |
140 #endif // DEBUG | 141 #endif // DEBUG |
141 | 142 |
142 void DiscoverBlocks(); | 143 void DiscoverBlocks(); |
143 | 144 |
144 // Compute information about effects occuring in different blocks and | 145 // Compute information about effects occuring in different blocks and |
145 // discover side-effect free paths. | 146 // discover side-effect free paths. |
146 void ComputeBlockEffects(); | 147 void ComputeBlockEffects(); |
147 BlockEffects* block_effects() const { return block_effects_; } | 148 BlockEffects* block_effects() const { return block_effects_; } |
148 | 149 |
| 150 // Remove the redefinition instructions inserted to inhibit code motion. |
| 151 void RemoveRedefinitions(); |
| 152 |
149 private: | 153 private: |
150 friend class IfConverter; | 154 friend class IfConverter; |
151 friend class BranchSimplifier; | 155 friend class BranchSimplifier; |
152 friend class ConstantPropagator; | 156 friend class ConstantPropagator; |
153 | 157 |
154 // SSA transformation methods and fields. | 158 // SSA transformation methods and fields. |
155 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); | 159 void ComputeDominators(GrowableArray<BitVector*>* dominance_frontier); |
156 | 160 |
157 void CompressPath( | 161 void CompressPath( |
158 intptr_t start_index, | 162 intptr_t start_index, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // Per block sets of available blocks. Block A is available at the block B if | 303 // Per block sets of available blocks. Block A is available at the block B if |
300 // and only if A dominates B and all paths from A to B are free of side | 304 // and only if A dominates B and all paths from A to B are free of side |
301 // effects. | 305 // effects. |
302 GrowableArray<BitVector*> available_at_; | 306 GrowableArray<BitVector*> available_at_; |
303 }; | 307 }; |
304 | 308 |
305 | 309 |
306 } // namespace dart | 310 } // namespace dart |
307 | 311 |
308 #endif // VM_FLOW_GRAPH_H_ | 312 #endif // VM_FLOW_GRAPH_H_ |
OLD | NEW |