Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/compiler/register-allocator.h b/src/compiler/register-allocator.h
index c67d60e..caadcba 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -412,19 +412,9 @@
void SetUseHints(int register_index);
void UnsetUseHints() { SetUseHints(kUnassignedRegister); }
- // Used solely by the Greedy Allocator:
- unsigned GetSize();
- float weight() const { return weight_; }
- void set_weight(float weight) { weight_ = weight; }
- LiveRangeGroup* group() const { return group_; }
- void set_group(LiveRangeGroup* group) { group_ = group; }
void Print(const RegisterConfiguration* config, bool with_children) const;
void Print(bool with_children) const;
- static const int kInvalidSize = -1;
- static const float kInvalidWeight;
- static const float kMaxWeight;
-
private:
friend class TopLevelLiveRange;
explicit LiveRange(int relative_id, MachineRepresentation rep,
@@ -461,17 +451,6 @@
mutable UsePosition* current_hint_position_;
// Cache the last position splintering stopped at.
mutable UsePosition* splitting_pointer_;
- // greedy: the number of LifetimePositions covered by this range. Used to
- // prioritize selecting live ranges for register assignment, as well as
- // in weight calculations.
- int size_;
-
- // greedy: a metric for resolving conflicts between ranges with an assigned
- // register and ranges that intersect them and need a register.
- float weight_;
-
- // greedy: groupping
- LiveRangeGroup* group_;
DISALLOW_COPY_AND_ASSIGN(LiveRange);
};
@@ -483,7 +462,6 @@
ZoneVector<LiveRange*>& ranges() { return ranges_; }
const ZoneVector<LiveRange*>& ranges() const { return ranges_; }
- // TODO(mtrofin): populate assigned register and use in weight calculation.
int assigned_register() const { return assigned_register_; }
void set_assigned_register(int reg) { assigned_register_ = reg; }
@@ -700,8 +678,7 @@
SpillRange(TopLevelLiveRange* range, Zone* zone);
UseInterval* interval() const { return use_interval_; }
- // Currently, only 4 or 8 byte slots are supported.
- int ByteWidth() const;
+
bool IsEmpty() const { return live_ranges_.empty(); }
bool TryMerge(SpillRange* other);
bool HasSlot() const { return assigned_slot_ != kUnassignedSlot; }
@@ -790,6 +767,12 @@
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_;
}
@@ -801,7 +784,7 @@
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
@@ -832,7 +815,7 @@
bool ExistsUseWithoutDefinition();
bool RangesDefinedInDeferredStayInDeferred();
- void MarkAllocated(RegisterKind kind, int index);
+ void MarkAllocated(MachineRepresentation rep, int index);
PhiMapValue* InitializePhiMap(const InstructionBlock* block,
PhiInstruction* phi);
@@ -857,6 +840,7 @@
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_;
@@ -933,9 +917,9 @@
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);
@@ -969,7 +953,7 @@
class RegisterAllocator : public ZoneObject {
public:
- explicit RegisterAllocator(RegisterAllocationData* data, RegisterKind kind);
+ RegisterAllocator(RegisterAllocationData* data, RegisterKind kind);
protected:
RegisterAllocationData* data() const { return data_; }
@@ -977,8 +961,8 @@
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_;
}
// TODO(mtrofin): explain why splitting in gap START is always OK.
@@ -1031,6 +1015,9 @@
int num_allocatable_registers_;
const int* allocatable_register_codes_;
+ private:
+ bool no_combining_;
+
DISALLOW_COPY_AND_ASSIGN(RegisterAllocator);
};