Mercurial > hg > graal-compiler
changeset 8638:8d6265614e13
added getReplacements() to LoweringTool
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 05 Apr 2013 01:26:48 +0200 |
parents | ce5750014c3d |
children | f2bcc49a1430 |
files | graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FloatingReadTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/MemoryScheduleTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ReadAfterCheckCast.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringTool.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java |
diffstat | 6 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FloatingReadTest.java Fri Apr 05 01:22:36 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FloatingReadTest.java Fri Apr 05 01:26:48 2013 +0200 @@ -57,7 +57,7 @@ public void run() { StructuredGraph graph = parse(snippet); - new LoweringPhase(null, runtime(), new Assumptions(false)).apply(graph); + new LoweringPhase(null, runtime(), replacements, new Assumptions(false)).apply(graph); new FloatingReadPhase().apply(graph); ReturnNode returnNode = null;
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/MemoryScheduleTest.java Fri Apr 05 01:22:36 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/MemoryScheduleTest.java Fri Apr 05 01:26:48 2013 +0200 @@ -221,7 +221,7 @@ Assumptions assumptions = new Assumptions(false); new InliningPhase(runtime(), null, replacements, assumptions, null, getDefaultPhasePlan(), OptimisticOptimizations.ALL).apply(graph); } - new LoweringPhase(null, runtime(), new Assumptions(false)).apply(graph); + new LoweringPhase(null, runtime(), replacements, new Assumptions(false)).apply(graph); if (mode == TestMode.WITHOUT_FRAMESTATES || mode == TestMode.INLINED_WITHOUT_FRAMESTATES) { for (Node node : graph.getNodes()) { if (node instanceof StateSplit) {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ReadAfterCheckCast.java Fri Apr 05 01:22:36 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ReadAfterCheckCast.java Fri Apr 05 01:26:48 2013 +0200 @@ -85,7 +85,7 @@ // structure changes significantly public void run() { StructuredGraph graph = parse(snippet); - new LoweringPhase(null, runtime(), new Assumptions(false)).apply(graph); + new LoweringPhase(null, runtime(), replacements, new Assumptions(false)).apply(graph); new FloatingReadPhase().apply(graph); new EliminatePartiallyRedundantGuardsPhase(true, false).apply(graph); new ReadEliminationPhase().apply(graph);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Fri Apr 05 01:22:36 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Fri Apr 05 01:26:48 2013 +0200 @@ -177,7 +177,7 @@ new CanonicalizerPhase(runtime, assumptions).apply(graph); } - new LoweringPhase(target, runtime, assumptions).apply(graph); + new LoweringPhase(target, runtime, replacements, assumptions).apply(graph); if (GraalOptions.OptFloatingReads) { int mark = graph.getMark();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringTool.java Fri Apr 05 01:22:36 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringTool.java Fri Apr 05 01:26:48 2013 +0200 @@ -34,6 +34,8 @@ GraalCodeCacheProvider getRuntime(); + Replacements getReplacements(); + ValueNode createNullCheckGuard(ValueNode object); ValueNode createGuard(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action);
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Fri Apr 05 01:22:36 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Fri Apr 05 01:26:48 2013 +0200 @@ -65,6 +65,11 @@ } @Override + public Replacements getReplacements() { + return replacements; + } + + @Override public ValueNode createNullCheckGuard(ValueNode object) { return createGuard(object.graph().unique(new IsNullNode(object)), DeoptimizationReason.NullCheckException, DeoptimizationAction.InvalidateReprofile, true); } @@ -113,13 +118,15 @@ private final TargetDescription target; private final GraalCodeCacheProvider runtime; + private final Replacements replacements; private final Assumptions assumptions; private boolean deferred; - public LoweringPhase(TargetDescription target, GraalCodeCacheProvider runtime, Assumptions assumptions) { + public LoweringPhase(TargetDescription target, GraalCodeCacheProvider runtime, Replacements replacements, Assumptions assumptions) { this.target = target; this.runtime = runtime; + this.replacements = replacements; this.assumptions = assumptions; }