changeset 7377:53d5f5fc4dd9

an intrinsic graph must be cloned before being compiled
author Doug Simon <doug.simon@oracle.com>
date Tue, 15 Jan 2013 15:44:04 +0100
parents 27ee289ec5a7
children 88506cfc3bab
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Tue Jan 15 11:10:59 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Tue Jan 15 15:44:04 2013 +0100
@@ -134,7 +134,8 @@
                         if (graph == null || entryBCI != INVOCATION_ENTRY_BCI) {
                             graph = new StructuredGraph(method, entryBCI);
                         } else {
-                            // Compiling an intrinsic graph
+                            // Compiling an intrinsic graph - must clone the graph
+                            graph = graph.copy();
                         }
                         return graalRuntime.getCompiler().compileMethod(method, graph, graalRuntime.getCache(), plan, optimisticOpts);
                     }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Tue Jan 15 11:10:59 2013 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Tue Jan 15 15:44:04 2013 +0100
@@ -1033,7 +1033,8 @@
     }
 
     public static boolean canIntrinsify(Invoke invoke, ResolvedJavaMethod target) {
-        return getIntrinsicGraph(invoke, target) != null;
+        StructuredGraph intrinsicGraph = getIntrinsicGraph(invoke, target);
+        return intrinsicGraph != null;
     }
 
     public static StructuredGraph getIntrinsicGraph(Invoke invoke, ResolvedJavaMethod target) {