Chromium Code Reviews| Index: vm/intermediate_language.cc |
| =================================================================== |
| --- vm/intermediate_language.cc (revision 9430) |
| +++ vm/intermediate_language.cc (working copy) |
| @@ -527,7 +527,7 @@ |
| } |
| -Instruction* Instruction::RemoveFromGraph() { |
| +Instruction* Instruction::RemoveFromGraph(RemoveReturnValue ret) { |
|
Kevin Millikin (Google)
2012/07/06 10:44:30
Do you think we could (should) get rid of this fun
|
| ASSERT(!IsBlockEntry()); |
| ASSERT(!IsBranch()); |
| ASSERT(!IsThrow()); |
| @@ -535,10 +535,11 @@ |
| ASSERT(!IsReThrow()); |
| ASSERT(previous() != NULL); |
| Instruction* next = successor(); |
| - previous()->set_successor(next); |
| + Instruction* prev = previous(); |
| + prev->set_successor(next); |
| if (next != NULL) { |
| if (!next->IsBlockEntry()) { |
| - next->set_previous(previous()); |
| + next->set_previous(prev); |
| } else { |
| // Removing the last instruction of a block. |
| // Update last_instruction of the current basic block. |
| @@ -547,14 +548,14 @@ |
| current = current->previous(); |
| } |
| ASSERT(current->AsBlockEntry()->last_instruction() == this); |
| - current->AsBlockEntry()->set_last_instruction(previous()); |
| + current->AsBlockEntry()->set_last_instruction(prev); |
| } |
| } |
| // Reset successor and previous instruction to indicate |
| // that the instruction is removed from the graph. |
| set_successor(NULL); |
| set_previous(NULL); |
| - return next; |
| + return ret == kReturnPrevious ? prev : next; |
| } |