Reviewers: Michael Starzinger,
Message:
PTAL.
Description:
Fix bug in r10812.
BUG=
TEST=
Please review this at http://codereview.chromium.org/9455016/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/hydrogen-instructions.cc
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index
9d39d033eb7a9d0cf56c8a24b6b6ef0dbf73f235..302d43029a62b6b7340c03d01a43e2e034ec1269
100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -384,9 +384,18 @@ void HValue::DeleteAndReplaceWith(HValue* other) {
if (other != NULL) ReplaceAllUsesWith(other);
ASSERT(HasNoUses());
// Clearing the operands includes going through the use list of each
operand
- // to remove this HValue, which can be expensive. Instead, we simply
mark it
- // as dead and remove it lazily from the operands' use lists.
+ // to remove this HValue, which can be expensive. Instead, we mark this
as
+ // dead and only the first item in the use list of each operand. For the
+ // following items in the use lists we rely on the tail() method to skip
dead
+ // dead items and remove them lazily.
SetFlag(kIsDead);
+ for (int i = 0; i < OperandCount(); ++i) {
+ HValue* operand = OperandAt(i);
+ HUseListNode* first = operand->use_list_;
+ if (first->index() == i && first->value() == this) {
+ operand->use_list_ = first->tail();
+ }
+ }
DeleteFromGraph();
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev