changeset 11330:bdd94e3133d7

Make CustomTypeCheckNode virtualizable.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 16 Aug 2013 19:04:31 +0200
parents 4f97013c6317
children 07814c3b5dba
files graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomTypeCheckNode.java
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomTypeCheckNode.java	Fri Aug 16 18:21:59 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomTypeCheckNode.java	Fri Aug 16 19:04:31 2013 +0200
@@ -26,7 +26,7 @@
 import com.oracle.graal.nodes.calc.*;
 import com.oracle.graal.nodes.spi.*;
 
-public final class CustomTypeCheckNode extends LogicNode implements Lowerable, com.oracle.graal.graph.Node.IterableNodeType {
+public final class CustomTypeCheckNode extends LogicNode implements Lowerable, Virtualizable, com.oracle.graal.graph.Node.IterableNodeType {
 
     @Input private ValueNode condition;
     @Input private ValueNode object;
@@ -61,4 +61,15 @@
     public LogicNode canonical(CanonicalizerTool tool) {
         return this;
     }
+
+    public void virtualize(VirtualizerTool tool) {
+        if (getObject() != null) {
+            State objectState = tool.getObjectState(getObject());
+            if (objectState != null && objectState.getState() == EscapeState.Virtual) {
+                // The object is escape analyzed => cut the connection.
+                this.updateUsages(this.object, null);
+                this.object = null;
+            }
+        }
+    }
 }