| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 void InsertPhis( | 211 void InsertPhis( |
| 212 const GrowableArray<BlockEntryInstr*>& preorder, | 212 const GrowableArray<BlockEntryInstr*>& preorder, |
| 213 const GrowableArray<BitVector*>& assigned_vars, | 213 const GrowableArray<BitVector*>& assigned_vars, |
| 214 const GrowableArray<BitVector*>& dom_frontier); | 214 const GrowableArray<BitVector*>& dom_frontier); |
| 215 | 215 |
| 216 void RemoveDeadPhis(GrowableArray<PhiInstr*>* live_phis); | 216 void RemoveDeadPhis(GrowableArray<PhiInstr*>* live_phis); |
| 217 | 217 |
| 218 void ReplacePredecessor(BlockEntryInstr* old_block, | 218 void ReplacePredecessor(BlockEntryInstr* old_block, |
| 219 BlockEntryInstr* new_block); | 219 BlockEntryInstr* new_block); |
| 220 | 220 |
| 221 // Find the natural loop for the back edge m->n and attach loop |
| 222 // information to block n (loop header). The algorithm is described in |
| 223 // "Advanced Compiler Design & Implementation" (Muchnick) p192. |
| 224 void FindLoop(BlockEntryInstr* m, BlockEntryInstr* n); |
| 225 |
| 221 // Finds natural loops in the flow graph and attaches a list of loop | 226 // Finds natural loops in the flow graph and attaches a list of loop |
| 222 // body blocks for each loop header. | 227 // body blocks for each loop header. |
| 223 ZoneGrowableArray<BlockEntryInstr*>* ComputeLoops(); | 228 ZoneGrowableArray<BlockEntryInstr*>* ComputeLoops(); |
| 224 | 229 |
| 225 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used | 230 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used |
| 226 // if/when computing SSA. | 231 // if/when computing SSA. |
| 227 GrowableArray<intptr_t> parent_; | 232 GrowableArray<intptr_t> parent_; |
| 228 GrowableArray<BitVector*> assigned_vars_; | 233 GrowableArray<BitVector*> assigned_vars_; |
| 229 | 234 |
| 230 intptr_t current_ssa_temp_index_; | 235 intptr_t current_ssa_temp_index_; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 // Per block sets of available blocks. Block A is available at the block B if | 349 // Per block sets of available blocks. Block A is available at the block B if |
| 345 // and only if A dominates B and all paths from A to B are free of side | 350 // and only if A dominates B and all paths from A to B are free of side |
| 346 // effects. | 351 // effects. |
| 347 GrowableArray<BitVector*> available_at_; | 352 GrowableArray<BitVector*> available_at_; |
| 348 }; | 353 }; |
| 349 | 354 |
| 350 | 355 |
| 351 } // namespace dart | 356 } // namespace dart |
| 352 | 357 |
| 353 #endif // VM_FLOW_GRAPH_H_ | 358 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |