| 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_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 19 matching lines...) Expand all Loading... |
| 30 void AddPhi(PhiInstr* phi); | 30 void AddPhi(PhiInstr* phi); |
| 31 void Compute(); | 31 void Compute(); |
| 32 | 32 |
| 33 const FlowGraph& flow_graph_; | 33 const FlowGraph& flow_graph_; |
| 34 GrowableArray<PhiInstr*> phis_; | 34 GrowableArray<PhiInstr*> phis_; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 | 37 |
| 38 class FlowGraphAllocator : public ValueObject { | 38 class FlowGraphAllocator : public ValueObject { |
| 39 public: | 39 public: |
| 40 // Number of stack slots needed for a double spill slot. | 40 // Number of stack slots needed for a fpu register spill slot. |
| 41 static const intptr_t kDoubleSpillSlotFactor = kDoubleSize / kWordSize; | 41 static const intptr_t kFpuRegisterSpillFactor = kFpuRegisterSize / kWordSize; |
| 42 | 42 |
| 43 explicit FlowGraphAllocator(const FlowGraph& flow_graph); | 43 explicit FlowGraphAllocator(const FlowGraph& flow_graph); |
| 44 | 44 |
| 45 void AllocateRegisters(); | 45 void AllocateRegisters(); |
| 46 | 46 |
| 47 // Build live-in and live-out sets for each block. | 47 // Build live-in and live-out sets for each block. |
| 48 void AnalyzeLiveness(); | 48 void AnalyzeLiveness(); |
| 49 | 49 |
| 50 // Map a virtual register number to its live range. | 50 // Map a virtual register number to its live range. |
| 51 LiveRange* GetLiveRange(intptr_t vreg); | 51 LiveRange* GetLiveRange(intptr_t vreg); |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 | 656 |
| 657 AllocationFinger finger_; | 657 AllocationFinger finger_; |
| 658 | 658 |
| 659 DISALLOW_COPY_AND_ASSIGN(LiveRange); | 659 DISALLOW_COPY_AND_ASSIGN(LiveRange); |
| 660 }; | 660 }; |
| 661 | 661 |
| 662 | 662 |
| 663 } // namespace dart | 663 } // namespace dart |
| 664 | 664 |
| 665 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ | 665 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ |
| OLD | NEW |