changeset 15903:5d734275cc5f

LSRA: make IntervalWalker.currentInterval private.
author Josef Eisl <josef.eisl@jku.at>
date Thu, 22 May 2014 19:42:02 +0200
parents a7fd7fee9d40
children 09f3fe273640
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java
diffstat 2 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java	Thu May 22 23:02:46 2014 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/IntervalWalker.java	Thu May 22 19:42:02 2014 +0200
@@ -51,7 +51,7 @@
     /**
      * The current interval (taken from the unhandled list) being processed.
      */
-    protected Interval currentInterval;
+    private Interval currentInterval;
 
     /**
      * The current position (intercept point through the intervals).
@@ -64,14 +64,12 @@
     protected RegisterBinding currentBinding;
 
     /**
-     * Processes the {@linkplain #currentInterval} interval in an attempt to allocate a physical
-     * register to it and thus allow it to be moved to a list of {@linkplain #activeLists active}
-     * intervals.
+     * Processes the {@code currentInterval} interval in an attempt to allocate a physical register
+     * to it and thus allow it to be moved to a list of {@linkplain #activeLists active} intervals.
      *
-     * @return {@code true} if a register was allocated to the {@linkplain #currentInterval}
-     *         interval
+     * @return {@code true} if a register was allocated to the {@code currentInterval} interval
      */
-    protected boolean activateCurrent() {
+    protected boolean activateCurrent(@SuppressWarnings({"unused", "hiding"}) Interval currentInterval) {
         return true;
     }
 
@@ -217,7 +215,7 @@
             if (isActive) {
                 try (Indent indent = Debug.logAndIndent("walk to op %d", opId)) {
                     currentInterval.state = State.Active;
-                    if (activateCurrent()) {
+                    if (activateCurrent(currentInterval)) {
                         activeLists.addToListSortedByCurrentFromPositions(currentBinding, currentInterval);
                         intervalMoved(currentInterval, State.Unhandled, State.Active);
                     }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Thu May 22 23:02:46 2014 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Thu May 22 19:42:02 2014 +0200
@@ -430,7 +430,7 @@
 
             splitPart.setInsertMoveWhenActivated(moveNecessary);
 
-            assert splitPart.from() >= currentInterval.currentFrom() : "cannot append new interval before current walk position";
+            assert splitPart.from() >= currentPosition : "cannot append new interval before current walk position";
             unhandledLists.addToListSortedByStartAndUsePositions(RegisterBinding.Any, splitPart);
 
             if (Debug.isLogEnabled()) {
@@ -836,8 +836,7 @@
 
     // allocate a physical register or memory location to an interval
     @Override
-    protected boolean activateCurrent() {
-        Interval interval = currentInterval;
+    protected boolean activateCurrent(Interval interval) {
         boolean result = true;
 
         try (Indent indent = Debug.logAndIndent("activating interval %s,  splitParent: %d", interval, interval.splitParent().operandNumber)) {