Chromium Code Reviews| Index: runtime/vm/flow_graph_compiler.cc |
| diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc |
| index 546c55c091dbc774747545bd377385268cfe3958..6735b9c94b500c89886c51c83846fd9b5bbdfb55 100644 |
| --- a/runtime/vm/flow_graph_compiler.cc |
| +++ b/runtime/vm/flow_graph_compiler.cc |
| @@ -118,10 +118,7 @@ void FlowGraphCompiler::VisitBlocks() { |
| BlockEntryInstr* successor = instr->next()->AsBlockEntry(); |
| ASSERT(successor != NULL); |
| frame_register_allocator()->Spill(); |
| - // The block ended with a "goto". We can fall through if it is the |
| - // next block in the list. Otherwise, we need a jump. |
| - if ((i == block_order().length() - 1) || |
| - (block_order()[i + 1] != successor)) { |
| + if (!IsNextBlock(successor)) { |
| assembler()->jmp(GetBlockLabel(successor)); |
| } |
| } |
| @@ -155,9 +152,10 @@ Label* FlowGraphCompiler::GetBlockLabel( |
| } |
| -bool FlowGraphCompiler::IsNextBlock(TargetEntryInstr* block_entry) const { |
| +bool FlowGraphCompiler::IsNextBlock(BlockEntryInstr* block_entry) const { |
| intptr_t current_index = reverse_index(current_block()->postorder_number()); |
| - return block_order_[current_index + 1] == block_entry; |
| + return (current_index < block_order().length() - 1) && |
|
srdjan
2012/07/12 16:42:26
Add parenthesis
|
| + (block_order()[current_index + 1] == block_entry); |
| } |