diff graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java @ 18231:70df63b02309

Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Mon, 03 Nov 2014 13:37:10 -0800
parents 4ab45518048b
children 1518c3296cc8
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Mon Nov 03 10:31:39 2014 -0800
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Mon Nov 03 13:37:10 2014 -0800
@@ -437,7 +437,7 @@
                 break;
             case LATEST:
             case LATEST_OUT_OF_LOOPS:
-                boolean scheduleRead = memsched == MemoryScheduling.OPTIMAL && node instanceof FloatingReadNode && ((FloatingReadNode) node).location().getLocationIdentity() != FINAL_LOCATION;
+                boolean scheduleRead = memsched == MemoryScheduling.OPTIMAL && node instanceof FloatingReadNode && !((FloatingReadNode) node).location().getLocationIdentity().isImmutable();
                 if (scheduleRead) {
                     FloatingReadNode read = (FloatingReadNode) node;
                     block = optimalBlock(read, strategy);
@@ -508,7 +508,7 @@
         assert memsched == MemoryScheduling.OPTIMAL;
 
         LocationIdentity locid = n.location().getLocationIdentity();
-        assert locid != FINAL_LOCATION;
+        assert !locid.isImmutable();
 
         Block upperBoundBlock = blockForMemoryNode(n.getLastLocationAccess());
         Block earliestBlock = earliestBlock(n);
@@ -996,7 +996,7 @@
             for (ScheduledNode i : instructions) {
                 if (i instanceof FloatingReadNode) {
                     FloatingReadNode frn = (FloatingReadNode) i;
-                    if (frn.location().getLocationIdentity() != FINAL_LOCATION) {
+                    if (!frn.location().getLocationIdentity().isImmutable()) {
                         state.addRead(frn);
                         if (nodesFor(b).contains(frn.getLastLocationAccess())) {
                             assert !state.isBeforeLastLocation(frn);
@@ -1043,7 +1043,7 @@
     private void processKillLocation(Node node, LocationIdentity identity, SortState state) {
         for (FloatingReadNode frn : state.readsSnapshot()) {
             LocationIdentity readLocation = frn.location().getLocationIdentity();
-            assert readLocation != FINAL_LOCATION;
+            assert !readLocation.isImmutable();
             if (frn.getLastLocationAccess() == node) {
                 assert identity == ANY_LOCATION || readLocation == identity || node instanceof MemoryCheckpoint.Multi : "location doesn't match: " + readLocation + ", " + identity;
                 state.clearBeforeLastLocation(frn);