Mercurial > hg > truffle
comparison graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerAddExactNode.java @ 20183:9dc78dc645e5
Integer exact arithmetic: make sure non-exact stamp logic is not used
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Thu, 02 Apr 2015 14:37:44 +0200 |
parents | c5ae0424f822 |
children | 48c1ebd24120 |
comparison
equal
deleted
inserted
replaced
20182:c5ae0424f822 | 20183:9dc78dc645e5 |
---|---|
39 public final class IntegerAddExactNode extends AddNode implements IntegerExactArithmeticNode { | 39 public final class IntegerAddExactNode extends AddNode implements IntegerExactArithmeticNode { |
40 public static final NodeClass<IntegerAddExactNode> TYPE = NodeClass.create(IntegerAddExactNode.class); | 40 public static final NodeClass<IntegerAddExactNode> TYPE = NodeClass.create(IntegerAddExactNode.class); |
41 | 41 |
42 public IntegerAddExactNode(ValueNode x, ValueNode y) { | 42 public IntegerAddExactNode(ValueNode x, ValueNode y) { |
43 super(TYPE, x, y); | 43 super(TYPE, x, y); |
44 setStamp(x.stamp().unrestricted()); | |
44 assert x.stamp().isCompatible(y.stamp()) && x.stamp() instanceof IntegerStamp; | 45 assert x.stamp().isCompatible(y.stamp()) && x.stamp() instanceof IntegerStamp; |
45 } | 46 } |
46 | 47 |
47 @Override | 48 @Override |
48 public boolean inferStamp() { | 49 public boolean inferStamp() { |
49 // TODO Should probably use a specialized version which understands that it can't overflow | 50 // TODO Should probably use a specialized version which understands that it can't overflow |
50 return super.inferStamp(); | 51 return false; |
51 } | 52 } |
52 | 53 |
53 @Override | 54 @Override |
54 public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) { | 55 public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) { |
55 ValueNode result = findSynonym(forX, forY); | 56 ValueNode result = findSynonym(forX, forY); |