Index: src/compiler/register-allocator.cc |
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc |
index 7def50e47aa069572228668614bcee6510ea9798..e0487fa8e3b1693e2ca5ea201b9f72635fb639cf 100644 |
--- a/src/compiler/register-allocator.cc |
+++ b/src/compiler/register-allocator.cc |
@@ -1071,7 +1071,7 @@ void RegisterAllocator::MeetRegisterConstraintsForLastInstructionInBlock( |
for (auto succ : block->successors()) { |
const InstructionBlock* successor = code()->InstructionBlockAt(succ); |
DCHECK(successor->PredecessorCount() == 1); |
- int gap_index = successor->first_instruction_index() + 1; |
+ int gap_index = successor->first_instruction_index(); |
DCHECK(code()->IsGapAt(gap_index)); |
// Create an unconstrained operand for the same virtual register |
@@ -1088,7 +1088,7 @@ void RegisterAllocator::MeetRegisterConstraintsForLastInstructionInBlock( |
for (auto succ : block->successors()) { |
const InstructionBlock* successor = code()->InstructionBlockAt(succ); |
DCHECK(successor->PredecessorCount() == 1); |
- int gap_index = successor->first_instruction_index() + 1; |
+ int gap_index = successor->first_instruction_index(); |
range->SpillAtDefinition(local_zone(), gap_index, output); |
range->SetSpillStartIndex(gap_index); |
} |
@@ -1398,7 +1398,7 @@ ParallelMove* RegisterAllocator::GetConnectingParallelMove( |
} |
int gap_pos = pos.IsInstructionStart() ? (index - 1) : (index + 1); |
return code()->GapAt(gap_pos)->GetOrCreateParallelMove( |
- (gap_pos < index) ? GapInstruction::AFTER : GapInstruction::BEFORE, |
+ (gap_pos < index) ? GapInstruction::AFTER : GapInstruction::START, |
code_zone()); |
} |
@@ -2325,7 +2325,8 @@ void RegisterAllocator::SplitAndSpillIntersecting(LiveRange* current) { |
bool RegisterAllocator::IsBlockBoundary(LifetimePosition pos) { |
return pos.IsInstructionStart() && |
- InstructionAt(pos.InstructionIndex())->IsBlockStart(); |
+ code()->GetInstructionBlock(pos.InstructionIndex())->code_start() == |
+ pos.InstructionIndex(); |
} |
@@ -2420,9 +2421,13 @@ void RegisterAllocator::SpillBetweenUntil(LiveRange* range, |
// The split result intersects with [start, end[. |
// Split it at position between ]start+1, end[, spill the middle part |
// and put the rest to unhandled. |
+ auto third_part_end = end.PrevInstruction().InstructionEnd(); |
+ if (IsBlockBoundary(end.InstructionStart())) { |
+ third_part_end = end.InstructionStart(); |
+ } |
auto third_part = SplitBetween( |
second_part, Max(second_part->Start().InstructionEnd(), until), |
- end.PrevInstruction().InstructionEnd()); |
+ third_part_end); |
DCHECK(third_part != second_part); |