changeset 7540:a77f22f2759d

remove errorneous assert, fix ArrayCopyNode's "replace local" code
author Lukas Stadler <lukas.stadler@jku.at>
date Wed, 23 Jan 2013 17:40:14 +0100
parents 9e2cbc932853
children aee6ce29fb17
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopyNode.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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()) {
--- 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<? extends FixedWithNextNode> 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);