changeset 8381:807fd844ed2a

InvokeWithException cannot be the lastLocationAccess for a FloatingReadNode. Since it is both the invoke and a control flow split, the scheduler cannot schedule anything immediately the invoke. It can only schedule in the normal or exceptional successor - and we have to tell the scheduler here which side it needs to choose by putting in the location identity on both successors.
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 19 Mar 2013 10:00:43 -0700
parents 2543392b9197
children a019b27cb9ef
files graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java	Tue Mar 19 17:01:39 2013 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java	Tue Mar 19 10:00:43 2013 -0700
@@ -200,7 +200,19 @@
 
         @Override
         protected MemoryMap afterSplit(BeginNode node, MemoryMap oldState) {
-            return new MemoryMap(oldState);
+            MemoryMap result = new MemoryMap(oldState);
+            if (node.predecessor() instanceof InvokeWithExceptionNode) {
+                /*
+                 * InvokeWithException cannot be the lastLocationAccess for a FloatingReadNode.
+                 * Since it is both the invoke and a control flow split, the scheduler cannot
+                 * schedule anything immediately the invoke. It can only schedule in the normal or
+                 * exceptional successor - and we have to tell the scheduler here which side it
+                 * needs to choose by putting in the location identity on both successors.
+                 */
+                InvokeWithExceptionNode checkpoint = (InvokeWithExceptionNode) node.predecessor();
+                result.lastMemorySnapshot.put(checkpoint.getLocationIdentity(), node);
+            }
+            return result;
         }
 
         @Override