# HG changeset patch # User Lukas Stadler # Date 1358959214 -3600 # Node ID a77f22f2759ddc1e35203a169c39857129bd529c # Parent 9e2cbc932853a1e267027ce47fd11fd1194067d6 remove errorneous assert, fix ArrayCopyNode's "replace local" code diff -r 9e2cbc932853 -r a77f22f2759d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopyNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopyNode.java Wed Jan 23 17:25:47 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopyNode.java Wed Jan 23 17:40:14 2013 +0100 @@ -77,8 +77,12 @@ } private static void unrollFixedLengthLoop(StructuredGraph snippetGraph, int length, LoweringTool tool) { - snippetGraph.replaceFloating(snippetGraph.getLocal(4), ConstantNode.forInt(length, snippetGraph)); - // the canonicalization before loop unrolling is needed to propagate the length into additions, etc. + LocalNode lengthLocal = snippetGraph.getLocal(4); + if (lengthLocal != null) { + snippetGraph.replaceFloating(lengthLocal, ConstantNode.forInt(length, snippetGraph)); + } + // the canonicalization before loop unrolling is needed to propagate the length into + // additions, etc. new CanonicalizerPhase(tool.getTarget(), tool.getRuntime(), tool.assumptions()).apply(snippetGraph); new LoopFullUnrollPhase(tool.getRuntime(), tool.assumptions()).apply(snippetGraph); new CanonicalizerPhase(tool.getTarget(), tool.getRuntime(), tool.assumptions()).apply(snippetGraph); @@ -90,8 +94,7 @@ if (snippetMethod == null) { snippetMethod = tool.getRuntime().lookupJavaMethod(ArrayCopySnippets.increaseGenericCallCounterMethod); // we will call the generic method. the generic snippet will only increase the counter, - // not call the actual - // method. therefore we create a second invoke here. + // not call the actual method. therefore we create a second invoke here. ((StructuredGraph) graph()).addAfterFixed(this, createInvoke()); } if (Debug.isLogEnabled()) { diff -r 9e2cbc932853 -r a77f22f2759d graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Wed Jan 23 17:25:47 2013 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Wed Jan 23 17:40:14 2013 +0100 @@ -222,7 +222,6 @@ Class macroNodeClass = getMacroNodeClass(concrete); if (macroNodeClass != null) { StructuredGraph graph = (StructuredGraph) invoke.graph(); - assert invoke instanceof InvokeNode; FixedWithNextNode macroNode; try { macroNode = macroNodeClass.getConstructor(Invoke.class).newInstance(invoke);