changeset 5883:3bf1460f35e1

handle ValueProxyNode in EscapeAnalysisPhase
author Lukas Stadler <lukas.stadler@jku.at>
date Fri, 17 Aug 2012 14:11:18 +0200
parents fdec6dbeb3a1
children 347fad1ea1d0
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java	Fri Aug 17 14:10:18 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java	Fri Aug 17 14:11:18 2012 +0200
@@ -415,8 +415,16 @@
             if (escapes) {
                 if (usage instanceof VirtualState) {
                     // nothing to do...
+                } else if (usage instanceof ValueProxyNode) {
+                    ValueProxyNode proxy = (ValueProxyNode) usage;
+                    for (Node proxyUsage : proxy.usages()) {
+                        if (proxyUsage instanceof VirtualObjectState) {
+                            exits.add(usage);
+                            break;
+                        }
+                    }
                 } else if (usage instanceof MethodCallTargetNode) {
-                    if (usage.usages().size() == 0) {
+                    if (usage.usages().isEmpty()) {
                         usage.safeDelete();
                     } else {
                         invokes.add(((MethodCallTargetNode) usage).invoke());