| 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 const GrowableArray<BitVector*>& dom_frontier); | 240 const GrowableArray<BitVector*>& dom_frontier); |
| 241 | 241 |
| 242 void RemoveDeadPhis(GrowableArray<PhiInstr*>* live_phis); | 242 void RemoveDeadPhis(GrowableArray<PhiInstr*>* live_phis); |
| 243 | 243 |
| 244 void ReplacePredecessor(BlockEntryInstr* old_block, | 244 void ReplacePredecessor(BlockEntryInstr* old_block, |
| 245 BlockEntryInstr* new_block); | 245 BlockEntryInstr* new_block); |
| 246 | 246 |
| 247 // Find the natural loop for the back edge m->n and attach loop | 247 // Find the natural loop for the back edge m->n and attach loop |
| 248 // information to block n (loop header). The algorithm is described in | 248 // information to block n (loop header). The algorithm is described in |
| 249 // "Advanced Compiler Design & Implementation" (Muchnick) p192. | 249 // "Advanced Compiler Design & Implementation" (Muchnick) p192. |
| 250 void FindLoop(BlockEntryInstr* m, BlockEntryInstr* n); | 250 // Returns a BitVector indexed by block pre-order number where each bit |
| 251 // indicates membership in the loop. |
| 252 BitVector* FindLoop(BlockEntryInstr* m, BlockEntryInstr* n); |
| 251 | 253 |
| 252 // Finds natural loops in the flow graph and attaches a list of loop | 254 // Finds natural loops in the flow graph and attaches a list of loop |
| 253 // body blocks for each loop header. | 255 // body blocks for each loop header. |
| 254 ZoneGrowableArray<BlockEntryInstr*>* ComputeLoops(); | 256 ZoneGrowableArray<BlockEntryInstr*>* ComputeLoops(); |
| 255 | 257 |
| 256 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used | 258 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used |
| 257 // if/when computing SSA. | 259 // if/when computing SSA. |
| 258 GrowableArray<intptr_t> parent_; | 260 GrowableArray<intptr_t> parent_; |
| 259 GrowableArray<BitVector*> assigned_vars_; | 261 GrowableArray<BitVector*> assigned_vars_; |
| 260 | 262 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 // Per block sets of available blocks. Block A is available at the block B if | 383 // Per block sets of available blocks. Block A is available at the block B if |
| 382 // and only if A dominates B and all paths from A to B are free of side | 384 // and only if A dominates B and all paths from A to B are free of side |
| 383 // effects. | 385 // effects. |
| 384 GrowableArray<BitVector*> available_at_; | 386 GrowableArray<BitVector*> available_at_; |
| 385 }; | 387 }; |
| 386 | 388 |
| 387 | 389 |
| 388 } // namespace dart | 390 } // namespace dart |
| 389 | 391 |
| 390 #endif // VM_FLOW_GRAPH_H_ | 392 #endif // VM_FLOW_GRAPH_H_ |
| OLD | NEW |