# HG changeset patch # User Josef Eisl # Date 1401098765 -7200 # Node ID 1ec990b3e556fc6600e5fa43858734cca61b5e30 # Parent 8da4ff90fb7f96a6eebfb45317be4240a580de96 LSRA optimization: add LinearScanWalker.handleSpillSlot(). diff -r 8da4ff90fb7f -r 1ec990b3e556 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java Mon May 26 11:47:45 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java Mon May 26 12:06:05 2014 +0200 @@ -466,6 +466,7 @@ assert interval.firstUsage(RegisterPriority.ShouldHaveRegister) > currentPosition : "interval must not have use position before currentPosition"; allocator.assignSpillSlot(interval); + handleSpillSlot(interval); allocator.changeSpillState(interval, minSplitPos); // Also kick parent intervals out of register to memory when they have no use @@ -480,6 +481,7 @@ // parent is never used, so kick it out of its assigned register Debug.log("kicking out interval %d out of its register because it is never used", parent.operandNumber); allocator.assignSpillSlot(parent); + handleSpillSlot(parent); } else { // do not go further back because the register is actually used by // the interval @@ -508,6 +510,7 @@ Interval spilledPart = interval.split(optimalSplitPos, allocator); allocator.assignSpillSlot(spilledPart); + handleSpillSlot(spilledPart); allocator.changeSpillState(spilledPart, optimalSplitPos); if (!allocator.isBlockBegin(optimalSplitPos)) { @@ -528,6 +531,14 @@ } } + /** + * This is called for every interval that is assigned to a stack slot. + */ + protected void handleSpillSlot(Interval interval) { + assert interval.location() != null && (interval.canMaterialize() || isStackSlot(interval.location())) : "interval not assigned to a stack slot " + interval; + // Do nothing. Stack slots are not processed in this implementation. + } + void splitStackInterval(Interval interval) { int minSplitPos = currentPosition + 1; int maxSplitPos = Math.min(interval.firstUsage(RegisterPriority.ShouldHaveRegister), interval.to());