50 public static final NodeClass<XorNode> TYPE = NodeClass.create(XorNode.class); |
50 public static final NodeClass<XorNode> TYPE = NodeClass.create(XorNode.class); |
51 |
51 |
52 public XorNode(ValueNode x, ValueNode y) { |
52 public XorNode(ValueNode x, ValueNode y) { |
53 super(TYPE, getArithmeticOpTable(x).getXor(), x, y); |
53 super(TYPE, getArithmeticOpTable(x).getXor(), x, y); |
54 assert x.stamp(NodeView.DEFAULT).isCompatible(y.stamp(NodeView.DEFAULT)); |
54 assert x.stamp(NodeView.DEFAULT).isCompatible(y.stamp(NodeView.DEFAULT)); |
|
55 } |
|
56 |
|
57 private XorNode(ValueNode x, ValueNode y, Stamp forcedStamp) { |
|
58 super(TYPE, forcedStamp, x, y); |
|
59 } |
|
60 |
|
61 /** |
|
62 * Create a new XorNode with a forced stamp, without eager folding. This should only be used in |
|
63 * snippet code, where native-image may assign wrong stamps during graph generation. |
|
64 */ |
|
65 public static ValueNode createForSnippet(ValueNode x, ValueNode y, Stamp forcedStamp) { |
|
66 return new XorNode(x, y, forcedStamp); |
55 } |
67 } |
56 |
68 |
57 public static ValueNode create(ValueNode x, ValueNode y, NodeView view) { |
69 public static ValueNode create(ValueNode x, ValueNode y, NodeView view) { |
58 BinaryOp<Xor> op = ArithmeticOpTable.forStamp(x.stamp(view)).getXor(); |
70 BinaryOp<Xor> op = ArithmeticOpTable.forStamp(x.stamp(view)).getXor(); |
59 Stamp stamp = op.foldStamp(x.stamp(view), y.stamp(view)); |
71 Stamp stamp = op.foldStamp(x.stamp(view), y.stamp(view)); |