# HG changeset patch # User Thomas Wuerthinger # Date 1376672671 -7200 # Node ID bdd94e3133d751fa10552ed740700c62d3afbffd # Parent 4f97013c6317d39d9e52f4204f28798b2cb12ea3 Make CustomTypeCheckNode virtualizable. diff -r 4f97013c6317 -r bdd94e3133d7 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomTypeCheckNode.java --- 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; + } + } + } }