Chromium Code Reviews| Index: src/compiler/register-allocator.cc |
| diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc |
| index 0465139bba3fdedd614d5b4a06d2be2fcc4999c6..575fc1f7cd82fc489eee9c2009a4544d6df3ea4c 100644 |
| --- a/src/compiler/register-allocator.cc |
| +++ b/src/compiler/register-allocator.cc |
| @@ -2442,12 +2442,12 @@ LifetimePosition RegisterAllocator::FindOptimalSplitPos(LifetimePosition start, |
| const InstructionBlock* block = end_block; |
| // Find header of outermost loop. |
| - // TODO(titzer): fix redundancy below. |
| - while (GetContainingLoop(code(), block) != nullptr && |
| - GetContainingLoop(code(), block)->rpo_number().ToInt() > |
| - start_block->rpo_number().ToInt()) { |
| - block = GetContainingLoop(code(), block); |
| - } |
| + do { |
| + const InstructionBlock* loop = GetContainingLoop(code(), block); |
| + if (loop == nullptr) break; |
| + if (loop->rpo_number().ToInt() <= start_block->rpo_number().ToInt()) break; |
|
Mircea Trofin
2016/02/12 17:43:58
Nit: just one if? if (loop == nullptr || loop->rpo
|
| + block = loop; |
| + } while (true); |
|
Mircea Trofin
2016/02/12 17:43:59
Nit: personal preference, I'd rather see the exit
|
| // We did not find any suitable outer loop. Split at the latest possible |
| // position unless end_block is a loop header itself. |