Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index edbffc2e241e5de193c6a8c960ed5d0978b33f13..fb72c72a535cebac35c09dd44ded5aef7a44024a 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -685,7 +685,7 @@ void HValue::Kill() { |
HValue* operand = OperandAt(i); |
if (operand == NULL) continue; |
HUseListNode* first = operand->use_list_; |
- if (first != NULL && first->value() == this && first->index() == i) { |
+ if (first != NULL && first->value()->CheckFlag(kIsDead)) { |
operand->use_list_ = first->tail(); |
} |
} |
@@ -1980,20 +1980,25 @@ void HPhi::AddIndirectUsesTo(int* dest) { |
} |
-void HSimulate::MergeInto(HSimulate* other) { |
- for (int i = 0; i < values_.length(); ++i) { |
- HValue* value = values_[i]; |
- if (HasAssignedIndexAt(i)) { |
- other->AddAssignedValue(GetAssignedIndexAt(i), value); |
- } else { |
- if (other->pop_count_ > 0) { |
- other->pop_count_--; |
+void HSimulate::MergeWith(ZoneList<HSimulate*>* list) { |
+ while (!list->is_empty()) { |
+ HSimulate* from = list->RemoveLast(); |
+ ZoneList<HValue*>* from_values = &from->values_; |
+ for (int i = 0; i < from_values->length(); ++i) { |
+ if (from->HasAssignedIndexAt(i)) { |
+ AddAssignedValue(from->GetAssignedIndexAt(i), |
+ from_values->at(i)); |
} else { |
- other->AddPushedValue(value); |
+ if (pop_count_ > 0) { |
+ pop_count_--; |
+ } else { |
+ AddPushedValue(from_values->at(i)); |
+ } |
} |
} |
+ pop_count_ += from->pop_count_; |
+ from->DeleteAndReplaceWith(NULL); |
} |
- other->pop_count_ += pop_count(); |
} |