Index: src/lithium-allocator.h |
=================================================================== |
--- src/lithium-allocator.h (revision 10782) |
+++ src/lithium-allocator.h (working copy) |
@@ -216,7 +216,7 @@ |
// Split this interval at the given position without effecting the |
// live range that owns it. The interval must contain the position. |
- void SplitAt(LifetimePosition pos); |
+ void SplitAt(LifetimePosition pos, Zone* zone); |
// If this interval intersects with other return smallest position |
// that belongs to both of them. |
@@ -277,7 +277,7 @@ |
public: |
static const int kInvalidAssignment = 0x7fffffff; |
- explicit LiveRange(int id); |
+ LiveRange(int id, Zone* zone); |
UseInterval* first_interval() const { return first_interval_; } |
UsePosition* first_pos() const { return first_pos_; } |
@@ -288,11 +288,13 @@ |
int id() const { return id_; } |
bool IsFixed() const { return id_ < 0; } |
bool IsEmpty() const { return first_interval() == NULL; } |
- LOperand* CreateAssignedOperand(); |
+ LOperand* CreateAssignedOperand(Zone* zone); |
int assigned_register() const { return assigned_register_; } |
int spill_start_index() const { return spill_start_index_; } |
- void set_assigned_register(int reg, RegisterKind register_kind); |
- void MakeSpilled(); |
+ void set_assigned_register(int reg, |
+ RegisterKind register_kind, |
+ Zone* zone); |
+ void MakeSpilled(Zone* zone); |
// Returns use position in this live range that follows both start |
// and last processed use position. |
@@ -316,7 +318,7 @@ |
// the range. |
// All uses following the given position will be moved from this |
// live range to the result live range. |
- void SplitAt(LifetimePosition position, LiveRange* result); |
+ void SplitAt(LifetimePosition position, LiveRange* result, Zone* zone); |
bool IsDouble() const { return is_double_; } |
bool HasRegisterAssigned() const { |
@@ -355,9 +357,15 @@ |
LifetimePosition FirstIntersection(LiveRange* other); |
// Add a new interval or a new use position to this live range. |
- void EnsureInterval(LifetimePosition start, LifetimePosition end); |
- void AddUseInterval(LifetimePosition start, LifetimePosition end); |
- UsePosition* AddUsePosition(LifetimePosition pos, LOperand* operand); |
+ void EnsureInterval(LifetimePosition start, |
+ LifetimePosition end, |
+ Zone* zone); |
+ void AddUseInterval(LifetimePosition start, |
+ LifetimePosition end, |
+ Zone* zone); |
+ UsePosition* AddUsePosition(LifetimePosition pos, |
+ LOperand* operand, |
+ Zone* zone); |
// Shorten the most recently added interval by setting a new start. |
void ShortenTo(LifetimePosition start); |
@@ -369,7 +377,7 @@ |
#endif |
private: |
- void ConvertOperands(); |
+ void ConvertOperands(Zone* zone); |
UseInterval* FirstSearchIntervalForPosition(LifetimePosition position) const; |
void AdvanceLastProcessedMarker(UseInterval* to_start_of, |
LifetimePosition but_not_past) const; |
@@ -400,8 +408,8 @@ |
return bits_->Contains(value); |
} |
- void Add(int value) { |
- EnsureCapacity(value); |
+ void Add(int value, Zone* zone) { |
+ EnsureCapacity(value, zone); |
bits_->Add(value); |
} |
@@ -412,11 +420,11 @@ |
return bits_ != NULL && bits_->length() > value; |
} |
- void EnsureCapacity(int value) { |
+ void EnsureCapacity(int value, Zone* zone) { |
if (InBitsRange(value)) return; |
int new_length = bits_ == NULL ? kInitialLength : bits_->length(); |
while (new_length <= value) new_length *= 2; |
- BitVector* new_bits = new BitVector(new_length); |
+ BitVector* new_bits = new(zone) BitVector(new_length); |
if (bits_ != NULL) new_bits->CopyFrom(*bits_); |
bits_ = new_bits; |
} |
@@ -587,11 +595,10 @@ |
inline LGap* GapAt(int index); |
+ Zone* zone_; |
+ |
LChunk* chunk_; |
- // Indicates success or failure during register allocation. |
- bool allocation_ok_; |
- |
// During liveness analysis keep a mapping from block id to live_in sets |
// for blocks already analyzed. |
ZoneList<BitVector*> live_in_sets_; |
@@ -621,6 +628,9 @@ |
bool has_osr_entry_; |
+ // Indicates success or failure during register allocation. |
+ bool allocation_ok_; |
+ |
DISALLOW_COPY_AND_ASSIGN(LAllocator); |
}; |