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

Unified Diff: src/lithium-allocator.cc

Issue 6312057: Fix control flow resolution bug in lithium register allocator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: add assertion Created 9 years, 11 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 | « no previous file | no next file » | 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 cac7d65e98f0dc4c91fd387236a647e954e95f40..81877f37685a01fad0cfd4e6a2c399121a41e1eb 100644
--- a/src/lithium-allocator.cc
+++ b/src/lithium-allocator.cc
@@ -1068,9 +1068,7 @@ void LAllocator::ResolveControlFlow(LiveRange* range,
HBasicBlock* block,
HBasicBlock* pred) {
LifetimePosition pred_end =
- LifetimePosition::FromInstructionIndex(pred->last_instruction_index()).
- PrevInstruction();
-
+ LifetimePosition::FromInstructionIndex(pred->last_instruction_index());
LifetimePosition cur_start =
LifetimePosition::FromInstructionIndex(block->first_instruction_index());
LiveRange* pred_cover = NULL;
@@ -1245,7 +1243,7 @@ void LAllocator::BuildLiveRanges() {
LifetimePosition start = LifetimePosition::FromInstructionIndex(
block->first_instruction_index());
LifetimePosition end = LifetimePosition::FromInstructionIndex(
- back_edge->last_instruction_index());
+ back_edge->last_instruction_index()).NextInstruction();
while (!iterator.Done()) {
int operand_index = iterator.Current();
LiveRange* range = LiveRangeFor(operand_index);
@@ -2019,6 +2017,11 @@ LiveRange* LAllocator::SplitAt(LiveRange* range, LifetimePosition pos) {
if (pos.Value() <= range->Start().Value()) return range;
+ // We can't properly connect liveranges if split occured at the end
+ // of control instruction.
+ ASSERT(pos.IsInstructionStart() ||
+ !chunk_->instructions()->at(pos.InstructionIndex())->IsControl());
+
LiveRange* result = LiveRangeFor(next_virtual_register_++);
range->SplitAt(pos, result);
return result;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698