Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastDynamicNode.java @ 18845:f57d86eb036f
removed Node factory methods
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 12 Jan 2015 20:39:04 +0100 |
parents | ca81508f2a19 |
children | ec0733b5a90a |
comparison
equal
deleted
inserted
replaced
18843:f2261069ba99 | 18845:f57d86eb036f |
---|---|
43 * Determines the exception thrown by this node if the check fails: {@link ClassCastException} | 43 * Determines the exception thrown by this node if the check fails: {@link ClassCastException} |
44 * if false; {@link ArrayStoreException} if true. | 44 * if false; {@link ArrayStoreException} if true. |
45 */ | 45 */ |
46 protected final boolean forStoreCheck; | 46 protected final boolean forStoreCheck; |
47 | 47 |
48 /** | 48 public CheckCastDynamicNode(ValueNode hub, ValueNode object, boolean forStoreCheck) { |
49 * @param hub the type being cast to | |
50 * @param object the object being cast | |
51 */ | |
52 public static CheckCastDynamicNode create(ValueNode hub, ValueNode object, boolean forStoreCheck) { | |
53 return new CheckCastDynamicNode(hub, object, forStoreCheck); | |
54 } | |
55 | |
56 protected CheckCastDynamicNode(ValueNode hub, ValueNode object, boolean forStoreCheck) { | |
57 super(object.stamp()); | 49 super(object.stamp()); |
58 this.hub = hub; | 50 this.hub = hub; |
59 this.object = object; | 51 this.object = object; |
60 this.forStoreCheck = forStoreCheck; | 52 this.forStoreCheck = forStoreCheck; |
61 } | 53 } |
99 return forObject; | 91 return forObject; |
100 } | 92 } |
101 if (forHub.isConstant()) { | 93 if (forHub.isConstant()) { |
102 ResolvedJavaType t = tool.getConstantReflection().asJavaType(forHub.asConstant()); | 94 ResolvedJavaType t = tool.getConstantReflection().asJavaType(forHub.asConstant()); |
103 if (t != null) { | 95 if (t != null) { |
104 return CheckCastNode.create(t, forObject, null, forStoreCheck); | 96 return new CheckCastNode(t, forObject, null, forStoreCheck); |
105 } | 97 } |
106 } | 98 } |
107 return this; | 99 return this; |
108 } | 100 } |
109 | 101 |