Mercurial > hg > graal-compiler
changeset 22556:576594eb9fb0
TraceRA: make classes final and invisible.
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/Interval.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/Interval.java Tue Sep 01 12:13:11 2015 +0200 @@ -39,7 +39,7 @@ /** * Represents an interval in the {@linkplain TraceLinearScan linear scan register allocator}. */ -public final class Interval { +final class Interval { /** * A pair of intervals.
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/IntervalWalker.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/IntervalWalker.java Tue Sep 01 12:13:11 2015 +0200 @@ -30,7 +30,7 @@ /** */ -public class IntervalWalker { +class IntervalWalker { protected final TraceLinearScan allocator;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/LinearScanWalker.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/LinearScanWalker.java Tue Sep 01 12:13:11 2015 +0200 @@ -44,7 +44,7 @@ /** */ -class LinearScanWalker extends IntervalWalker { +final class LinearScanWalker extends IntervalWalker { protected Register[] availableRegs; @@ -638,7 +638,7 @@ /** * This is called for every interval that is assigned to a stack slot. */ - protected void handleSpillSlot(Interval interval) { + protected static void handleSpillSlot(Interval interval) { assert interval.location() != null && (interval.canMaterialize() || isStackSlotValue(interval.location())) : "interval not assigned to a stack slot " + interval; // Do nothing. Stack slots are not processed in this implementation. }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/Range.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/Range.java Tue Sep 01 12:13:11 2015 +0200 @@ -25,7 +25,7 @@ /** * Represents a range of integers from a start (inclusive) to an end (exclusive. */ -public final class Range { +final class Range { public static final Range EndMarker = new Range(Integer.MAX_VALUE, Integer.MAX_VALUE, null);
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java Tue Sep 01 12:13:11 2015 +0200 @@ -41,7 +41,7 @@ import com.oracle.graal.lir.ssa.SSAUtil.PhiValueVisitor; import com.oracle.graal.lir.ssi.*; -public class TraceGlobalMoveResolutionPhase extends AllocationPhase { +final class TraceGlobalMoveResolutionPhase extends AllocationPhase { private final TraceBuilderResult<?> resultTraces;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceGlobalMoveResolver.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceGlobalMoveResolver.java Tue Sep 01 12:13:11 2015 +0200 @@ -39,7 +39,7 @@ /** */ -class TraceGlobalMoveResolver { +final class TraceGlobalMoveResolver { private int insertIdx; private LIRInsertionBuffer insertionBuffer; // buffer where moves are inserted
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScan.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScan.java Tue Sep 01 12:13:11 2015 +0200 @@ -54,7 +54,7 @@ * >"Optimized Interval Splitting in a Linear Scan Register Allocator"</a> by Christian Wimmer and * Hanspeter Moessenboeck. */ -public class TraceLinearScan { +final class TraceLinearScan { public static class Options { // @formatter:off
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanAssignLocationsPhase.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanAssignLocationsPhase.java Tue Sep 01 12:13:11 2015 +0200 @@ -51,7 +51,7 @@ * {@link ShadowedRegisterValue}s to describe {@link RegisterValue}s that are also available on the * {@link StackSlotValue stack}. */ -public class TraceLinearScanAssignLocationsPhase extends AllocationPhase { +final class TraceLinearScanAssignLocationsPhase extends AllocationPhase { protected final TraceLinearScan allocator; private final TraceBuilderResult<?> traceBuilderResult;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanEliminateSpillMovePhase.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanEliminateSpillMovePhase.java Tue Sep 01 12:13:11 2015 +0200 @@ -43,7 +43,7 @@ import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.*; -public class TraceLinearScanEliminateSpillMovePhase extends AllocationPhase { +final class TraceLinearScanEliminateSpillMovePhase extends AllocationPhase { private static final IntervalPredicate mustStoreAtDefinition = new TraceLinearScan.IntervalPredicate() { @@ -69,7 +69,7 @@ * @return the index of the first instruction that is of interest for * {@link #eliminateSpillMoves()} */ - protected int firstInstructionOfInterest() { + protected static int firstInstructionOfInterest() { // also look at Labels as they define PHI values return 0; } @@ -179,15 +179,15 @@ * @param block The block {@code move} is located in. * @param move Spill move. */ - protected boolean canEliminateSpillMove(AbstractBlockBase<?> block, MoveOp move) { + protected static boolean canEliminateSpillMove(AbstractBlockBase<?> block, MoveOp move) { // TODO (je) do not eliminate spill moves yet! return false; /* * assert isVariable(move.getResult()) : "LinearScan inserts only moves to variables: " + * move; - * + * * Interval curInterval = allocator.intervalFor(move.getResult()); - * + * * if (!isRegister(curInterval.location()) && curInterval.alwaysInMemory()) { assert * isStackSlotValue(curInterval.location()) : "Not a stack slot: " + curInterval.location(); * return true; } return false;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanLifetimeAnalysisPhase.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanLifetimeAnalysisPhase.java Tue Sep 01 12:13:11 2015 +0200 @@ -46,7 +46,6 @@ import com.oracle.graal.lir.StandardOp.BlockEndOp; import com.oracle.graal.lir.StandardOp.LabelOp; import com.oracle.graal.lir.StandardOp.LoadConstantOp; -import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.lir.StandardOp.StackStoreOp; import com.oracle.graal.lir.StandardOp.ValueMoveOp; import com.oracle.graal.lir.alloc.trace.Interval.RegisterPriority; @@ -57,7 +56,7 @@ import com.oracle.graal.lir.phases.*; import com.oracle.graal.lir.ssi.*; -public class TraceLinearScanLifetimeAnalysisPhase extends AllocationPhase { +class TraceLinearScanLifetimeAnalysisPhase extends AllocationPhase { protected final TraceLinearScan allocator; private final TraceBuilderResult<?> traceBuilderResult; @@ -347,7 +346,7 @@ /* * liveIn(block) is the union of liveGen(block) with (liveOut(block) & * !liveKill(block)). - * + * * Note: liveIn has to be computed only in first iteration or if liveOut * has changed! */ @@ -571,29 +570,7 @@ * of such moves is assigned the stack slot (which is in the caller's frame) as its spill slot. */ protected void handleMethodArguments(LIRInstruction op) { - if (op instanceof MoveOp) { - // do not optimize method arguments - return; - } - if (op instanceof ValueMoveOp) { - ValueMoveOp move = (ValueMoveOp) op; - if (optimizeMethodArgument(move.getInput())) { - StackSlot slot = asStackSlot(move.getInput()); - if (DetailedAsserts.getValue()) { - assert op.id() > 0 : "invalid id"; - assert allocator.blockForId(op.id()).getPredecessorCount() == 0 : "move from stack must be in first block"; - assert isVariable(move.getResult()) : "result of move must be a variable"; - - if (Debug.isLogEnabled()) { - Debug.log("found move from stack slot %s to %s", slot, move.getResult()); - } - } - - Interval interval = allocator.intervalFor(move.getResult()); - interval.setSpillSlot(slot); - interval.assignLocation(slot); - } - } else if (op instanceof StackStoreOp) { + if (op instanceof StackStoreOp) { StackStoreOp store = (StackStoreOp) op; StackSlot slot = asStackSlot(store.getStackSlot()); Interval interval = allocator.intervalFor(store.getResult());
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanOptimizeSpillPositionPhase.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanOptimizeSpillPositionPhase.java Tue Sep 01 12:13:11 2015 +0200 @@ -40,7 +40,7 @@ import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.*; -public final class TraceLinearScanOptimizeSpillPositionPhase extends AllocationPhase { +final class TraceLinearScanOptimizeSpillPositionPhase extends AllocationPhase { private static final DebugMetric betterSpillPos = Debug.metric("BetterSpillPosition"); private static final DebugMetric betterSpillPosWithLowerProbability = Debug.metric("BetterSpillPositionWithLowerProbability"); @@ -118,7 +118,7 @@ /* * The spill block is the begin of the first split child (aka the value is on the * stack). - * + * * The problem is that if spill block has more than one predecessor, the values at the * end of the predecessors might differ. Therefore, we would need a spill move in all * predecessors. To avoid this we spill in the dominator.
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanRegisterAllocationPhase.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanRegisterAllocationPhase.java Tue Sep 01 12:13:11 2015 +0200 @@ -33,7 +33,7 @@ import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.*; -public final class TraceLinearScanRegisterAllocationPhase extends AllocationPhase { +final class TraceLinearScanRegisterAllocationPhase extends AllocationPhase { private final TraceLinearScan allocator;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanResolveDataFlowPhase.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanResolveDataFlowPhase.java Tue Sep 01 12:13:11 2015 +0200 @@ -46,7 +46,7 @@ * * Insert moves at edges between blocks if intervals have been split. */ -public class TraceLinearScanResolveDataFlowPhase extends AllocationPhase { +final class TraceLinearScanResolveDataFlowPhase extends AllocationPhase { protected final TraceLinearScan allocator;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLocalMoveResolver.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLocalMoveResolver.java Tue Sep 01 12:13:11 2015 +0200 @@ -33,7 +33,7 @@ import com.oracle.graal.lir.*; import com.oracle.graal.lir.framemap.*; -public final class TraceLocalMoveResolver extends MoveResolver { +final class TraceLocalMoveResolver extends MoveResolver { private static final int STACK_SLOT_IN_CALLER_FRAME_IDX = -1; private int[] stackBlocked;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceRegisterAllocationPhase.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceRegisterAllocationPhase.java Tue Sep 01 12:13:11 2015 +0200 @@ -42,7 +42,7 @@ import com.oracle.graal.lir.phases.*; import com.oracle.graal.lir.ssi.*; -public class TraceRegisterAllocationPhase extends AllocationPhase { +public final class TraceRegisterAllocationPhase extends AllocationPhase { public static class Options { // @formatter:off @Option(help = "Use inter-trace register hints.", type = OptionType.Debug)
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceSimpleLifetimeAnalysisPhase.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceSimpleLifetimeAnalysisPhase.java Tue Sep 01 12:13:11 2015 +0200 @@ -39,7 +39,7 @@ import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; -public class TraceSimpleLifetimeAnalysisPhase extends TraceLinearScanLifetimeAnalysisPhase { +final class TraceSimpleLifetimeAnalysisPhase extends TraceLinearScanLifetimeAnalysisPhase { public TraceSimpleLifetimeAnalysisPhase(TraceLinearScan allocator, TraceBuilderResult<?> traceBuilderResult) { super(allocator, traceBuilderResult);
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceTrivialAllocator.java Mon Aug 31 13:55:03 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceTrivialAllocator.java Tue Sep 01 12:13:11 2015 +0200 @@ -47,7 +47,7 @@ * Allocates a trivial trace i.e. a trace consisting of a single block with no instructions other * than the {@link LabelOp} and the {@link BlockEndOp}. */ -public class TraceTrivialAllocator extends AllocationPhase { +final class TraceTrivialAllocator extends AllocationPhase { private final TraceBuilderResult<?> resultTraces;