# HG changeset patch # User Roland Schatz # Date 1370876414 -7200 # Node ID b8b4d7f3e4aa09a341836ac8ca8bb54c139f3b0f # Parent 3df534c97af104e0cdddb8fb519363e26bca12db Use Suites mechanism for HotSpot specific compiler phases. diff -r 3df534c97af1 -r b8b4d7f3e4aa graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTestBase.java --- a/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTestBase.java Mon Jun 10 16:06:09 2013 +0200 +++ b/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTestBase.java Mon Jun 10 17:00:14 2013 +0200 @@ -39,6 +39,7 @@ import com.oracle.graal.phases.OptimisticOptimizations; import com.oracle.graal.phases.PhasePlan; import com.oracle.graal.phases.PhasePlan.PhasePosition; +import com.oracle.graal.phases.tiers.*; import com.oracle.graal.ptx.PTX; public abstract class PTXTestBase extends GraalCompilerTest { @@ -57,8 +58,14 @@ phasePlan.addPhase(PhasePosition.AFTER_PARSING, new PTXPhase()); new PTXPhase().apply(graph); CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false); + /* + * Use Suites.createDefaultSuites() instead of GraalCompilerTest.suites. The + * GraalCompilerTest.suites variable contains the Suites for the HotSpotRuntime. This code + * will not run on hotspot, so it should use the plain Graal default suites, without hotspot + * specific phases. + */ CompilationResult result = GraalCompiler.compileGraph(graph, cc, graph.method(), runtime, graalRuntime().getReplacements(), ptxBackend, target, null, phasePlan, OptimisticOptimizations.NONE, - new SpeculationLog(), suites); + new SpeculationLog(), Suites.createDefaultSuites()); return result; } diff -r 3df534c97af1 -r b8b4d7f3e4aa 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 Mon Jun 10 16:06:09 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Mon Jun 10 17:00:14 2013 +0200 @@ -51,7 +51,6 @@ import com.oracle.graal.phases.tiers.*; import com.oracle.graal.printer.*; import com.oracle.graal.test.*; -import com.oracle.graal.hotspot.phases.WriteBarrierAdditionPhase; /** * Base class for Graal compiler unit tests. @@ -433,7 +432,6 @@ final StructuredGraph graphCopy = graph.copy(); GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL); phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase); - phasePlan.addPhase(PhasePosition.LOW_LEVEL, new WriteBarrierAdditionPhase()); editPhasePlan(method, graph, phasePlan); CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false); final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, method, runtime, replacements, backend, runtime().getTarget(), null, phasePlan, OptimisticOptimizations.ALL, diff -r 3df534c97af1 -r b8b4d7f3e4aa graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Mon Jun 10 16:06:09 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Mon Jun 10 17:00:14 2013 +0200 @@ -169,8 +169,6 @@ MidTierContext midTierContext = new MidTierContext(runtime, assumptions, replacements, target, optimisticOpts); suites.getMidTier().apply(graph, midTierContext); - plan.runPhases(PhasePosition.LOW_LEVEL, graph); - LowTierContext lowTierContext = new LowTierContext(runtime, assumptions, replacements, target); suites.getLowTier().apply(graph, lowTierContext); diff -r 3df534c97af1 -r b8b4d7f3e4aa 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 Mon Jun 10 16:06:09 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Mon Jun 10 17:00:14 2013 +0200 @@ -32,7 +32,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.test.*; -import com.oracle.graal.hotspot.phases.*; import com.oracle.graal.java.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; @@ -81,7 +80,6 @@ final StructuredGraph graphCopy = graph.copy(); GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL); phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase); - phasePlan.addPhase(PhasePosition.LOW_LEVEL, new WriteBarrierAdditionPhase()); editPhasePlan(method, graph, phasePlan); CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false); final CompilationResult compResult = GraalCompiler.compileGraph(graph, cc, method, runtime, replacements, backend, runtime().getTarget(), null, phasePlan, OptimisticOptimizations.ALL, diff -r 3df534c97af1 -r b8b4d7f3e4aa graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Mon Jun 10 16:06:09 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Mon Jun 10 17:00:14 2013 +0200 @@ -772,11 +772,6 @@ if (onStackReplacement) { phasePlan.addPhase(PhasePosition.AFTER_PARSING, new OnStackReplacementPhase()); } - phasePlan.addPhase(PhasePosition.LOW_LEVEL, new WriteBarrierAdditionPhase()); - if (VerifyPhases.getValue()) { - phasePlan.addPhase(PhasePosition.LOW_LEVEL, new WriteBarrierVerificationPhase()); - - } return phasePlan; } diff -r 3df534c97af1 -r b8b4d7f3e4aa 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 Mon Jun 10 16:06:09 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Mon Jun 10 17:00:14 2013 +0200 @@ -73,6 +73,7 @@ import com.oracle.graal.hotspot.bridge.*; import com.oracle.graal.hotspot.bridge.CompilerToVM.CodeInstallResult; import com.oracle.graal.hotspot.nodes.*; +import com.oracle.graal.hotspot.phases.*; import com.oracle.graal.hotspot.replacements.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.java.*; @@ -1068,6 +1069,13 @@ } public Suites createSuites() { - return Suites.createDefaultSuites(); + Suites ret = Suites.createDefaultSuites(); + + ret.getMidTier().addPhase(new WriteBarrierAdditionPhase()); + if (VerifyPhases.getValue()) { + ret.getMidTier().addPhase(new WriteBarrierVerificationPhase()); + } + + return ret; } } diff -r 3df534c97af1 -r b8b4d7f3e4aa graal/com.oracle.graal.phases/src/com/oracle/graal/phases/PhasePlan.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/PhasePlan.java Mon Jun 10 16:06:09 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/PhasePlan.java Mon Jun 10 17:00:14 2013 +0200 @@ -50,8 +50,7 @@ */ public static enum PhasePosition { AFTER_PARSING, - HIGH_LEVEL, - LOW_LEVEL + HIGH_LEVEL } // @formatter:on