changeset 16423:a9b85fe36dbc

Don't rewrite to trapping null checks if the FrameState has an input that's anchored to the deopting branch.
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 08 Jul 2014 14:25:55 +0200
parents 7f20dee1be60
children 1bed6de938cd
files graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java	Mon Jul 07 20:27:20 2014 -0700
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java	Tue Jul 08 14:25:55 2014 +0200
@@ -129,9 +129,13 @@
 
     private static void checkPredecessor(AbstractDeoptimizeNode deopt, Node predecessor, DeoptimizationReason deoptimizationReason) {
         Node current = predecessor;
-        Node branch = null;
+        BeginNode branch = null;
         while (current instanceof BeginNode) {
-            branch = current;
+            branch = (BeginNode) current;
+            if (branch.anchored().isNotEmpty()) {
+                // some input of the deopt framestate is anchored to this branch
+                return;
+            }
             current = current.predecessor();
         }
         if (current instanceof IfNode) {