changeset 14110:e55082b1e727

During LoopFragment.mergeEarlyExits we need to update the orignal fragement's nodes bitmap
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 06 Mar 2014 18:21:54 +0100
parents 85969b1aba78
children 6205f565e230
files graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java	Thu Mar 06 18:13:49 2014 +0100
+++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java	Thu Mar 06 18:21:54 2014 +0100
@@ -302,6 +302,24 @@
                 exitState = exitState.duplicateWithVirtualState();
                 earlyExit.setStateAfter(exitState);
                 merge.setStateAfter(state);
+                /*
+                 * Using the old exit's state as the merge's state is necessary because some of the
+                 * VirtualState nodes contained in the old exit's state may be shared by other
+                 * dominated VirtualStates. Those dominated virtual states need to see the
+                 * proxy->phi update that are applied below.
+                 * 
+                 * We now update the original fragment's nodes accordingly:
+                 */
+                state.applyToVirtual(new VirtualClosure() {
+                    public void apply(VirtualState node) {
+                        original.nodes.clear(node);
+                    }
+                });
+                exitState.applyToVirtual(new VirtualClosure() {
+                    public void apply(VirtualState node) {
+                        original.nodes.mark(node);
+                    }
+                });
             }
 
             for (Node anchored : earlyExit.anchored().snapshot()) {