Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index c5a7146eb430653ff049af8c6169e55b3ca4bf94..49e52570468577f33e618ddba248b5750074ffbe 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -285,24 +285,19 @@ void HValue::SetOperandAt(int index, HValue* value) { |
void HValue::ReplaceAndDelete(HValue* other) { |
- ReplaceValue(other); |
+ if (other != NULL) ReplaceValue(other); |
Delete(); |
} |
void HValue::ReplaceValue(HValue* other) { |
- ZoneList<HValue*> start_uses(2); |
for (int i = 0; i < uses_.length(); ++i) { |
- HValue* use = uses_.at(i); |
- if (!use->block()->IsStartBlock()) { |
- InternalReplaceAtUse(use, other); |
- other->uses_.Add(use); |
- } else { |
- start_uses.Add(use); |
- } |
+ HValue* use = uses_[i]; |
+ ASSERT(!use->block()->IsStartBlock()); |
+ InternalReplaceAtUse(use, other); |
+ other->uses_.Add(use); |
} |
- uses_.Clear(); |
- uses_.AddAll(start_uses); |
+ uses_.Rewind(0); |
} |