src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java
changeset 58877 aec7bf35d6f5
parent 58533 46b0b7fe255c
equal deleted inserted replaced
58876:1a8d65e71a66 58877:aec7bf35d6f5
    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));