# HG changeset patch # User Roland Schatz # Date 1366732147 -7200 # Node ID bff0abdbc8b6671d2e560cb85fb37dba4f5866ae # Parent 3df022b2eebe6fd90920954413313fcb0897c854 Restructure phase context hierarchy. diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/BoxingEliminationTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/BoxingEliminationTest.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/BoxingEliminationTest.java Tue Apr 23 17:49:07 2013 +0200 @@ -307,7 +307,7 @@ private void processMethod(final String snippet) { graph = parse(snippet); Assumptions assumptions = new Assumptions(false); - HighTierContext context = new HighTierContext(runtime(), assumptions); + HighTierContext context = new HighTierContext(runtime(), assumptions, replacements); new InliningPhase(runtime(), null, replacements, assumptions, null, getDefaultPhasePlan(), OptimisticOptimizations.ALL).apply(graph); new PartialEscapeAnalysisPhase(false, false).apply(graph, context); new CullFrameStatesPhase().apply(graph); @@ -325,7 +325,7 @@ graph = parse(snippet); Assumptions assumptions = new Assumptions(false); - HighTierContext context = new HighTierContext(runtime(), assumptions); + HighTierContext context = new HighTierContext(runtime(), assumptions, replacements); new InliningPhase(runtime(), null, replacements, assumptions, null, getDefaultPhasePlan(), OptimisticOptimizations.ALL).apply(graph); if (loopPeeling) { new LoopTransformHighPhase().apply(graph); diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java Tue Apr 23 17:49:07 2013 +0200 @@ -220,7 +220,7 @@ new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getEagerDefault(), OptimisticOptimizations.ALL).apply(graph); Assumptions assumptions = new Assumptions(false); - HighTierContext context = new HighTierContext(runtime(), assumptions); + HighTierContext context = new HighTierContext(runtime(), assumptions, replacements); new InliningPhase(runtime(), null, replacements, assumptions, null, getDefaultPhasePlan(), OptimisticOptimizations.ALL).apply(graph); new DeadCodeEliminationPhase().apply(graph); new PartialEscapeAnalysisPhase(iterativeEscapeAnalysis, false).apply(graph, context); diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/IterativeInliningTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/IterativeInliningTest.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/IterativeInliningTest.java Tue Apr 23 17:49:07 2013 +0200 @@ -101,7 +101,7 @@ private void processMethod(final String snippet) { graph = parse(snippet); GraalOptions.OptEarlyReadElimination = true; - HighTierContext context = new HighTierContext(runtime(), new Assumptions(false)); + HighTierContext context = new HighTierContext(runtime(), new Assumptions(false), replacements); new IterativeInliningPhase(replacements, null, getDefaultPhasePlan(), OptimisticOptimizations.ALL, false).apply(graph, context); } } diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PEAReadEliminationTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PEAReadEliminationTest.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PEAReadEliminationTest.java Tue Apr 23 17:49:07 2013 +0200 @@ -222,7 +222,7 @@ private void processMethod(final String snippet) { graph = parse(snippet); Assumptions assumptions = new Assumptions(false); - HighTierContext context = new HighTierContext(runtime(), assumptions); + HighTierContext context = new HighTierContext(runtime(), assumptions, replacements); new InliningPhase(runtime(), null, replacements, assumptions, null, getDefaultPhasePlan(), OptimisticOptimizations.ALL).apply(graph); new PartialEscapeAnalysisPhase(false, true).apply(graph, context); } diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PartialEscapeAnalysisTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PartialEscapeAnalysisTest.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PartialEscapeAnalysisTest.java Tue Apr 23 17:49:07 2013 +0200 @@ -162,7 +162,7 @@ StructuredGraph graph = parse(snippet); Assumptions assumptions = new Assumptions(false); - HighTierContext context = new HighTierContext(runtime(), assumptions); + HighTierContext context = new HighTierContext(runtime(), assumptions, replacements); new InliningPhase(runtime(), null, replacements, assumptions, null, getDefaultPhasePlan(), OptimisticOptimizations.ALL).apply(graph); new DeadCodeEliminationPhase().apply(graph); new CanonicalizerPhase().apply(graph, context); diff -r 3df022b2eebe -r bff0abdbc8b6 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 Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Apr 23 17:49:07 2013 +0200 @@ -120,7 +120,7 @@ new CanonicalizerPhase.Instance(runtime, assumptions).apply(graph); } - HighTierContext highTierContext = new HighTierContext(runtime, assumptions); + HighTierContext highTierContext = new HighTierContext(runtime, assumptions, replacements); if (GraalOptions.Inline && !plan.isPhaseDisabled(InliningPhase.class)) { if (GraalOptions.IterativeInlining) { @@ -142,7 +142,7 @@ new LoweringPhase(target, runtime, replacements, assumptions, LoweringType.BEFORE_GUARDS).apply(graph); - MidTierContext midTierContext = new MidTierContext(runtime, assumptions, replacements); + MidTierContext midTierContext = new MidTierContext(runtime, assumptions, replacements, target); Suites.DEFAULT.getMidTier().apply(graph, midTierContext); plan.runPhases(PhasePosition.MID_LEVEL, graph); diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java Tue Apr 23 17:49:07 2013 +0200 @@ -82,7 +82,7 @@ } // the canonicalization before loop unrolling is needed to propagate the length into // additions, etc. - HighTierContext context = new HighTierContext(tool.getRuntime(), tool.assumptions()); + HighTierContext context = new HighTierContext(tool.getRuntime(), tool.assumptions(), tool.getReplacements()); new CanonicalizerPhase().apply(snippetGraph, context); new LoopFullUnrollPhase().apply(snippetGraph, context); new CanonicalizerPhase().apply(snippetGraph, context); diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/HighTierContext.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/HighTierContext.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/HighTierContext.java Tue Apr 23 17:49:07 2013 +0200 @@ -24,10 +24,11 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.nodes.spi.*; public class HighTierContext extends PhaseContext { - public HighTierContext(MetaAccessProvider runtime, Assumptions assumptions) { - super(runtime, assumptions); + public HighTierContext(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements) { + super(runtime, assumptions, replacements); } } diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/LowTierContext.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/LowTierContext.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/LowTierContext.java Tue Apr 23 17:49:07 2013 +0200 @@ -28,19 +28,13 @@ public class LowTierContext extends PhaseContext { - private final Replacements replacements; private final TargetDescription target; public LowTierContext(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements, TargetDescription target) { - super(runtime, assumptions); - this.replacements = replacements; + super(runtime, assumptions, replacements); this.target = target; } - public Replacements getReplacements() { - return replacements; - } - public TargetDescription getTarget() { return target; } diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/MidTierContext.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/MidTierContext.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/MidTierContext.java Tue Apr 23 17:49:07 2013 +0200 @@ -28,14 +28,14 @@ public class MidTierContext extends PhaseContext { - private final Replacements replacements; + private final TargetDescription target; - public MidTierContext(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements) { - super(runtime, assumptions); - this.replacements = replacements; + public MidTierContext(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements, TargetDescription target) { + super(runtime, assumptions, replacements); + this.target = target; } - public Replacements getReplacements() { - return replacements; + public TargetDescription getTarget() { + return target; } } diff -r 3df022b2eebe -r bff0abdbc8b6 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/PhaseContext.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/PhaseContext.java Tue Apr 23 17:49:04 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/PhaseContext.java Tue Apr 23 17:49:07 2013 +0200 @@ -24,15 +24,18 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.nodes.spi.*; public class PhaseContext { private final MetaAccessProvider runtime; private final Assumptions assumptions; + private final Replacements replacements; - public PhaseContext(MetaAccessProvider runtime, Assumptions assumptions) { + public PhaseContext(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements) { this.runtime = runtime; this.assumptions = assumptions; + this.replacements = replacements; } public MetaAccessProvider getRuntime() { @@ -42,4 +45,8 @@ public Assumptions getAssumptions() { return assumptions; } + + public Replacements getReplacements() { + return replacements; + } }