Commit 7c87f90c authored by vegorov@chromium.org's avatar vegorov@chromium.org

Remove NearestNextGapPos. It is not used anymore.

Remove uses of NearestGapPos in splitting helpers. We can split at any position.

Review URL: http://codereview.chromium.org/5605004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5937 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent fa9a0625
......@@ -460,12 +460,6 @@ int LChunk::NearestGapPos(int index) const {
}
int LChunk::NearestNextGapPos(int index) const {
while (!IsGapAt(index)) index++;
return index;
}
void LChunk::AddGapMove(int index, LOperand* from, LOperand* to) {
GetGapAt(index)->GetOrCreateParallelMove(LGap::START)->AddMove(from, to);
}
......
......@@ -1887,7 +1887,6 @@ class LChunk: public ZoneObject {
LGap* GetGapAt(int index) const;
bool IsGapAt(int index) const;
int NearestGapPos(int index) const;
int NearestNextGapPos(int index) const;
void MarkEmptyBlocks();
const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
LLabel* GetLabel(int block_id) const {
......
......@@ -460,12 +460,6 @@ int LChunk::NearestGapPos(int index) const {
}
int LChunk::NearestNextGapPos(int index) const {
while (!IsGapAt(index)) index++;
return index;
}
void LChunk::AddGapMove(int index, LOperand* from, LOperand* to) {
GetGapAt(index)->GetOrCreateParallelMove(LGap::START)->AddMove(from, to);
}
......
......@@ -1890,7 +1890,6 @@ class LChunk: public ZoneObject {
LGap* GetGapAt(int index) const;
bool IsGapAt(int index) const;
int NearestGapPos(int index) const;
int NearestNextGapPos(int index) const;
void MarkEmptyBlocks();
const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
LLabel* GetLabel(int block_id) const {
......
......@@ -1784,11 +1784,9 @@ bool LAllocator::TryAllocateFreeReg(LiveRange* current) {
TraceAlloc("Assigning reg %d to live range %d\n", max_reg, current->id());
current->set_assigned_register(max_reg, mode_ == XMM_REGISTERS);
} else {
// Split the interval at the nearest gap and never split an interval at its
// start position.
LifetimePosition pos =
LifetimePosition::FromInstructionIndex(
chunk_->NearestGapPos(free_pos[max_reg].InstructionIndex()));
// Split the interval before first use position of max_reg and never split
// it interval at its start position.
LifetimePosition pos = free_pos[max_reg];
if (pos.Value() <= current->Start().Value()) return false;
LiveRange* second_range = Split(current, pos);
AddToUnhandledSorted(second_range);
......@@ -1871,9 +1869,7 @@ void LAllocator::AllocateBlockedReg(LiveRange* current) {
void LAllocator::SplitAndSpillIntersecting(LiveRange* current) {
ASSERT(current->HasRegisterAssigned());
int reg = current->assigned_register();
LifetimePosition split_pos =
LifetimePosition::FromInstructionIndex(
chunk_->NearestGapPos(current->Start().InstructionIndex()));
LifetimePosition split_pos = current->Start();
for (int i = 0; i < active_live_ranges_.length(); ++i) {
LiveRange* range = active_live_ranges_[i];
if (range->assigned_register() == reg) {
......@@ -2012,8 +2008,6 @@ void LAllocator::SplitAndSpill(LiveRange* range,
void LAllocator::SplitAndSpill(LiveRange* range, LifetimePosition at) {
at = LifetimePosition::FromInstructionIndex(
chunk_->NearestGapPos(at.InstructionIndex()));
LiveRange* second_part = Split(range, at);
Spill(second_part);
}
......
......@@ -216,11 +216,6 @@ class LChunk: public ZoneObject {
return 0;
}
int NearestNextGapPos(int index) const {
UNIMPLEMENTED();
return 0;
}
void MarkEmptyBlocks() { UNIMPLEMENTED(); }
#ifdef DEBUG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment