Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java @ 16895:06c15e88d383
added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 18 Aug 2014 14:04:21 +0200 |
parents | cbd42807a31f |
children | 0fe4732e5181 |
comparison
equal
deleted
inserted
replaced
16894:cc7aaa92c27d | 16895:06c15e88d383 |
---|---|
43 * Creates a new LoadFieldNode instance. | 43 * Creates a new LoadFieldNode instance. |
44 * | 44 * |
45 * @param object the receiver object | 45 * @param object the receiver object |
46 * @param field the compiler interface field | 46 * @param field the compiler interface field |
47 */ | 47 */ |
48 public LoadFieldNode(ValueNode object, ResolvedJavaField field) { | 48 public static LoadFieldNode create(ValueNode object, ResolvedJavaField field) { |
49 return new LoadFieldNodeGen(object, field); | |
50 } | |
51 | |
52 protected LoadFieldNode(ValueNode object, ResolvedJavaField field) { | |
49 super(createStamp(field), object, field); | 53 super(createStamp(field), object, field); |
50 } | 54 } |
51 | 55 |
52 public ValueNode getValue() { | 56 public ValueNode getValue() { |
53 return object(); | 57 return object(); |
76 if (phi != null) { | 80 if (phi != null) { |
77 return phi; | 81 return phi; |
78 } | 82 } |
79 } | 83 } |
80 if (!isStatic() && forObject.isNullConstant()) { | 84 if (!isStatic() && forObject.isNullConstant()) { |
81 return new DeoptimizeNode(DeoptimizationAction.None, DeoptimizationReason.NullCheckException); | 85 return DeoptimizeNode.create(DeoptimizationAction.None, DeoptimizationReason.NullCheckException); |
82 } | 86 } |
83 return this; | 87 return this; |
84 } | 88 } |
85 | 89 |
86 /** | 90 /** |
112 } | 116 } |
113 ConstantNode[] constantNodes = new ConstantNode[phi.valueCount()]; | 117 ConstantNode[] constantNodes = new ConstantNode[phi.valueCount()]; |
114 for (int i = 0; i < phi.valueCount(); i++) { | 118 for (int i = 0; i < phi.valueCount(); i++) { |
115 constantNodes[i] = ConstantNode.forConstant(constants[i], metaAccess); | 119 constantNodes[i] = ConstantNode.forConstant(constants[i], metaAccess); |
116 } | 120 } |
117 return new ValuePhiNode(stamp(), phi.merge(), constantNodes); | 121 return ValuePhiNode.create(stamp(), phi.merge(), constantNodes); |
118 } | 122 } |
119 return null; | 123 return null; |
120 } | 124 } |
121 | 125 |
122 @Override | 126 @Override |