| Index: src/lithium-allocator.cc
|
| diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc
|
| index 91a98112b61bd60a50b56d98f8ca4eebacdf01ff..f9ff55e6a039593cb472d25560bcefa197a25fa9 100644
|
| --- a/src/lithium-allocator.cc
|
| +++ b/src/lithium-allocator.cc
|
| @@ -606,7 +606,7 @@ void LAllocator::AddInitialIntervals(HBasicBlock* block,
|
|
|
|
|
| int LAllocator::FixedDoubleLiveRangeID(int index) {
|
| - return -index - 1 - Register::kNumAllocatableRegisters;
|
| + return -index - 1 - Register::kNumAllocatableRegisters; // XXX: This talks about double but uses regular Register::??
|
| }
|
|
|
|
|
| @@ -651,7 +651,7 @@ LiveRange* LAllocator::FixedLiveRangeFor(int index) {
|
|
|
|
|
| LiveRange* LAllocator::FixedDoubleLiveRangeFor(int index) {
|
| - ASSERT(index < DoubleRegister::kNumAllocatableRegisters);
|
| + ASSERT(index < DoubleRegister::NumAllocatableRegisters());
|
| LiveRange* result = fixed_double_live_ranges_[index];
|
| if (result == NULL) {
|
| result = new(zone_) LiveRange(FixedDoubleLiveRangeID(index), zone_);
|
| @@ -959,7 +959,7 @@ void LAllocator::ProcessInstructions(HBasicBlock* block, BitVector* live) {
|
| }
|
|
|
| if (instr->IsMarkedAsCall()) {
|
| - for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; ++i) {
|
| + for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); ++i) {
|
| if (output == NULL || !output->IsDoubleRegister() ||
|
| output->index() != i) {
|
| LiveRange* range = FixedDoubleLiveRangeFor(i);
|
| @@ -1478,7 +1478,7 @@ void LAllocator::AllocateGeneralRegisters() {
|
|
|
| void LAllocator::AllocateDoubleRegisters() {
|
| HPhase phase("L_Allocate double registers", this);
|
| - num_registers_ = DoubleRegister::kNumAllocatableRegisters;
|
| + num_registers_ = DoubleRegister::NumAllocatableRegisters();
|
| mode_ = DOUBLE_REGISTERS;
|
| AllocateRegisters();
|
| }
|
| @@ -1502,7 +1502,7 @@ void LAllocator::AllocateRegisters() {
|
| ASSERT(inactive_live_ranges_.is_empty());
|
|
|
| if (mode_ == DOUBLE_REGISTERS) {
|
| - for (int i = 0; i < fixed_double_live_ranges_.length(); ++i) {
|
| + for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); ++i) {
|
| LiveRange* current = fixed_double_live_ranges_.at(i);
|
| if (current != NULL) {
|
| AddToInactive(current);
|
| @@ -1755,16 +1755,12 @@ void LAllocator::InactiveToActive(LiveRange* range) {
|
| }
|
|
|
|
|
| -// TryAllocateFreeReg and AllocateBlockedReg assume this
|
| -// when allocating local arrays.
|
| -STATIC_ASSERT(DoubleRegister::kNumAllocatableRegisters >=
|
| - Register::kNumAllocatableRegisters);
|
| -
|
| -
|
| bool LAllocator::TryAllocateFreeReg(LiveRange* current) {
|
| - LifetimePosition free_until_pos[DoubleRegister::kNumAllocatableRegisters];
|
| + ASSERT(DoubleRegister::NumAllocatableRegisters() >=
|
| + Register::kNumAllocatableRegisters);
|
| + LifetimePosition free_until_pos[DoubleRegister::kNumRegisters];
|
|
|
| - for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) {
|
| + for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); i++) {
|
| free_until_pos[i] = LifetimePosition::MaxPosition();
|
| }
|
|
|
| @@ -1844,6 +1840,8 @@ bool LAllocator::TryAllocateFreeReg(LiveRange* current) {
|
|
|
|
|
| void LAllocator::AllocateBlockedReg(LiveRange* current) {
|
| + ASSERT(DoubleRegister::NumAllocatableRegisters() >=
|
| + Register::kNumAllocatableRegisters);
|
| UsePosition* register_use = current->NextRegisterPosition(current->Start());
|
| if (register_use == NULL) {
|
| // There is no use in the current live range that requires a register.
|
| @@ -1853,10 +1851,10 @@ void LAllocator::AllocateBlockedReg(LiveRange* current) {
|
| }
|
|
|
|
|
| - LifetimePosition use_pos[DoubleRegister::kNumAllocatableRegisters];
|
| - LifetimePosition block_pos[DoubleRegister::kNumAllocatableRegisters];
|
| + LifetimePosition use_pos[DoubleRegister::kNumRegisters];
|
| + LifetimePosition block_pos[DoubleRegister::kNumRegisters];
|
|
|
| - for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) {
|
| + for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); i++) {
|
| use_pos[i] = block_pos[i] = LifetimePosition::MaxPosition();
|
| }
|
|
|
|
|