Commit 26420587 authored by titzer@chromium.org's avatar titzer@chromium.org

Fix off-by-one bug in TurboFan register allocator.

R=jarin@chromium.org
BUG=

Review URL: https://codereview.chromium.org/671703003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24778 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 12a82ef3
......@@ -862,6 +862,11 @@ class InstructionSequence FINAL {
return instruction_blocks_[rpo_number.ToSize()];
}
int LastLoopInstructionIndex(const InstructionBlock* block) {
return instruction_blocks_[block->loop_end().ToSize() - 1]
->last_instruction_index();
}
const InstructionBlock* InstructionBlockAt(
BasicBlock::RpoNumber rpo_number) const {
return instruction_blocks_[rpo_number.ToSize()];
......
......@@ -1328,11 +1328,9 @@ void RegisterAllocator::BuildLiveRanges() {
BitVector::Iterator iterator(live);
LifetimePosition start = LifetimePosition::FromInstructionIndex(
block->first_instruction_index());
int end_index = code()
->InstructionBlockAt(block->loop_end())
->last_instruction_index();
LifetimePosition end =
LifetimePosition::FromInstructionIndex(end_index).NextInstruction();
LifetimePosition::FromInstructionIndex(
code()->LastLoopInstructionIndex(block)).NextInstruction();
while (!iterator.Done()) {
int operand_index = iterator.Current();
LiveRange* range = LiveRangeFor(operand_index);
......
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