Mercurial > hg > truffle
diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IntegerSwitchNode.java @ 17276:ffb974bef674
moved Node valueNumber and valueEquals logic (optionally) to generated nodes
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 01 Oct 2014 07:39:47 +0200 |
parents | 77981382473e |
children | 845e881ce054 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IntegerSwitchNode.java Tue Sep 30 23:42:08 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IntegerSwitchNode.java Wed Oct 01 07:39:47 2014 +0200 @@ -39,7 +39,7 @@ @NodeInfo public class IntegerSwitchNode extends SwitchNode implements LIRLowerable, Simplifiable { - private final int[] keys; + protected final int[] keys; /** * Constructs a integer switch instruction. The keyProbabilities and keySuccessors array contain @@ -148,11 +148,11 @@ tool.addToWorkList(blockSuccessor(survivingEdge)); graph().removeSplit(this, blockSuccessor(survivingEdge)); } else if (value().stamp() instanceof IntegerStamp) { - IntegerStamp stamp = (IntegerStamp) value().stamp(); - if (!stamp.isUnrestricted()) { + IntegerStamp integerStamp = (IntegerStamp) value().stamp(); + if (!integerStamp.isUnrestricted()) { int validKeys = 0; for (int i = 0; i < keyCount(); i++) { - if (stamp.contains(keys[i])) { + if (integerStamp.contains(keys[i])) { validKeys++; } } @@ -167,7 +167,7 @@ double totalProbability = 0; int current = 0; for (int i = 0; i < keyCount() + 1; i++) { - if (i == keyCount() || stamp.contains(keys[i])) { + if (i == keyCount() || integerStamp.contains(keys[i])) { int index = newSuccessors.indexOf(keySuccessor(i)); if (index == -1) { index = newSuccessors.size();