# HG changeset patch # User Josef Eisl # Date 1423559390 -3600 # Node ID ef1208c9eb785faaf48476e63365f2008bb56315 # Parent a0c292287e3171822da9fcdbc5f216d6830d2d0a Introduce LowLevelSuites. diff -r a0c292287e31 -r ef1208c9eb78 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 Mon Feb 09 18:39:00 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java Tue Feb 10 10:09:50 2015 +0100 @@ -23,6 +23,10 @@ package com.oracle.graal.compiler.phases; import com.oracle.graal.api.runtime.*; +import com.oracle.graal.lir.phases.*; +import com.oracle.graal.lir.phases.LowLevelHighTierPhase.*; +import com.oracle.graal.lir.phases.LowLevelLowTierPhase.*; +import com.oracle.graal.lir.phases.LowLevelMidTierPhase.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.tiers.*; @@ -40,4 +44,17 @@ public PhaseSuite createLowTier() { return new LowTier(); } + + public LowLevelPhaseSuite createLowLevelHighTier() { + return new LowLevelHighTier(); + } + + public LowLevelPhaseSuite createLowLevelMidTier() { + return new LowLevelMidTier(); + } + + public LowLevelPhaseSuite createLowLevelLowTier() { + return new LowLevelLowTier(); + } + } diff -r a0c292287e31 -r ef1208c9eb78 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LowLevelSuites.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LowLevelSuites.java Tue Feb 10 10:09:50 2015 +0100 @@ -0,0 +1,53 @@ +/* + * 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 com.oracle.graal.lir.phases.LowLevelHighTierPhase.LowLevelHighTierContext; +import com.oracle.graal.lir.phases.LowLevelLowTierPhase.LowLevelLowTierContext; +import com.oracle.graal.lir.phases.LowLevelMidTierPhase.LowLevelMidTierContext; + +public class LowLevelSuites { + + private final LowLevelPhaseSuite highTier; + private final LowLevelPhaseSuite midTier; + private final LowLevelPhaseSuite lowTier; + + public LowLevelSuites(LowLevelPhaseSuite highTier, LowLevelPhaseSuite midTier, LowLevelPhaseSuite lowTier) { + this.highTier = highTier; + this.midTier = midTier; + this.lowTier = lowTier; + } + + public LowLevelPhaseSuite getHighTier() { + return highTier; + } + + public LowLevelPhaseSuite getMidTier() { + return midTier; + } + + public LowLevelPhaseSuite getLowTier() { + return lowTier; + } + +} diff -r a0c292287e31 -r ef1208c9eb78 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 Mon Feb 09 18:39:00 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java Tue Feb 10 10:09:50 2015 +0100 @@ -23,6 +23,10 @@ package com.oracle.graal.phases.tiers; import com.oracle.graal.api.runtime.*; +import com.oracle.graal.lir.phases.*; +import com.oracle.graal.lir.phases.LowLevelHighTierPhase.*; +import com.oracle.graal.lir.phases.LowLevelLowTierPhase.*; +import com.oracle.graal.lir.phases.LowLevelMidTierPhase.*; import com.oracle.graal.phases.*; public interface CompilerConfiguration extends Service { @@ -32,4 +36,10 @@ PhaseSuite createMidTier(); PhaseSuite createLowTier(); + + LowLevelPhaseSuite createLowLevelHighTier(); + + LowLevelPhaseSuite createLowLevelMidTier(); + + LowLevelPhaseSuite createLowLevelLowTier(); } diff -r a0c292287e31 -r ef1208c9eb78 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java Mon Feb 09 18:39:00 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java Tue Feb 10 10:09:50 2015 +0100 @@ -28,6 +28,7 @@ import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.common.*; +import com.oracle.graal.lir.phases.*; import com.oracle.graal.options.*; import com.oracle.graal.phases.*; @@ -129,4 +130,21 @@ return new Suites(config); } + public static LowLevelSuites createDefaultLowLevelSuites() { + String selected = CompilerConfiguration.getValue(); + if (selected.equals("")) { + return new LowLevelSuites(defaultConfiguration.createLowLevelHighTier(), defaultConfiguration.createLowLevelMidTier(), defaultConfiguration.createLowLevelLowTier()); + } else { + return createLowLevelSuites(selected); + } + } + + public static LowLevelSuites createLowLevelSuites(String name) { + CompilerConfiguration config = configurations.get(name); + if (config == null) { + throw new GraalInternalError("unknown compiler configuration: " + name); + } + return new LowLevelSuites(config.createLowLevelHighTier(), config.createLowLevelMidTier(), config.createLowLevelLowTier()); + } + }