Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Side by Side Diff: runtime/vm/flow_graph_allocator.h

Issue 10857016: Refactored FlowGraphBuilder into a separate FlowGraph representation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revision based on Kevin's review. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 AllocationFinger; 13 class AllocationFinger;
14 class BlockInfo; 14 class BlockInfo;
15 class FlowGraphBuilder; 15 class FlowGraph;
16 class LiveRange; 16 class LiveRange;
17 class UseInterval; 17 class UseInterval;
18 class UsePosition; 18 class UsePosition;
19 19
20 class FlowGraphAllocator : public ValueObject { 20 class FlowGraphAllocator : public ValueObject {
21 public: 21 public:
22 FlowGraphAllocator(const GrowableArray<BlockEntryInstr*>& block_order, 22 explicit FlowGraphAllocator(const FlowGraph& flow_graph);
23 FlowGraphBuilder* builder);
24 23
25 void AllocateRegisters(); 24 void AllocateRegisters();
26 25
27 // Build live-in and live-out sets for each block. 26 // Build live-in and live-out sets for each block.
28 void AnalyzeLiveness(); 27 void AnalyzeLiveness();
29 28
30 // Map a virtual register number to its live range. 29 // Map a virtual register number to its live range.
31 LiveRange* GetLiveRange(intptr_t vreg); 30 LiveRange* GetLiveRange(intptr_t vreg);
32 31
33 private: 32 private:
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 void SpillBetween(LiveRange* range, intptr_t from, intptr_t to); 166 void SpillBetween(LiveRange* range, intptr_t from, intptr_t to);
168 167
169 // Mark the live range as a live object pointer at all safepoints 168 // Mark the live range as a live object pointer at all safepoints
170 // contained in the range. 169 // contained in the range.
171 void MarkAsObjectAtSafepoints(LiveRange* range); 170 void MarkAsObjectAtSafepoints(LiveRange* range);
172 171
173 MoveOperands* AddMoveAt(intptr_t pos, Location to, Location from); 172 MoveOperands* AddMoveAt(intptr_t pos, Location to, Location from);
174 173
175 void PrintLiveRanges(); 174 void PrintLiveRanges();
176 175
177 // TODO(vegorov): this field is used only to call Bailout. Remove when 176 const FlowGraph& flow_graph_;
178 // all bailouts are gone.
179 FlowGraphBuilder* builder_;
180
181 const GrowableArray<BlockEntryInstr*>& block_order_; 177 const GrowableArray<BlockEntryInstr*>& block_order_;
182 const GrowableArray<BlockEntryInstr*>& postorder_; 178 const GrowableArray<BlockEntryInstr*>& postorder_;
183 179
184 // Mapping between lifetime positions and instructions. 180 // Mapping between lifetime positions and instructions.
185 GrowableArray<Instruction*> instructions_; 181 GrowableArray<Instruction*> instructions_;
186 182
187 // Mapping between lifetime positions and blocks containing them. 183 // Mapping between lifetime positions and blocks containing them.
188 GrowableArray<BlockInfo*> block_info_; 184 GrowableArray<BlockInfo*> block_info_;
189 185
190 // Live-out sets for each block. They contain indices of SSA values 186 // Live-out sets for each block. They contain indices of SSA values
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 506
511 AllocationFinger finger_; 507 AllocationFinger finger_;
512 508
513 DISALLOW_COPY_AND_ASSIGN(LiveRange); 509 DISALLOW_COPY_AND_ASSIGN(LiveRange);
514 }; 510 };
515 511
516 512
517 } // namespace dart 513 } // namespace dart
518 514
519 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ 515 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698