# HG changeset patch # User Josef Eisl # Date 1424204989 -3600 # Node ID 752a498c1b01b69cf8cb2ec34ad265df0c3104bb # Parent a32136f93f58d2aad9b15b07bde3069a381511e2 Rename LIRHighTier to PreAllocationOptimizationStage. diff -r a32136f93f58 -r 752a498c1b01 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 Feb 17 19:56:44 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Feb 17 21:29:49 2015 +0100 @@ -44,7 +44,7 @@ import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; -import com.oracle.graal.lir.phases.LIRHighTierPhase.LIRHighTierContext; +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; import com.oracle.graal.lir.phases.LIRLowTierPhase.LIRLowTierContext; import com.oracle.graal.lir.phases.LIRMidTierPhase.LIRMidTierContext; import com.oracle.graal.nodes.*; @@ -352,8 +352,8 @@ public static > LIRGenerationResult emitLowLevel(TargetDescription target, List codeEmittingOrder, List linearScanOrder, LIRGenerationResult lirGenRes, LIRGeneratorTool lirGen, LIRSuites lirSuites) { - LIRHighTierContext highTierContext = new LIRHighTierContext(lirGen); - lirSuites.getHighTier().apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, highTierContext); + PreAllocationOptimizationContext highTierContext = new PreAllocationOptimizationContext(lirGen); + lirSuites.getPreAllocationOptimizationStage().apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, highTierContext); LIRMidTierContext midTierContext = new LIRMidTierContext(); lirSuites.getMidTier().apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, midTierContext); diff -r a32136f93f58 -r 752a498c1b01 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 Tue Feb 17 19:56:44 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java Tue Feb 17 21:29:49 2015 +0100 @@ -24,7 +24,7 @@ import com.oracle.graal.api.runtime.*; import com.oracle.graal.lir.phases.*; -import com.oracle.graal.lir.phases.LIRHighTierPhase.*; +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.*; import com.oracle.graal.lir.phases.LIRLowTierPhase.*; import com.oracle.graal.lir.phases.LIRMidTierPhase.*; import com.oracle.graal.phases.*; @@ -45,8 +45,8 @@ return new LowTier(); } - public LIRPhaseSuite createLIRHighTier() { - return new LIRHighTier(); + public LIRPhaseSuite createPreAllocationOptimizationStage() { + return new PreAllocationOptimizationStage(); } public LIRPhaseSuite createLIRMidTier() { diff -r a32136f93f58 -r 752a498c1b01 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java Tue Feb 17 19:56:44 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java Tue Feb 17 21:29:49 2015 +0100 @@ -47,7 +47,7 @@ * a constant, which is potentially scheduled into a block with high probability, with one or more * definitions in blocks with a lower probability. */ -public final class ConstantLoadOptimization extends LIRHighTierPhase { +public final class ConstantLoadOptimization extends PreAllocationOptimizationPhase { public static class Options { // @formatter:off diff -r a32136f93f58 -r 752a498c1b01 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 Tue Feb 17 19:56:44 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +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 com.oracle.graal.lir.constopt.*; -import com.oracle.graal.lir.phases.LIRHighTierPhase.*; - -public class LIRHighTier extends LIRPhaseSuite { - public LIRHighTier() { - if (ConstantLoadOptimization.Options.LIROptConstantLoadOptimization.getValue()) { - appendPhase(new ConstantLoadOptimization()); - } - } -} diff -r a32136f93f58 -r 752a498c1b01 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRHighTierPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRHighTierPhase.java Tue Feb 17 19:56:44 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +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 LIRHighTierPhase extends LIRPhase { - - public static final class LIRHighTierContext { - private final LIRGeneratorTool lirGen; - - public LIRHighTierContext(LIRGeneratorTool lirGen) { - this.lirGen = lirGen; - } - - } - - @Override - protected final > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, LIRHighTierContext context) { - run(target, lirGenRes, codeEmittingOrder, linearScanOrder, context.lirGen); - } - - protected abstract > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, LIRGeneratorTool lirGen); - -} diff -r a32136f93f58 -r 752a498c1b01 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 Tue Feb 17 19:56:44 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Tue Feb 17 21:29:49 2015 +0100 @@ -25,32 +25,32 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.gen.*; -import com.oracle.graal.lir.phases.LIRHighTierPhase.LIRHighTierContext; +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; import com.oracle.graal.lir.phases.LIRLowTierPhase.LIRLowTierContext; import com.oracle.graal.lir.phases.LIRMidTierPhase.LIRMidTierContext; public class LIRSuites { - private final LIRPhaseSuite highTier; + private final LIRPhaseSuite preAllocOptStage; private final LIRPhaseSuite midTier; private final LIRPhaseSuite lowTier; - public LIRSuites(LIRPhaseSuite highTier, LIRPhaseSuite midTier, LIRPhaseSuite lowTier) { - this.highTier = highTier; + public LIRSuites(LIRPhaseSuite preAllocOptStage, LIRPhaseSuite midTier, LIRPhaseSuite lowTier) { + this.preAllocOptStage = preAllocOptStage; this.midTier = midTier; this.lowTier = lowTier; } /** - * {@link LIRHighTierPhase}s are executed between {@link LIR} generation and register + * {@link PreAllocationOptimizationPhase}s are executed between {@link LIR} generation and register * allocation. *

- * {@link LIRHighTierPhase Implementers} can create new {@link LIRGeneratorTool#newVariable + * {@link PreAllocationOptimizationPhase Implementers} can create new {@link LIRGeneratorTool#newVariable * variables}, {@link LIRGenerationResult#getFrameMap stack slots} and * {@link LIRGenerationResult#getFrameMapBuilder virtual stack slots}. */ - public LIRPhaseSuite getHighTier() { - return highTier; + public LIRPhaseSuite getPreAllocationOptimizationStage() { + return preAllocOptStage; } /** diff -r a32136f93f58 -r 752a498c1b01 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PreAllocationOptimizationPhase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PreAllocationOptimizationPhase.java Tue Feb 17 21:29:49 2015 +0100 @@ -0,0 +1,49 @@ +/* + * 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 PreAllocationOptimizationPhase extends LIRPhase { + + public static final class PreAllocationOptimizationContext { + private final LIRGeneratorTool lirGen; + + public PreAllocationOptimizationContext(LIRGeneratorTool lirGen) { + this.lirGen = lirGen; + } + + } + + @Override + protected final > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, PreAllocationOptimizationContext context) { + run(target, lirGenRes, codeEmittingOrder, linearScanOrder, context.lirGen); + } + + protected abstract > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, LIRGeneratorTool lirGen); + +} diff -r a32136f93f58 -r 752a498c1b01 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PreAllocationOptimizationStage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PreAllocationOptimizationStage.java Tue Feb 17 21:29:49 2015 +0100 @@ -0,0 +1,34 @@ +/* + * 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.constopt.*; +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.*; + +public class PreAllocationOptimizationStage extends LIRPhaseSuite { + public PreAllocationOptimizationStage() { + if (ConstantLoadOptimization.Options.LIROptConstantLoadOptimization.getValue()) { + appendPhase(new ConstantLoadOptimization()); + } + } +} diff -r a32136f93f58 -r 752a498c1b01 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 Tue Feb 17 19:56:44 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java Tue Feb 17 21:29:49 2015 +0100 @@ -24,7 +24,7 @@ import com.oracle.graal.api.runtime.*; import com.oracle.graal.lir.phases.*; -import com.oracle.graal.lir.phases.LIRHighTierPhase.*; +import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.*; import com.oracle.graal.lir.phases.LIRLowTierPhase.*; import com.oracle.graal.lir.phases.LIRMidTierPhase.*; import com.oracle.graal.phases.*; @@ -37,7 +37,7 @@ PhaseSuite createLowTier(); - LIRPhaseSuite createLIRHighTier(); + LIRPhaseSuite createPreAllocationOptimizationStage(); LIRPhaseSuite createLIRMidTier(); diff -r a32136f93f58 -r 752a498c1b01 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 Tue Feb 17 19:56:44 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java Tue Feb 17 21:29:49 2015 +0100 @@ -133,7 +133,7 @@ public static LIRSuites createDefaultLIRSuites() { String selected = CompilerConfiguration.getValue(); if (selected.equals("")) { - return new LIRSuites(defaultConfiguration.createLIRHighTier(), defaultConfiguration.createLIRMidTier(), defaultConfiguration.createLIRLowTier()); + return new LIRSuites(defaultConfiguration.createPreAllocationOptimizationStage(), defaultConfiguration.createLIRMidTier(), defaultConfiguration.createLIRLowTier()); } else { return createLIRSuites(selected); } @@ -144,7 +144,7 @@ if (config == null) { throw new GraalInternalError("unknown compiler configuration: " + name); } - return new LIRSuites(config.createLIRHighTier(), config.createLIRMidTier(), config.createLIRLowTier()); + return new LIRSuites(config.createPreAllocationOptimizationStage(), config.createLIRMidTier(), config.createLIRLowTier()); } }