# HG changeset patch # User Gilles Duboscq # Date 1340204387 -7200 # Node ID 29684ae5a194b8e0feaf2cb1b5baf765cacc1683 # Parent 21e8f6b5a7d1fed2d0ebbd1f754417894e2da813 Make sure snippet instentiation doesn't produce dead nodes and remove redundant DCE diff -r 21e8f6b5a7d1 -r 29684ae5a194 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java Wed Jun 20 16:55:39 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java Wed Jun 20 16:59:47 2012 +0200 @@ -385,7 +385,6 @@ SnippetTemplate template = cache.get(key); Debug.log("Lowering checkcast in %s: node=%s, template=%s, arguments=%s", graph, checkcast, template, arguments); template.instantiate(runtime, checkcast, checkcast, arguments); - new DeadCodeEliminationPhase().apply(graph); } private static HotSpotKlassOop[] createHints(TypeCheckHints hints) { diff -r 21e8f6b5a7d1 -r 29684ae5a194 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewInstanceSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewInstanceSnippets.java Wed Jun 20 16:55:39 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewInstanceSnippets.java Wed Jun 20 16:59:47 2012 +0200 @@ -188,7 +188,6 @@ //System.out.printf("Lowering newInstance in %s: node=%s, template=%s, arguments=%s%n", graph, newInstanceNode, template, arguments); //DebugScope.getConfig().addToContext(graph.method()); template.instantiate(runtime, newInstanceNode, newInstanceNode, arguments); - new DeadCodeEliminationPhase().apply(graph); } } } diff -r 21e8f6b5a7d1 -r 29684ae5a194 graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java Wed Jun 20 16:55:39 2012 +0200 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java Wed Jun 20 16:59:47 2012 +0200 @@ -458,7 +458,10 @@ if (replacee instanceof FixedNode) { GraphUtil.killCFG((FixedNode) replacee); } else { - replacee.safeDelete(); + GraphUtil.killWithUnusedFloatingInputs(replacee); + } + if (anchor != replacee) { + GraphUtil.killCFG(anchor); } Debug.dump(replaceeGraph, "After lowering %s with %s", replacee, this);