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 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 class FlowGraphAllocator : public ValueObject { | 13 class FlowGraphAllocator : public ValueObject { |
14 public: | 14 public: |
15 explicit FlowGraphAllocator(const GrowableArray<BlockEntryInstr*>& blocks) | 15 explicit FlowGraphAllocator(const GrowableArray<BlockEntryInstr*>& postorder, |
Florian Schneider
2012/06/25 14:38:29
No explicit necessary.
Vyacheslav Egorov (Google)
2012/06/25 16:58:26
Done.
| |
16 : blocks_(blocks) { } | 16 intptr_t max_ssa_temp_index); |
17 | 17 |
18 void ResolveConstraints(); | 18 void ResolveConstraints(); |
19 | 19 |
20 void AnalyzeLiveness(); | |
21 | |
20 private: | 22 private: |
21 const GrowableArray<BlockEntryInstr*>& blocks_; | 23 void ComputeKillAndGenSets(); |
24 bool UpdateLiveOut(BlockEntryInstr* instr); | |
25 bool UpdateLiveIn(BlockEntryInstr* instr); | |
26 void ComputeLiveInAndLiveOutSets(); | |
27 void DumpLiveness(); | |
28 | |
srdjan
2012/06/25 17:30:05
It woud be nice to have comments describing briefl
| |
29 GrowableArray<BitVector*> live_out_; | |
30 GrowableArray<BitVector*> kill_; | |
31 GrowableArray<BitVector*> gen_; | |
32 GrowableArray<BitVector*> live_in_; | |
33 const GrowableArray<BlockEntryInstr*>& postorder_; | |
34 const intptr_t vreg_count_; | |
22 | 35 |
23 DISALLOW_COPY_AND_ASSIGN(FlowGraphAllocator); | 36 DISALLOW_COPY_AND_ASSIGN(FlowGraphAllocator); |
24 }; | 37 }; |
25 | 38 |
26 } // namespace dart | 39 } // namespace dart |
27 | 40 |
28 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ | 41 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ |
OLD | NEW |