Mercurial > hg > truffle
diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java @ 16895:06c15e88d383
added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 18 Aug 2014 14:04:21 +0200 |
parents | cbd42807a31f |
children | 0fe4732e5181 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java Mon Aug 18 13:49:25 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java Mon Aug 18 14:04:21 2014 +0200 @@ -44,7 +44,11 @@ private final Kind boxingKind; - public BoxNode(ValueNode value, ResolvedJavaType resultType, Kind boxingKind) { + public static BoxNode create(ValueNode value, ResolvedJavaType resultType, Kind boxingKind) { + return new BoxNodeGen(value, resultType, boxingKind); + } + + BoxNode(ValueNode value, ResolvedJavaType resultType, Kind boxingKind) { super(StampFactory.exactNonNull(resultType), value); this.boxingKind = boxingKind; } @@ -72,7 +76,7 @@ ValueNode v = tool.getReplacedValue(getValue()); ResolvedJavaType type = StampTool.typeOrNull(stamp()); - VirtualBoxingNode newVirtual = new VirtualBoxingNode(type, boxingKind); + VirtualBoxingNode newVirtual = VirtualBoxingNode.create(type, boxingKind); assert newVirtual.getFields().length == 1; tool.createVirtualObject(newVirtual, new ValueNode[]{v}, Collections.<MonitorIdNode> emptyList());