# HG changeset patch # User Josef Eisl # Date 1401109885 -7200 # Node ID 5e22e6a76ac78291d576fd5b84ef899c60292842 # Parent 1ec990b3e556fc6600e5fa43858734cca61b5e30 LSRA: move stack intervals to active list. diff -r 1ec990b3e556 -r 5e22e6a76ac7 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java Mon May 26 12:06:05 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java Mon May 26 15:11:25 2014 +0200 @@ -221,6 +221,9 @@ // set currentPosition prior to call of walkTo currentPosition = opId; + // update unhandled stack intervals + updateUnhandledStackIntervals(opId); + // call walkTo even if currentPosition == id walkTo(State.Active, opId); walkTo(State.Inactive, opId); @@ -250,4 +253,24 @@ Debug.log("interval moved from %s to %s: %s", from, to, interval.logString(allocator)); } } + + /** + * Move {@linkplain #unhandledLists unhandled} stack intervals to + * {@linkplain IntervalWalker #activeLists active}. + * + * Note that for {@linkplain RegisterBinding#Fixed fixed} and {@linkplain RegisterBinding#Any + * any} intervals this is done in {@link #nextInterval(int)}. + */ + private void updateUnhandledStackIntervals(int opId) { + Interval currentInterval = unhandledLists.get(RegisterBinding.Stack); + while (currentInterval != Interval.EndMarker && currentInterval.from() <= opId) { + Interval next = currentInterval.next; + currentInterval.state = State.Active; + activeLists.addToListSortedByCurrentFromPositions(RegisterBinding.Stack, currentInterval); + intervalMoved(currentInterval, State.Unhandled, State.Active); + currentInterval = next; + } + unhandledLists.set(RegisterBinding.Stack, currentInterval); + } + }