Remove instructions properly (stack check elimination was leaving "dangling uses" around).

BUG=

Review URL: https://codereview.chromium.org/12224090

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13647 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mmassi@chromium.org 2013-02-12 12:04:29 +00:00
parent 9eec096914
commit 6333383ceb
2 changed files with 8 additions and 1 deletions

View File

@ -790,6 +790,13 @@ void HInstruction::Verify() {
// HValue::DataEquals. The default implementation is UNREACHABLE. We
// don't actually care whether DataEquals returns true or false here.
if (CheckFlag(kUseGVN)) DataEquals(this);
// Verify that all uses are in the graph.
for (HUseIterator use = uses(); !use.Done(); use.Advance()) {
if (use.value()->IsInstruction()) {
ASSERT(HInstruction::cast(use.value())->IsLinked());
}
}
}
#endif

View File

@ -1546,7 +1546,7 @@ class HStackCheck: public HTemplateInstruction<1> {
// The stack check eliminator might try to eliminate the same stack
// check instruction multiple times.
if (IsLinked()) {
DeleteFromGraph();
DeleteAndReplaceWith(NULL);
}
}