OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_REGISTER_ALLOCATOR_H_ | 5 #ifndef V8_REGISTER_ALLOCATOR_H_ |
6 #define V8_REGISTER_ALLOCATOR_H_ | 6 #define V8_REGISTER_ALLOCATOR_H_ |
7 | 7 |
8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
10 #include "src/register-configuration.h" | 10 #include "src/register-configuration.h" |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 assigned_slot_ = index; | 688 assigned_slot_ = index; |
689 } | 689 } |
690 int assigned_slot() { | 690 int assigned_slot() { |
691 DCHECK_NE(kUnassignedSlot, assigned_slot_); | 691 DCHECK_NE(kUnassignedSlot, assigned_slot_); |
692 return assigned_slot_; | 692 return assigned_slot_; |
693 } | 693 } |
694 const ZoneVector<TopLevelLiveRange*>& live_ranges() const { | 694 const ZoneVector<TopLevelLiveRange*>& live_ranges() const { |
695 return live_ranges_; | 695 return live_ranges_; |
696 } | 696 } |
697 ZoneVector<TopLevelLiveRange*>& live_ranges() { return live_ranges_; } | 697 ZoneVector<TopLevelLiveRange*>& live_ranges() { return live_ranges_; } |
| 698 // Currently, only 4 or 8 byte slots are supported in stack frames. |
| 699 // TODO(bbudge) Add 16 byte slots for SIMD. |
698 int byte_width() const { return byte_width_; } | 700 int byte_width() const { return byte_width_; } |
699 RegisterKind kind() const { return kind_; } | |
700 void Print() const; | 701 void Print() const; |
701 | 702 |
702 private: | 703 private: |
703 LifetimePosition End() const { return end_position_; } | 704 LifetimePosition End() const { return end_position_; } |
704 bool IsIntersectingWith(SpillRange* other) const; | 705 bool IsIntersectingWith(SpillRange* other) const; |
705 // Merge intervals, making sure the use intervals are sorted | 706 // Merge intervals, making sure the use intervals are sorted |
706 void MergeDisjointIntervals(UseInterval* other); | 707 void MergeDisjointIntervals(UseInterval* other); |
707 | 708 |
708 ZoneVector<TopLevelLiveRange*> live_ranges_; | 709 ZoneVector<TopLevelLiveRange*> live_ranges_; |
709 UseInterval* use_interval_; | 710 UseInterval* use_interval_; |
710 LifetimePosition end_position_; | 711 LifetimePosition end_position_; |
711 int assigned_slot_; | 712 int assigned_slot_; |
712 int byte_width_; | 713 int byte_width_; |
713 RegisterKind kind_; | |
714 | 714 |
715 DISALLOW_COPY_AND_ASSIGN(SpillRange); | 715 DISALLOW_COPY_AND_ASSIGN(SpillRange); |
716 }; | 716 }; |
717 | 717 |
718 | 718 |
719 class RegisterAllocationData final : public ZoneObject { | 719 class RegisterAllocationData final : public ZoneObject { |
720 public: | 720 public: |
721 class PhiMapValue : public ZoneObject { | 721 class PhiMapValue : public ZoneObject { |
722 public: | 722 public: |
723 PhiMapValue(PhiInstruction* phi, const InstructionBlock* block, Zone* zone); | 723 PhiMapValue(PhiInstruction* phi, const InstructionBlock* block, Zone* zone); |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 RegisterAllocationData* const data_; | 1183 RegisterAllocationData* const data_; |
1184 | 1184 |
1185 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector); | 1185 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector); |
1186 }; | 1186 }; |
1187 | 1187 |
1188 } // namespace compiler | 1188 } // namespace compiler |
1189 } // namespace internal | 1189 } // namespace internal |
1190 } // namespace v8 | 1190 } // namespace v8 |
1191 | 1191 |
1192 #endif // V8_REGISTER_ALLOCATOR_H_ | 1192 #endif // V8_REGISTER_ALLOCATOR_H_ |
OLD | NEW |