Chromium Code Reviews| Index: src/compiler/register-allocator.h |
| diff --git a/src/compiler/register-allocator.h b/src/compiler/register-allocator.h |
| index 933d1d2472974dc4804582618d050baab6805849..f987736aa21fefc85bcece80e0672acd82c80a8c 100644 |
| --- a/src/compiler/register-allocator.h |
| +++ b/src/compiler/register-allocator.h |
| @@ -678,8 +678,7 @@ class SpillRange final : public ZoneObject { |
| SpillRange(TopLevelLiveRange* range, Zone* zone); |
| UseInterval* interval() const { return use_interval_; } |
| - // Currently, only 4 or 8 byte slots are supported. |
| - int ByteWidth() const; |
|
bbudge
2016/06/21 23:09:35
This is redundant, as a byte_width() getter is def
Mircea Trofin
2016/06/22 06:07:34
Acknowledged.
|
| + |
| bool IsEmpty() const { return live_ranges_.empty(); } |
| bool TryMerge(SpillRange* other); |
| bool HasSlot() const { return assigned_slot_ != kUnassignedSlot; } |
| @@ -768,6 +767,12 @@ class RegisterAllocationData final : public ZoneObject { |
| ZoneVector<TopLevelLiveRange*>& fixed_live_ranges() { |
| return fixed_live_ranges_; |
| } |
| + ZoneVector<TopLevelLiveRange*>& fixed_float_live_ranges() { |
| + return fixed_float_live_ranges_; |
| + } |
| + const ZoneVector<TopLevelLiveRange*>& fixed_float_live_ranges() const { |
| + return fixed_float_live_ranges_; |
| + } |
| ZoneVector<TopLevelLiveRange*>& fixed_double_live_ranges() { |
| return fixed_double_live_ranges_; |
| } |
| @@ -779,7 +784,7 @@ class RegisterAllocationData final : public ZoneObject { |
| ZoneVector<SpillRange*>& spill_ranges() { return spill_ranges_; } |
| DelayedReferences& delayed_references() { return delayed_references_; } |
| InstructionSequence* code() const { return code_; } |
| - // This zone is for datastructures only needed during register allocation |
| + // This zone is for data structures only needed during register allocation |
| // phases. |
| Zone* allocation_zone() const { return allocation_zone_; } |
| // This zone is for InstructionOperands and moves that live beyond register |
| @@ -810,7 +815,7 @@ class RegisterAllocationData final : public ZoneObject { |
| bool ExistsUseWithoutDefinition(); |
| bool RangesDefinedInDeferredStayInDeferred(); |
| - void MarkAllocated(RegisterKind kind, int index); |
| + void MarkAllocated(MachineRepresentation rep, int index); |
| PhiMapValue* InitializePhiMap(const InstructionBlock* block, |
| PhiInstruction* phi); |
| @@ -835,6 +840,7 @@ class RegisterAllocationData final : public ZoneObject { |
| ZoneVector<BitVector*> live_out_sets_; |
| ZoneVector<TopLevelLiveRange*> live_ranges_; |
| ZoneVector<TopLevelLiveRange*> fixed_live_ranges_; |
| + ZoneVector<TopLevelLiveRange*> fixed_float_live_ranges_; |
| ZoneVector<TopLevelLiveRange*> fixed_double_live_ranges_; |
| ZoneVector<SpillRange*> spill_ranges_; |
| DelayedReferences delayed_references_; |
| @@ -911,9 +917,9 @@ class LiveRangeBuilder final : public ZoneObject { |
| void ProcessLoopHeader(const InstructionBlock* block, BitVector* live); |
| static int FixedLiveRangeID(int index) { return -index - 1; } |
| - int FixedDoubleLiveRangeID(int index); |
| + int FixedFPLiveRangeID(int index, MachineRepresentation rep); |
| TopLevelLiveRange* FixedLiveRangeFor(int index); |
| - TopLevelLiveRange* FixedDoubleLiveRangeFor(int index); |
| + TopLevelLiveRange* FixedFPLiveRangeFor(int index, MachineRepresentation rep); |
| void MapPhiHint(InstructionOperand* operand, UsePosition* use_pos); |
| void ResolvePhiHint(InstructionOperand* operand, UsePosition* use_pos); |
| @@ -947,7 +953,7 @@ class LiveRangeBuilder final : public ZoneObject { |
| class RegisterAllocator : public ZoneObject { |
| public: |
| - explicit RegisterAllocator(RegisterAllocationData* data, RegisterKind kind); |
| + RegisterAllocator(RegisterAllocationData* data, RegisterKind kind); |
| protected: |
| RegisterAllocationData* data() const { return data_; } |
| @@ -955,9 +961,10 @@ class RegisterAllocator : public ZoneObject { |
| RegisterKind mode() const { return mode_; } |
| int num_registers() const { return num_registers_; } |
| int num_allocatable_registers() const { return num_allocatable_registers_; } |
| - int allocatable_register_code(int allocatable_index) const { |
| - return allocatable_register_codes_[allocatable_index]; |
| + const int* allocatable_register_codes() const { |
| + return allocatable_register_codes_; |
| } |
| + bool no_combining() const { return no_combining_; } |
|
Mircea Trofin
2016/06/22 06:07:34
could you add a comment as to what this represents
bbudge
2016/06/22 20:16:04
Done.
Mircea Trofin
2016/06/22 21:37:37
Where?
bbudge
2016/06/22 21:51:13
See the next revision. As for your question, I con
|
| // TODO(mtrofin): explain why splitting in gap START is always OK. |
| LifetimePosition GetSplitPositionForInstruction(const LiveRange* range, |
| @@ -1009,6 +1016,9 @@ class RegisterAllocator : public ZoneObject { |
| int num_allocatable_registers_; |
| const int* allocatable_register_codes_; |
| + private: |
| + bool no_combining_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(RegisterAllocator); |
| }; |