comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AddNode.java @ 18845:f57d86eb036f

removed Node factory methods
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Jan 2015 20:39:04 +0100
parents 290dc460feb3
children edbac8edc2e1
comparison
equal deleted inserted replaced
18843:f2261069ba99 18845:f57d86eb036f
33 import com.oracle.graal.nodes.spi.*; 33 import com.oracle.graal.nodes.spi.*;
34 34
35 @NodeInfo(shortName = "+") 35 @NodeInfo(shortName = "+")
36 public class AddNode extends BinaryArithmeticNode<Add> implements NarrowableArithmeticNode { 36 public class AddNode extends BinaryArithmeticNode<Add> implements NarrowableArithmeticNode {
37 37
38 public static AddNode create(ValueNode x, ValueNode y) { 38 public AddNode(ValueNode x, ValueNode y) {
39 return new AddNode(x, y);
40 }
41
42 protected AddNode(ValueNode x, ValueNode y) {
43 super(ArithmeticOpTable::getAdd, x, y); 39 super(ArithmeticOpTable::getAdd, x, y);
44 } 40 }
45 41
46 @Override 42 @Override
47 public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) { 43 public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
49 if (ret != this) { 45 if (ret != this) {
50 return ret; 46 return ret;
51 } 47 }
52 48
53 if (forX.isConstant() && !forY.isConstant()) { 49 if (forX.isConstant() && !forY.isConstant()) {
54 return AddNode.create(forY, forX); 50 return new AddNode(forY, forX);
55 } 51 }
56 BinaryOp<Add> op = getOp(forX, forY); 52 BinaryOp<Add> op = getOp(forX, forY);
57 boolean associative = op.isAssociative(); 53 boolean associative = op.isAssociative();
58 if (associative) { 54 if (associative) {
59 if (forX instanceof SubNode) { 55 if (forX instanceof SubNode) {