| 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/flow_graph.h" | 8 #include "vm/flow_graph.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 #include "vm/intermediate_language.h" | 10 #include "vm/intermediate_language.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 GraphEntryInstr* graph_entry_; | 50 GraphEntryInstr* graph_entry_; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 | 53 |
| 54 class FlowGraphAllocator : public ValueObject { | 54 class FlowGraphAllocator : public ValueObject { |
| 55 public: | 55 public: |
| 56 // Number of stack slots needed for a fpu register spill slot. | 56 // Number of stack slots needed for a fpu register spill slot. |
| 57 static const intptr_t kDoubleSpillFactor = kDoubleSize / kWordSize; | 57 static const intptr_t kDoubleSpillFactor = kDoubleSize / kWordSize; |
| 58 | 58 |
| 59 explicit FlowGraphAllocator(const FlowGraph& flow_graph); | 59 explicit FlowGraphAllocator(const FlowGraph& flow_graph, |
| 60 bool intrinsics_mode = false); |
| 60 | 61 |
| 61 void AllocateRegisters(); | 62 void AllocateRegisters(); |
| 62 | 63 |
| 63 // Map a virtual register number to its live range. | 64 // Map a virtual register number to its live range. |
| 64 LiveRange* GetLiveRange(intptr_t vreg); | 65 LiveRange* GetLiveRange(intptr_t vreg); |
| 65 | 66 |
| 66 private: | 67 private: |
| 67 void CollectRepresentations(); | 68 void CollectRepresentations(); |
| 68 | 69 |
| 69 // Visit blocks in the code generation order (reverse post order) and | 70 // Visit blocks in the code generation order (reverse post order) and |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 // are disjoint. | 318 // are disjoint. |
| 318 GrowableArray<bool> quad_spill_slots_; | 319 GrowableArray<bool> quad_spill_slots_; |
| 319 | 320 |
| 320 // Track whether a spill slot is expected to hold a tagged or untagged value. | 321 // Track whether a spill slot is expected to hold a tagged or untagged value. |
| 321 // This is used to keep tagged and untagged spill slots disjoint. See bug | 322 // This is used to keep tagged and untagged spill slots disjoint. See bug |
| 322 // #18955 for details. | 323 // #18955 for details. |
| 323 GrowableArray<bool> untagged_spill_slots_; | 324 GrowableArray<bool> untagged_spill_slots_; |
| 324 | 325 |
| 325 intptr_t cpu_spill_slot_count_; | 326 intptr_t cpu_spill_slot_count_; |
| 326 | 327 |
| 328 bool intrinsic_mode_; |
| 329 |
| 327 DISALLOW_COPY_AND_ASSIGN(FlowGraphAllocator); | 330 DISALLOW_COPY_AND_ASSIGN(FlowGraphAllocator); |
| 328 }; | 331 }; |
| 329 | 332 |
| 330 | 333 |
| 331 // Additional information about a block that is not contained in a | 334 // Additional information about a block that is not contained in a |
| 332 // block entry. | 335 // block entry. |
| 333 class BlockInfo : public ZoneAllocated { | 336 class BlockInfo : public ZoneAllocated { |
| 334 public: | 337 public: |
| 335 explicit BlockInfo(BlockEntryInstr* entry) | 338 explicit BlockInfo(BlockEntryInstr* entry) |
| 336 : entry_(entry), | 339 : entry_(entry), |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 | 672 |
| 670 AllocationFinger finger_; | 673 AllocationFinger finger_; |
| 671 | 674 |
| 672 DISALLOW_COPY_AND_ASSIGN(LiveRange); | 675 DISALLOW_COPY_AND_ASSIGN(LiveRange); |
| 673 }; | 676 }; |
| 674 | 677 |
| 675 | 678 |
| 676 } // namespace dart | 679 } // namespace dart |
| 677 | 680 |
| 678 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ | 681 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ |
| OLD | NEW |