# HG changeset patch # User Josef Eisl # Date 1423665463 -3600 # Node ID 63c619b0cc83669fe9fa77d4731636250f9dfaf5 # Parent 2b0bc8ad837283ded10cfe409110606a5f1b6012 Rename LowLevelPhaseSuite to LIRPhaseSuite. diff -r 2b0bc8ad8372 -r 63c619b0cc83 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java Wed Feb 11 15:35:41 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java Wed Feb 11 15:37:43 2015 +0100 @@ -45,15 +45,15 @@ return new LowTier(); } - public LowLevelPhaseSuite createLowLevelHighTier() { + public LIRPhaseSuite createLowLevelHighTier() { return new LIRHighTier(); } - public LowLevelPhaseSuite createLowLevelMidTier() { + public LIRPhaseSuite createLowLevelMidTier() { return new LIRMidTier(); } - public LowLevelPhaseSuite createLowLevelLowTier() { + public LIRPhaseSuite createLowLevelLowTier() { return new LIRLowTier(); } diff -r 2b0bc8ad8372 -r 63c619b0cc83 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRHighTier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRHighTier.java Wed Feb 11 15:35:41 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRHighTier.java Wed Feb 11 15:37:43 2015 +0100 @@ -25,7 +25,7 @@ import com.oracle.graal.lir.constopt.*; import com.oracle.graal.lir.phases.LowLevelHighTierPhase.*; -public class LIRHighTier extends LowLevelPhaseSuite { +public class LIRHighTier extends LIRPhaseSuite { public LIRHighTier() { if (ConstantLoadOptimization.Options.LowLevelOptConstantLoadOptimization.getValue()) { appendPhase(new ConstantLoadOptimization()); diff -r 2b0bc8ad8372 -r 63c619b0cc83 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRLowTier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRLowTier.java Wed Feb 11 15:35:41 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRLowTier.java Wed Feb 11 15:37:43 2015 +0100 @@ -26,7 +26,7 @@ import com.oracle.graal.lir.phases.LowLevelLowTierPhase.*; import com.oracle.graal.options.*; -public class LIRLowTier extends LowLevelPhaseSuite { +public class LIRLowTier extends LIRPhaseSuite { public static class Options { // @formatter:off @Option(help = "", type = OptionType.Debug) diff -r 2b0bc8ad8372 -r 63c619b0cc83 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRMidTier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRMidTier.java Wed Feb 11 15:35:41 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRMidTier.java Wed Feb 11 15:37:43 2015 +0100 @@ -26,7 +26,7 @@ import com.oracle.graal.lir.phases.LowLevelMidTierPhase.*; import com.oracle.graal.lir.stackslotalloc.*; -public class LIRMidTier extends LowLevelPhaseSuite { +public class LIRMidTier extends LIRPhaseSuite { public LIRMidTier() { appendPhase(new LinearScanPhase()); diff -r 2b0bc8ad8372 -r 63c619b0cc83 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhaseSuite.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhaseSuite.java Wed Feb 11 15:37:43 2015 +0100 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.lir.phases; + +import java.util.*; + +import com.oracle.graal.api.code.*; +import com.oracle.graal.compiler.common.cfg.*; +import com.oracle.graal.lir.gen.*; + +public abstract class LIRPhaseSuite extends LIRPhase { + private final List> phases; + + public LIRPhaseSuite() { + phases = new ArrayList<>(); + } + + /** + * Add a new phase at the beginning of this suite. + */ + public final void prependPhase(LIRPhase phase) { + phases.add(0, phase); + } + + /** + * Add a new phase at the end of this suite. + */ + public final void appendPhase(LIRPhase phase) { + phases.add(phase); + } + + public final ListIterator> findPhase(Class> phaseClass) { + ListIterator> it = phases.listIterator(); + if (findNextPhase(it, phaseClass)) { + return it; + } else { + return null; + } + } + + public static boolean findNextPhase(ListIterator> it, Class> phaseClass) { + while (it.hasNext()) { + LIRPhase phase = it.next(); + if (phaseClass.isInstance(phase)) { + return true; + } + } + return false; + } + + @Override + protected > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, C context) { + for (LIRPhase phase : phases) { + phase.apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, context); + } + } + +} diff -r 2b0bc8ad8372 -r 63c619b0cc83 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Wed Feb 11 15:35:41 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Wed Feb 11 15:37:43 2015 +0100 @@ -31,11 +31,11 @@ public class LIRSuites { - private final LowLevelPhaseSuite highTier; - private final LowLevelPhaseSuite midTier; - private final LowLevelPhaseSuite lowTier; + private final LIRPhaseSuite highTier; + private final LIRPhaseSuite midTier; + private final LIRPhaseSuite lowTier; - public LIRSuites(LowLevelPhaseSuite highTier, LowLevelPhaseSuite midTier, LowLevelPhaseSuite lowTier) { + public LIRSuites(LIRPhaseSuite highTier, LIRPhaseSuite midTier, LIRPhaseSuite lowTier) { this.highTier = highTier; this.midTier = midTier; this.lowTier = lowTier; @@ -49,7 +49,7 @@ * {@link LIRGeneratorTool#newVariable variables}, {@link LIRGenerationResult#getFrameMap stack * slots} and {@link LIRGenerationResult#getFrameMapBuilder virtual stack slots}. */ - public LowLevelPhaseSuite getHighTier() { + public LIRPhaseSuite getHighTier() { return highTier; } @@ -60,7 +60,7 @@ * After the {@link LIRMidTier} there should be no more {@link Variable}s and * {@link VirtualStackSlot}s. */ - public LowLevelPhaseSuite getMidTier() { + public LIRPhaseSuite getMidTier() { return midTier; } @@ -71,7 +71,7 @@ * A {@link LowLevelLowTierPhase} must not introduce new {@link Variable}s, * {@link VirtualStackSlot}s or {@link StackSlot}s. */ - public LowLevelPhaseSuite getLowTier() { + public LIRPhaseSuite getLowTier() { return lowTier; } diff -r 2b0bc8ad8372 -r 63c619b0cc83 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LowLevelPhaseSuite.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LowLevelPhaseSuite.java Wed Feb 11 15:35:41 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.lir.phases; - -import java.util.*; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.compiler.common.cfg.*; -import com.oracle.graal.lir.gen.*; - -public abstract class LowLevelPhaseSuite extends LIRPhase { - private final List> phases; - - public LowLevelPhaseSuite() { - phases = new ArrayList<>(); - } - - /** - * Add a new phase at the beginning of this suite. - */ - public final void prependPhase(LIRPhase phase) { - phases.add(0, phase); - } - - /** - * Add a new phase at the end of this suite. - */ - public final void appendPhase(LIRPhase phase) { - phases.add(phase); - } - - public final ListIterator> findPhase(Class> phaseClass) { - ListIterator> it = phases.listIterator(); - if (findNextPhase(it, phaseClass)) { - return it; - } else { - return null; - } - } - - public static boolean findNextPhase(ListIterator> it, Class> phaseClass) { - while (it.hasNext()) { - LIRPhase phase = it.next(); - if (phaseClass.isInstance(phase)) { - return true; - } - } - return false; - } - - @Override - protected > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, C context) { - for (LIRPhase phase : phases) { - phase.apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, context); - } - } - -} diff -r 2b0bc8ad8372 -r 63c619b0cc83 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java Wed Feb 11 15:35:41 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java Wed Feb 11 15:37:43 2015 +0100 @@ -37,9 +37,9 @@ PhaseSuite createLowTier(); - LowLevelPhaseSuite createLowLevelHighTier(); + LIRPhaseSuite createLowLevelHighTier(); - LowLevelPhaseSuite createLowLevelMidTier(); + LIRPhaseSuite createLowLevelMidTier(); - LowLevelPhaseSuite createLowLevelLowTier(); + LIRPhaseSuite createLowLevelLowTier(); }