changeset 15931:5e22e6a76ac7

LSRA: move stack intervals to active list.
author Josef Eisl <josef.eisl@jku.at>
date Mon, 26 May 2014 15:11:25 +0200
parents 1ec990b3e556
children 01e6f7caa9b7
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);
+    }
+
 }