diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java @ 9621:e97dc9bbfedc

introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
author Doug Simon <doug.simon@oracle.com>
date Wed, 08 May 2013 22:55:17 +0200
parents 0eda2b7df748
children 18632807db02
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java	Wed May 08 21:57:46 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java	Wed May 08 22:55:17 2013 +0200
@@ -136,13 +136,13 @@
     public abstract String toString();
 
     /**
-     * Gets the method under which the compiled code for this stub is
-     * {@linkplain CodeCacheProvider#addMethod(ResolvedJavaMethod, CompilationResult) installed}.
+     * Gets the method the stub's code will be {@linkplain InstalledCode#getMethod() associated}
+     * with once installed. This may be null.
      */
-    protected abstract ResolvedJavaMethod getInstallationMethod();
+    protected abstract ResolvedJavaMethod getInstalledCodeOwner();
 
     protected Object debugScopeContext() {
-        return getInstallationMethod();
+        return getInstalledCodeOwner();
     }
 
     /**
@@ -165,8 +165,8 @@
                     GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL);
                     phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
                     CallingConvention cc = linkage.getCallingConvention();
-                    final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, runtime, replacements, backend, runtime.getTarget(), null, phasePlan, OptimisticOptimizations.ALL,
-                                    new SpeculationLog());
+                    final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, getInstalledCodeOwner(), runtime, replacements, backend, runtime.getTarget(), null, phasePlan,
+                                    OptimisticOptimizations.ALL, new SpeculationLog());
 
                     assert checkStubInvariants(compResult);
 
@@ -175,7 +175,7 @@
 
                         @Override
                         public InstalledCode call() {
-                            InstalledCode installedCode = runtime.addMethod(getInstallationMethod(), compResult);
+                            InstalledCode installedCode = runtime.addMethod(getInstalledCodeOwner(), compResult);
                             assert installedCode != null : "error installing stub " + this;
                             if (Debug.isDumpEnabled()) {
                                 Debug.dump(new Object[]{compResult, installedCode}, "After code installation");