Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: src/lithium-allocator.cc

Issue 12867002: Fixed two register allocator bugs (off-by-one error/failure propagation). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed MIPS Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/lithium-allocator.h ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium-allocator.cc
diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc
index e3b9a8872956c2de6f4bcf62be5f8c0b1a3c5dbc..6ee9ef2e7a17474794a231ca8845102408c80d77 100644
--- a/src/lithium-allocator.cc
+++ b/src/lithium-allocator.cc
@@ -839,8 +839,9 @@ void LAllocator::MeetConstraintsBetween(LInstruction* first,
ASSERT(!cur_input->IsUsedAtStart());
LUnallocated* input_copy = cur_input->CopyUnconstrained(zone());
- cur_input->set_virtual_register(GetVirtualRegister());
+ int vreg = GetVirtualRegister();
if (!AllocationOk()) return;
+ cur_input->set_virtual_register(vreg);
if (RequiredRegisterKind(input_copy->virtual_register()) ==
DOUBLE_REGISTERS) {
@@ -1924,6 +1925,7 @@ void LAllocator::AllocateBlockedReg(LiveRange* current) {
LiveRange* tail = SplitBetween(current,
current->Start(),
block_pos[reg].InstructionStart());
+ if (!AllocationOk()) return;
AddToUnhandledSorted(tail);
}
@@ -1954,6 +1956,7 @@ void LAllocator::SplitAndSpillIntersecting(LiveRange* current) {
} else {
SpillBetween(range, split_pos, next_pos->pos());
}
+ if (!AllocationOk()) return;
ActiveToHandled(range);
--i;
}
@@ -1972,6 +1975,7 @@ void LAllocator::SplitAndSpillIntersecting(LiveRange* current) {
next_intersection = Min(next_intersection, next_pos->pos());
SpillBetween(range, split_pos, next_intersection);
}
+ if (!AllocationOk()) return;
InactiveToHandled(range);
--i;
}
@@ -1997,8 +2001,9 @@ LiveRange* LAllocator::SplitRangeAt(LiveRange* range, LifetimePosition pos) {
ASSERT(pos.IsInstructionStart() ||
!chunk_->instructions()->at(pos.InstructionIndex())->IsControl());
- LiveRange* result = LiveRangeFor(GetVirtualRegister());
+ int vreg = GetVirtualRegister();
if (!AllocationOk()) return NULL;
+ LiveRange* result = LiveRangeFor(vreg);
range->SplitAt(pos, result, zone_);
return result;
}
@@ -2075,6 +2080,7 @@ void LAllocator::SpillBetween(LiveRange* range,
second_part,
second_part->Start().InstructionEnd(),
end.PrevInstruction().InstructionEnd());
+ if (!AllocationOk()) return;
ASSERT(third_part != second_part);
« no previous file with comments | « src/lithium-allocator.h ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698