Mercurial > hg > graal-compiler
diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java @ 22942:2a5b62614a96
Factor out stamp folding logic for UnaryNode and BinaryNode
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Tue, 03 Nov 2015 15:04:20 -0800 |
parents | 2fe4e3511d97 |
children |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java Tue Nov 03 15:13:15 2015 -0800 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java Tue Nov 03 15:04:20 2015 -0800 @@ -86,13 +86,10 @@ return null; } - public Stamp tryFoldStamp(Stamp xStamp, Stamp yStamp) { - return getOp(getX(), getY()).foldStamp(xStamp, yStamp); - } - @Override - public boolean inferStamp() { - return updateStamp(getOp(getX(), getY()).foldStamp(getX().stamp(), getY().stamp())); + public Stamp foldStamp(Stamp stampX, Stamp stampY) { + assert stampX.isCompatible(x.stamp()) && stampY.isCompatible(y.stamp()); + return getOp(getX(), getY()).foldStamp(stampX, stampY); } public static AddNode add(StructuredGraph graph, ValueNode v1, ValueNode v2) {