Commit 67108407 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Lazy removal of dead HValues in GVN from use lists.

BUG=v8:1969
TEST=regress/regress-1969

Review URL: https://chromiumcodereview.appspot.com/9455011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10812 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c1b97fe8
......@@ -276,6 +276,15 @@ bool HValue::IsDefinedAfter(HBasicBlock* other) const {
}
HUseListNode* HUseListNode::tail() {
// Skip and remove dead items in the use list.
while (tail_ != NULL && tail_->value()->CheckFlag(HValue::kIsDead)) {
tail_ = tail_->tail_;
}
return tail_;
}
HUseIterator::HUseIterator(HUseListNode* head) : next_(head) {
Advance();
}
......@@ -374,7 +383,10 @@ void HValue::DeleteAndReplaceWith(HValue* other) {
// We replace all uses first, so Delete can assert that there are none.
if (other != NULL) ReplaceAllUsesWith(other);
ASSERT(HasNoUses());
ClearOperands();
// 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.
SetFlag(kIsDead);
DeleteFromGraph();
}
......
......@@ -448,7 +448,7 @@ class HUseListNode: public ZoneObject {
: tail_(tail), value_(value), index_(index) {
}
HUseListNode* tail() const { return tail_; }
HUseListNode* tail();
HValue* value() const { return value_; }
int index() const { return index_; }
......@@ -530,7 +530,8 @@ class HValue: public ZoneObject {
kDeoptimizeOnUndefined,
kIsArguments,
kTruncatingToInt32,
kLastFlag = kTruncatingToInt32
kIsDead,
kLastFlag = kIsDead
};
STATIC_ASSERT(kLastFlag < kBitsPerInt);
......
# Copyright 2011 the V8 project authors. All rights reserved.
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
......@@ -65,6 +65,9 @@ regress/regress-524: (PASS || TIMEOUT), SKIP if $mode == debug
debug-liveedit-check-stack: SKIP
debug-liveedit-patch-positions-replace: SKIP
# Test Crankshaft compilation time. Expected to take too long in debug mode.
regress/regress-1969: PASS, SKIP if $mode == debug
##############################################################################
[ $isolates ]
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment