Mercurial > hg > truffle
changeset 19230:ef1208c9eb78
Introduce LowLevelSuites.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Tue, 10 Feb 2015 10:09:50 +0100 |
parents | a0c292287e31 |
children | df89224ee04a |
files | graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LowLevelSuites.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java |
diffstat | 4 files changed, 98 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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<LowTierContext> createLowTier() { return new LowTier(); } + + public LowLevelPhaseSuite<LowLevelHighTierContext> createLowLevelHighTier() { + return new LowLevelHighTier(); + } + + public LowLevelPhaseSuite<LowLevelMidTierContext> createLowLevelMidTier() { + return new LowLevelMidTier(); + } + + public LowLevelPhaseSuite<LowLevelLowTierContext> createLowLevelLowTier() { + return new LowLevelLowTier(); + } + }
--- /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<LowLevelHighTierContext> highTier; + private final LowLevelPhaseSuite<LowLevelMidTierContext> midTier; + private final LowLevelPhaseSuite<LowLevelLowTierContext> lowTier; + + public LowLevelSuites(LowLevelPhaseSuite<LowLevelHighTierContext> highTier, LowLevelPhaseSuite<LowLevelMidTierContext> midTier, LowLevelPhaseSuite<LowLevelLowTierContext> lowTier) { + this.highTier = highTier; + this.midTier = midTier; + this.lowTier = lowTier; + } + + public LowLevelPhaseSuite<LowLevelHighTierContext> getHighTier() { + return highTier; + } + + public LowLevelPhaseSuite<LowLevelMidTierContext> getMidTier() { + return midTier; + } + + public LowLevelPhaseSuite<LowLevelLowTierContext> getLowTier() { + return lowTier; + } + +}
--- 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<MidTierContext> createMidTier(); PhaseSuite<LowTierContext> createLowTier(); + + LowLevelPhaseSuite<LowLevelHighTierContext> createLowLevelHighTier(); + + LowLevelPhaseSuite<LowLevelMidTierContext> createLowLevelMidTier(); + + LowLevelPhaseSuite<LowLevelLowTierContext> createLowLevelLowTier(); }
--- 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()); + } + }