Chromium Code Reviews| Index: runtime/vm/intermediate_language.cc |
| diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc |
| index 87e5407ce22e6968396bfe23f4293e389e4d84c9..58823144b9e2d87b3e1fb0d527a363f4944b90d0 100644 |
| --- a/runtime/vm/intermediate_language.cc |
| +++ b/runtime/vm/intermediate_language.cc |
| @@ -937,6 +937,20 @@ void JoinEntryInstr::InsertPhi(PhiInstr* phi) { |
| phis_->Add(phi); |
| } |
| +void JoinEntryInstr::RemovePhi(PhiInstr* phi) { |
| + ASSERT(phis_ != NULL); |
| + intptr_t to_index = 0; |
| + for (intptr_t from_index = 0; from_index < phis_->length(); ++from_index) { |
|
Kevin Millikin (Google)
2013/06/25 09:18:29
Is this better than searching for the phi and repl
Vyacheslav Egorov (Google)
2013/06/25 18:02:39
Done.
|
| + PhiInstr* current = (*phis_)[from_index]; |
| + if (phi != current) { |
| + if (to_index != from_index) { |
| + (*phis_)[to_index] = current; |
| + } |
| + to_index++; |
| + } |
| + } |
| + phis_->RemoveLast(); |
| +} |
| void JoinEntryInstr::RemoveDeadPhis(Definition* replacement) { |
| if (phis_ == NULL) return; |