From 6333383cebc52e2793074bd28d43960771c45644 Mon Sep 17 00:00:00 2001 From: "mmassi@chromium.org" Date: Tue, 12 Feb 2013 12:04:29 +0000 Subject: [PATCH] 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 --- src/hydrogen-instructions.cc | 7 +++++++ src/hydrogen-instructions.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index b353cdb..c8b16c2 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -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 diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 3e53eca..20e5b3b 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -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); } } -- 2.7.4