| 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_ALLOCATOR_H_ | 5 #ifndef VM_FLOW_GRAPH_ALLOCATOR_H_ |
| 6 #define VM_FLOW_GRAPH_ALLOCATOR_H_ | 6 #define VM_FLOW_GRAPH_ALLOCATOR_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 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Build live-in and live-out sets for each block. | 24 // Build live-in and live-out sets for each block. |
| 25 void AnalyzeLiveness(); | 25 void AnalyzeLiveness(); |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 // Compute initial values for live-out, kill and live-in sets. | 28 // Compute initial values for live-out, kill and live-in sets. |
| 29 void ComputeInitialSets(); | 29 void ComputeInitialSets(); |
| 30 | 30 |
| 31 // Update live-out set for the given block: live-out should contain | 31 // Update live-out set for the given block: live-out should contain |
| 32 // all values that are live-in for block's successors. | 32 // all values that are live-in for block's successors. |
| 33 // Returns true if live-out set was changed. | 33 // Returns true if live-out set was changed. |
| 34 bool UpdateLiveOut(BlockEntryInstr* instr); | 34 bool UpdateLiveOut(const BlockEntryInstr& instr); |
| 35 | 35 |
| 36 // Update live-in set for the given block: live-in should contain | 36 // Update live-in set for the given block: live-in should contain |
| 37 // all values that are live-out from the block and are not defined | 37 // all values that are live-out from the block and are not defined |
| 38 // by this block. | 38 // by this block. |
| 39 // Returns true if live-in set was changed. | 39 // Returns true if live-in set was changed. |
| 40 bool UpdateLiveIn(BlockEntryInstr* instr); | 40 bool UpdateLiveIn(const BlockEntryInstr& instr); |
| 41 | 41 |
| 42 // Perform fix-point iteration updating live-out and live-in sets | 42 // Perform fix-point iteration updating live-out and live-in sets |
| 43 // for blocks until they stop changing. | 43 // for blocks until they stop changing. |
| 44 void ComputeLiveInAndLiveOutSets(); | 44 void ComputeLiveInAndLiveOutSets(); |
| 45 | 45 |
| 46 // Print results of liveness analysis. | 46 // Print results of liveness analysis. |
| 47 void DumpLiveness(); | 47 void DumpLiveness(); |
| 48 | 48 |
| 49 // Visit blocks in the code generation order (reverse post order) and | 49 // Visit blocks in the code generation order (reverse post order) and |
| 50 // linearly assign consequent lifetime positions to every instruction. | 50 // linearly assign consequent lifetime positions to every instruction. |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 private: | 309 private: |
| 310 const intptr_t vreg_; | 310 const intptr_t vreg_; |
| 311 UseInterval* head_; | 311 UseInterval* head_; |
| 312 }; | 312 }; |
| 313 | 313 |
| 314 | 314 |
| 315 } // namespace dart | 315 } // namespace dart |
| 316 | 316 |
| 317 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ | 317 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ |
| OLD | NEW |