# HG changeset patch # User Christos Kotselidis # Date 1371115507 -7200 # Node ID 6e4b72bcc97ffd4d7e6088958d2324b50eb99422 # Parent c4a0e878868f186b5c5f13dd95177b6562bcb20e Remove graph from HotSpotNMethod diff -r c4a0e878868f -r 6e4b72bcc97f graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Wed Jun 12 10:12:46 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Thu Jun 13 11:25:07 2013 +0200 @@ -429,7 +429,6 @@ } long start = System.currentTimeMillis(); PhasePlan phasePlan = new PhasePlan(); - final StructuredGraph graphCopy = graph.copy(); GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL); phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase); editPhasePlan(method, graph, phasePlan); @@ -443,7 +442,7 @@ @Override public InstalledCode call() throws Exception { - InstalledCode code = addMethod(method, compResult, graphCopy); + InstalledCode code = addMethod(method, compResult); if (Debug.isDumpEnabled()) { Debug.dump(new Object[]{compResult, code}, "After code installation"); } @@ -460,8 +459,8 @@ return installedCode; } - protected InstalledCode addMethod(final ResolvedJavaMethod method, final CompilationResult compResult, final StructuredGraph graph) { - return runtime.addMethod(method, compResult, graph); + protected InstalledCode addMethod(final ResolvedJavaMethod method, final CompilationResult compResult) { + return runtime.addMethod(method, compResult); } /** diff -r c4a0e878868f -r 6e4b72bcc97f graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Wed Jun 12 10:12:46 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Thu Jun 13 11:25:07 2013 +0200 @@ -112,7 +112,6 @@ boolean originalSetting = OptCanonicalizeReads.getValue(); OptCanonicalizeReads.setValue(!compileAOT); PhasePlan phasePlan = new PhasePlan(); - final StructuredGraph graphCopy = graph.copy(); GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL); phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase); editPhasePlan(method, graph, phasePlan); @@ -124,7 +123,7 @@ } final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, method, runtime, replacements, backend, runtime().getTarget(), null, phasePlan, OptimisticOptimizations.ALL, new SpeculationLog(), suitesLocal); - addMethod(method, compResult, graphCopy); + addMethod(method, compResult); OptCanonicalizeReads.setValue(originalSetting); diff -r c4a0e878868f -r 6e4b72bcc97f graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Wed Jun 12 10:12:46 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Thu Jun 13 11:25:07 2013 +0200 @@ -46,9 +46,9 @@ public class HotSpotCryptoSubstitutionTest extends GraalCompilerTest { @Override - protected InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, StructuredGraph graph) { + protected InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult) { HotSpotResolvedJavaMethod hsMethod = (HotSpotResolvedJavaMethod) method; - HotSpotNmethod installedCode = new HotSpotNmethod(hsMethod, graph, true); + HotSpotNmethod installedCode = new HotSpotNmethod(hsMethod, true); HotSpotCompiledNmethod compiledNmethod = new HotSpotCompiledNmethod(hsMethod, StructuredGraph.INVOCATION_ENTRY_BCI, compResult); CodeInstallResult result = graalRuntime().getCompilerToVM().installCode(compiledNmethod, installedCode, null); Assert.assertEquals("Error installing method " + method + ": " + result, result, CodeInstallResult.OK); diff -r c4a0e878868f -r 6e4b72bcc97f graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Wed Jun 12 10:12:46 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Thu Jun 13 11:25:07 2013 +0200 @@ -215,7 +215,7 @@ @Override public void run() { - HotSpotInstalledCode installedCode = graalRuntime.getRuntime().installMethod(method, graph, entryBCI, compResult); + HotSpotInstalledCode installedCode = graalRuntime.getRuntime().installMethod(method, entryBCI, compResult); if (Debug.isDumpEnabled()) { Debug.dump(new Object[]{compResult, installedCode}, "After code installation"); } diff -r c4a0e878868f -r 6e4b72bcc97f graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Wed Jun 12 10:12:46 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Thu Jun 13 11:25:07 2013 +0200 @@ -28,7 +28,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.graph.*; /** * Implementation of {@link InstalledCode} for code installed as an nmethod. The nmethod stores a @@ -45,11 +44,9 @@ private final HotSpotResolvedJavaMethod method; private final boolean isDefault; - private final Graph graph; - public HotSpotNmethod(HotSpotResolvedJavaMethod method, Graph graph, boolean isDefault) { + public HotSpotNmethod(HotSpotResolvedJavaMethod method, boolean isDefault) { this.method = method; - this.graph = graph; this.isDefault = isDefault; } @@ -57,10 +54,6 @@ return isDefault; } - public Graph getGraph() { - return graph; - } - @Override public ResolvedJavaMethod getMethod() { return method; diff -r c4a0e878868f -r 6e4b72bcc97f graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Wed Jun 12 10:12:46 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Thu Jun 13 11:25:07 2013 +0200 @@ -922,21 +922,16 @@ return graalRuntime.getCompilerToVM().getJavaField(reflectionField); } - public HotSpotInstalledCode installMethod(HotSpotResolvedJavaMethod method, Graph graph, int entryBCI, CompilationResult compResult) { - HotSpotInstalledCode installedCode = new HotSpotNmethod(method, graph, true); + public HotSpotInstalledCode installMethod(HotSpotResolvedJavaMethod method, int entryBCI, CompilationResult compResult) { + HotSpotInstalledCode installedCode = new HotSpotNmethod(method, true); graalRuntime.getCompilerToVM().installCode(new HotSpotCompiledNmethod(method, entryBCI, compResult), installedCode, method.getSpeculationLog()); return installedCode; } @Override public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult) { - return addMethod(method, compResult, null); - } - - @Override - public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, Graph graph) { HotSpotResolvedJavaMethod hotspotMethod = (HotSpotResolvedJavaMethod) method; - HotSpotInstalledCode code = new HotSpotNmethod(hotspotMethod, graph, false); + HotSpotInstalledCode code = new HotSpotNmethod(hotspotMethod, false); CodeInstallResult result = graalRuntime.getCompilerToVM().installCode(new HotSpotCompiledNmethod(hotspotMethod, -1, compResult), code, null); if (result != CodeInstallResult.OK) { return null; diff -r c4a0e878868f -r 6e4b72bcc97f graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotNmethodExecuteNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotNmethodExecuteNode.java Wed Jun 12 10:12:46 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotNmethodExecuteNode.java Thu Jun 13 11:25:07 2013 +0200 @@ -33,7 +33,6 @@ import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; -import com.oracle.graal.phases.common.*; public class HotSpotNmethodExecuteNode extends AbstractCallNode implements Lowerable { @@ -53,16 +52,7 @@ @Override public void lower(LoweringTool tool, LoweringType loweringType) { - if (code.isConstant() && code.asConstant().asObject() instanceof HotSpotNmethod) { - HotSpotNmethod nmethod = (HotSpotNmethod) code.asConstant().asObject(); - InvokeNode invoke = replaceWithInvoke(tool.getRuntime()); - StructuredGraph graph = (StructuredGraph) nmethod.getGraph(); - if (graph != null) { - InliningUtil.inline(invoke, (StructuredGraph) nmethod.getGraph(), false); - } - } else { - replaceWithInvoke(tool.getRuntime()); - } + replaceWithInvoke(tool.getRuntime()); } protected InvokeNode replaceWithInvoke(MetaAccessProvider tool) { diff -r c4a0e878868f -r 6e4b72bcc97f graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/GraalCodeCacheProvider.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/GraalCodeCacheProvider.java Wed Jun 12 10:12:46 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/GraalCodeCacheProvider.java Thu Jun 13 11:25:07 2013 +0200 @@ -37,11 +37,10 @@ * * @param method a method to which the executable code is begin added * @param compResult the compilation result to be added - * @param graph the graph that represents the method * @return a reference to the compiled and ready-to-run code or null if the code installation * failed */ - InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, Graph graph); + InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult); void lower(Node n, LoweringTool tool); }