Mercurial > hg > truffle
diff graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnboxNode.java @ 4579:854145ec9866
Fix boxing elimination for boxed constants.
Remove redundant "inlining" in dump message.
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Mon, 13 Feb 2012 17:01:14 +0100 |
parents | 2bab0e314b5c |
children |
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnboxNode.java Mon Feb 13 14:02:30 2012 +0100 +++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnboxNode.java Mon Feb 13 17:01:14 2012 +0100 @@ -34,10 +34,12 @@ public final class UnboxNode extends FixedWithNextNode implements Node.IterableNodeType, Canonicalizable { @Input private ValueNode source; + @Data private CiKind destinationKind; public UnboxNode(CiKind kind, ValueNode source) { super(StampFactory.forKind(kind)); this.source = source; + this.destinationKind = kind; assert kind != CiKind.Object : "can only unbox to primitive"; assert source.kind() == CiKind.Object : "can only unbox objects"; } @@ -47,7 +49,7 @@ } public CiKind destinationKind() { - return this.kind(); + return destinationKind; } public void expand(BoxingMethodPool pool) { @@ -63,7 +65,7 @@ CiConstant constant = source.asConstant(); Object o = constant.asObject(); if (o != null) { - switch (kind()) { + switch (destinationKind) { case Boolean: return ConstantNode.forBoolean((Boolean) o, graph()); case Byte: @@ -81,7 +83,7 @@ case Double: return ConstantNode.forDouble((Long) o, graph()); default: - assert false; + ValueUtil.shouldNotReachHere(); } } }