diff --git a/src/hydrogen.cc b/src/hydrogen.cc index b999ab9278..b879909e53 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -5734,12 +5734,12 @@ void HTracer::TraceLiveRanges(const char* name, LAllocator* allocator) { Tag tag(this, "intervals"); PrintStringProperty("name", name); - const ZoneList* fixed_d = allocator->fixed_double_live_ranges(); + const Vector* fixed_d = allocator->fixed_double_live_ranges(); for (int i = 0; i < fixed_d->length(); ++i) { TraceLiveRange(fixed_d->at(i), "fixed"); } - const ZoneList* fixed = allocator->fixed_live_ranges(); + const Vector* fixed = allocator->fixed_live_ranges(); for (int i = 0; i < fixed->length(); ++i) { TraceLiveRange(fixed->at(i), "fixed"); } diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc index 1e79c006b3..198339090b 100644 --- a/src/lithium-allocator.cc +++ b/src/lithium-allocator.cc @@ -525,6 +525,24 @@ LifetimePosition LiveRange::FirstIntersection(LiveRange* other) { } +LAllocator::LAllocator(int num_values, HGraph* graph) + : chunk_(NULL), + live_in_sets_(graph->blocks()->length()), + live_ranges_(num_values * 2), + fixed_live_ranges_(NULL), + fixed_double_live_ranges_(NULL), + unhandled_live_ranges_(num_values * 2), + active_live_ranges_(8), + inactive_live_ranges_(8), + reusable_slots_(8), + next_virtual_register_(num_values), + first_artificial_register_(num_values), + mode_(NONE), + num_registers_(-1), + graph_(graph), + has_osr_entry_(false) {} + + void LAllocator::InitializeLivenessAnalysis() { // Initialize the live_in sets for each block to NULL. int block_count = graph_->blocks()->length(); @@ -618,11 +636,7 @@ LOperand* LAllocator::AllocateFixed(LUnallocated* operand, LiveRange* LAllocator::FixedLiveRangeFor(int index) { - if (index >= fixed_live_ranges_.length()) { - fixed_live_ranges_.AddBlock(NULL, - index - fixed_live_ranges_.length() + 1); - } - + ASSERT(index < Register::kNumAllocatableRegisters); LiveRange* result = fixed_live_ranges_[index]; if (result == NULL) { result = new LiveRange(FixedLiveRangeID(index)); @@ -635,11 +649,7 @@ LiveRange* LAllocator::FixedLiveRangeFor(int index) { LiveRange* LAllocator::FixedDoubleLiveRangeFor(int index) { - if (index >= fixed_double_live_ranges_.length()) { - fixed_double_live_ranges_.AddBlock(NULL, - index - fixed_double_live_ranges_.length() + 1); - } - + ASSERT(index < DoubleRegister::kNumAllocatableRegisters); LiveRange* result = fixed_double_live_ranges_[index]; if (result == NULL) { result = new LiveRange(FixedDoubleLiveRangeID(index)); @@ -650,6 +660,7 @@ LiveRange* LAllocator::FixedDoubleLiveRangeFor(int index) { return result; } + LiveRange* LAllocator::LiveRangeFor(int index) { if (index >= live_ranges_.length()) { live_ranges_.AddBlock(NULL, index - live_ranges_.length() + 1); diff --git a/src/lithium-allocator.h b/src/lithium-allocator.h index d53ea78718..14a0201a8a 100644 --- a/src/lithium-allocator.h +++ b/src/lithium-allocator.h @@ -428,22 +428,7 @@ class GrowableBitVector BASE_EMBEDDED { class LAllocator BASE_EMBEDDED { public: - explicit LAllocator(int first_virtual_register, HGraph* graph) - : chunk_(NULL), - live_in_sets_(0), - live_ranges_(16), - fixed_live_ranges_(8), - fixed_double_live_ranges_(8), - unhandled_live_ranges_(8), - active_live_ranges_(8), - inactive_live_ranges_(8), - reusable_slots_(8), - next_virtual_register_(first_virtual_register), - first_artificial_register_(first_virtual_register), - mode_(NONE), - num_registers_(-1), - graph_(graph), - has_osr_entry_(false) {} + LAllocator(int first_virtual_register, HGraph* graph); static void Setup(); static void TraceAlloc(const char* msg, ...); @@ -468,10 +453,10 @@ class LAllocator BASE_EMBEDDED { void Allocate(LChunk* chunk); const ZoneList* live_ranges() const { return &live_ranges_; } - const ZoneList* fixed_live_ranges() const { + const Vector* fixed_live_ranges() const { return &fixed_live_ranges_; } - const ZoneList* fixed_double_live_ranges() const { + const Vector* fixed_double_live_ranges() const { return &fixed_double_live_ranges_; } @@ -616,8 +601,10 @@ class LAllocator BASE_EMBEDDED { ZoneList live_ranges_; // Lists of live ranges - ZoneList fixed_live_ranges_; - ZoneList fixed_double_live_ranges_; + EmbeddedVector + fixed_live_ranges_; + EmbeddedVector + fixed_double_live_ranges_; ZoneList unhandled_live_ranges_; ZoneList active_live_ranges_; ZoneList inactive_live_ranges_;