Mercurial > hg > truffle
diff graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java @ 19212:95a7954ea155
Add LinearScanPhase.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Fri, 06 Feb 2015 20:25:14 +0100 |
parents | 39e99cf01468 |
children | 1cf73c50e3dc 4d70d150944f |
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Fri Feb 06 20:06:38 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Fri Feb 06 20:25:14 2015 +0100 @@ -56,7 +56,7 @@ * >"Optimized Interval Splitting in a Linear Scan Register Allocator"</a> by Christian Wimmer and * Hanspeter Moessenboeck. */ -public final class LinearScan { +final class LinearScan { final TargetDescription target; final LIRGenerationResult res; @@ -109,7 +109,7 @@ public BitSet liveKill; } - public final BlockMap<BlockData> blockData; + final BlockMap<BlockData> blockData; /** * List of blocks in linear-scan order. This is only correct as long as the CFG does not change. @@ -161,7 +161,7 @@ */ private final int firstVariableNumber; - public LinearScan(TargetDescription target, LIRGenerationResult res) { + LinearScan(TargetDescription target, LIRGenerationResult res) { this.target = target; this.res = res; this.ir = res.getLIR(); @@ -178,13 +178,13 @@ this.callKillsRegisters = this.frameMapBuilder.getRegisterConfig().areAllAllocatableRegistersCallerSaved(); } - public int getFirstLirInstructionId(AbstractBlock<?> block) { + int getFirstLirInstructionId(AbstractBlock<?> block) { int result = ir.getLIRforBlock(block).get(0).id(); assert result >= 0; return result; } - public int getLastLirInstructionId(AbstractBlock<?> block) { + int getLastLirInstructionId(AbstractBlock<?> block) { List<LIRInstruction> instructions = ir.getLIRforBlock(block); int result = instructions.get(instructions.size() - 1).id(); assert result >= 0; @@ -220,7 +220,7 @@ /** * Gets the highest operand number for a register operand. This value will never change. */ - public int maxRegisterNumber() { + int maxRegisterNumber() { return firstVariableNumber - 1; } @@ -1374,7 +1374,7 @@ sortedIntervals = combinedList; } - public void allocateRegisters() { + void allocateRegisters() { try (Indent indent = Debug.logAndIndent("allocate registers")) { Interval precoloredIntervals; Interval notPrecoloredIntervals; @@ -1731,11 +1731,7 @@ } } - public static void allocate(TargetDescription target, LIRGenerationResult res) { - new LinearScan(target, res).allocate(); - } - - private void allocate() { + void allocate() { /* * This is the point to enable debug logging for the whole register allocation.