# HG changeset patch # User Josef Eisl # Date 1424205228 -3600 # Node ID ab8decaddb11a3f607ea821fbd72e3a4288b5882 # Parent 752a498c1b01b69cf8cb2ec34ad265df0c3104bb Rename LIRMidTier to AllocationStage. diff -r 752a498c1b01 -r ab8decaddb11 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 21:29:49 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Feb 17 21:33:48 2015 +0100 @@ -46,7 +46,7 @@ import com.oracle.graal.lir.phases.*; 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.lir.phases.AllocationPhase.AllocationContext; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.spi.*; @@ -355,8 +355,8 @@ 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); + AllocationContext midTierContext = new AllocationContext(); + lirSuites.getAllocationStage().apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, midTierContext); LIRLowTierContext lowTierContext = new LIRLowTierContext(); lirSuites.getLowTier().apply(target, lirGenRes, codeEmittingOrder, linearScanOrder, lowTierContext); diff -r 752a498c1b01 -r ab8decaddb11 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 21:29:49 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BasicCompilerConfiguration.java Tue Feb 17 21:33:48 2015 +0100 @@ -26,7 +26,7 @@ import com.oracle.graal.lir.phases.*; 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.lir.phases.AllocationPhase.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.tiers.*; @@ -49,8 +49,8 @@ return new PreAllocationOptimizationStage(); } - public LIRPhaseSuite createLIRMidTier() { - return new LIRMidTier(); + public LIRPhaseSuite createAllocationStage() { + return new AllocationStage(); } public LIRPhaseSuite createLIRLowTier() { diff -r 752a498c1b01 -r ab8decaddb11 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanPhase.java Tue Feb 17 21:29:49 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanPhase.java Tue Feb 17 21:33:48 2015 +0100 @@ -29,7 +29,7 @@ import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; -public final class LinearScanPhase extends LIRMidTierPhase { +public final class LinearScanPhase extends AllocationPhase { @Override protected > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder) { diff -r 752a498c1b01 -r ab8decaddb11 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LocationMarker.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LocationMarker.java Tue Feb 17 21:29:49 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LocationMarker.java Tue Feb 17 21:33:48 2015 +0100 @@ -42,7 +42,7 @@ * Mark all live references for a frame state. The frame state use this information to build the OOP * maps. */ -public final class LocationMarker extends LIRMidTierPhase { +public final class LocationMarker extends AllocationPhase { public static class Options { // @formatter:off diff -r 752a498c1b01 -r ab8decaddb11 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationPhase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationPhase.java Tue Feb 17 21:33:48 2015 +0100 @@ -0,0 +1,43 @@ +/* + * 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 AllocationPhase extends LIRPhase { + + public static final class AllocationContext { + } + + @Override + protected final > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, AllocationContext context) { + run(target, lirGenRes, codeEmittingOrder, linearScanOrder); + } + + protected abstract > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder); + +} diff -r 752a498c1b01 -r ab8decaddb11 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationStage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationStage.java Tue Feb 17 21:33:48 2015 +0100 @@ -0,0 +1,42 @@ +/* + * 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.alloc.lsra.*; +import com.oracle.graal.lir.phases.AllocationPhase.*; +import com.oracle.graal.lir.stackslotalloc.*; + +public class AllocationStage extends LIRPhaseSuite { + public AllocationStage() { + appendPhase(new LinearScanPhase()); + + // build frame map + if (LSStackSlotAllocator.Options.LIROptLSStackSlotAllocator.getValue()) { + appendPhase(new LSStackSlotAllocator()); + } else { + appendPhase(new SimpleStackSlotAllocator()); + } + // currently we mark locations only if we do register allocation + appendPhase(new LocationMarker()); + } +} diff -r 752a498c1b01 -r ab8decaddb11 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 Tue Feb 17 21:29:49 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +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.alloc.lsra.*; -import com.oracle.graal.lir.phases.LIRMidTierPhase.*; -import com.oracle.graal.lir.stackslotalloc.*; - -public class LIRMidTier extends LIRPhaseSuite { - public LIRMidTier() { - appendPhase(new LinearScanPhase()); - - // build frame map - if (LSStackSlotAllocator.Options.LIROptLSStackSlotAllocator.getValue()) { - appendPhase(new LSStackSlotAllocator()); - } else { - appendPhase(new SimpleStackSlotAllocator()); - } - // currently we mark locations only if we do register allocation - appendPhase(new LocationMarker()); - } -} diff -r 752a498c1b01 -r ab8decaddb11 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRMidTierPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRMidTierPhase.java Tue Feb 17 21:29:49 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +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 LIRMidTierPhase extends LIRPhase { - - public static final class LIRMidTierContext { - } - - @Override - protected final > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder, LIRMidTierContext context) { - run(target, lirGenRes, codeEmittingOrder, linearScanOrder); - } - - protected abstract > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder); - -} diff -r 752a498c1b01 -r ab8decaddb11 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 21:29:49 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Tue Feb 17 21:33:48 2015 +0100 @@ -27,17 +27,17 @@ import com.oracle.graal.lir.gen.*; 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.lir.phases.AllocationPhase.AllocationContext; public class LIRSuites { private final LIRPhaseSuite preAllocOptStage; - private final LIRPhaseSuite midTier; + private final LIRPhaseSuite allocStage; private final LIRPhaseSuite lowTier; - public LIRSuites(LIRPhaseSuite preAllocOptStage, LIRPhaseSuite midTier, LIRPhaseSuite lowTier) { + public LIRSuites(LIRPhaseSuite preAllocOptStage, LIRPhaseSuite allocStage, LIRPhaseSuite lowTier) { this.preAllocOptStage = preAllocOptStage; - this.midTier = midTier; + this.allocStage = allocStage; this.lowTier = lowTier; } @@ -54,14 +54,14 @@ } /** - * {@link LIRMidTierPhase}s are responsible for register allocation and translating + * {@link AllocationPhase}s are responsible for register allocation and translating * {@link VirtualStackSlot}s into {@link StackSlot}s. *

- * After the {@link LIRMidTier} there should be no more {@link Variable}s and + * After the {@link AllocationStage} there should be no more {@link Variable}s and * {@link VirtualStackSlot}s. */ - public LIRPhaseSuite getMidTier() { - return midTier; + public LIRPhaseSuite getAllocationStage() { + return allocStage; } /** diff -r 752a498c1b01 -r ab8decaddb11 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Tue Feb 17 21:29:49 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Tue Feb 17 21:33:48 2015 +0100 @@ -51,7 +51,7 @@ * {@link OperandFlag#UNINITIALIZED}. Otherwise the stack slot might be reused and its content * destroyed. */ -public final class LSStackSlotAllocator extends LIRMidTierPhase implements StackSlotAllocator { +public final class LSStackSlotAllocator extends AllocationPhase implements StackSlotAllocator { public static class Options { // @formatter:off diff -r 752a498c1b01 -r ab8decaddb11 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java Tue Feb 17 21:29:49 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java Tue Feb 17 21:33:48 2015 +0100 @@ -36,7 +36,7 @@ import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; -public class SimpleStackSlotAllocator extends LIRMidTierPhase implements StackSlotAllocator { +public class SimpleStackSlotAllocator extends AllocationPhase implements StackSlotAllocator { @Override protected > void run(TargetDescription target, LIRGenerationResult lirGenRes, List codeEmittingOrder, List linearScanOrder) { diff -r 752a498c1b01 -r ab8decaddb11 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 21:29:49 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/CompilerConfiguration.java Tue Feb 17 21:33:48 2015 +0100 @@ -26,7 +26,7 @@ import com.oracle.graal.lir.phases.*; 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.lir.phases.AllocationPhase.*; import com.oracle.graal.phases.*; public interface CompilerConfiguration extends Service { @@ -39,7 +39,7 @@ LIRPhaseSuite createPreAllocationOptimizationStage(); - LIRPhaseSuite createLIRMidTier(); + LIRPhaseSuite createAllocationStage(); LIRPhaseSuite createLIRLowTier(); } diff -r 752a498c1b01 -r ab8decaddb11 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 21:29:49 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/Suites.java Tue Feb 17 21:33:48 2015 +0100 @@ -133,7 +133,7 @@ public static LIRSuites createDefaultLIRSuites() { String selected = CompilerConfiguration.getValue(); if (selected.equals("")) { - return new LIRSuites(defaultConfiguration.createPreAllocationOptimizationStage(), defaultConfiguration.createLIRMidTier(), defaultConfiguration.createLIRLowTier()); + return new LIRSuites(defaultConfiguration.createPreAllocationOptimizationStage(), defaultConfiguration.createAllocationStage(), defaultConfiguration.createLIRLowTier()); } else { return createLIRSuites(selected); } @@ -144,7 +144,7 @@ if (config == null) { throw new GraalInternalError("unknown compiler configuration: " + name); } - return new LIRSuites(config.createPreAllocationOptimizationStage(), config.createLIRMidTier(), config.createLIRLowTier()); + return new LIRSuites(config.createPreAllocationOptimizationStage(), config.createAllocationStage(), config.createLIRLowTier()); } }