Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java @ 19801:deab43a789ad
Split LeafType off from ConcreteSubtype
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Wed, 11 Mar 2015 17:45:21 -0700 |
parents | 3362ba500371 |
children | 51f2e71b57aa |
comparison
equal
deleted
inserted
replaced
19800:3362ba500371 | 19801:deab43a789ad |
---|---|
70 if (synonym != null) { | 70 if (synonym != null) { |
71 return synonym; | 71 return synonym; |
72 } | 72 } |
73 assert object.stamp() instanceof ObjectStamp : object + ":" + object.stamp(); | 73 assert object.stamp() instanceof ObjectStamp : object + ":" + object.stamp(); |
74 if (assumptions != null) { | 74 if (assumptions != null) { |
75 AssumptionResult<ResolvedJavaType> uniqueConcreteType = type.findUniqueConcreteSubtype(); | 75 AssumptionResult<ResolvedJavaType> leafConcreteSubtype = type.findLeafConcreteSubtype(); |
76 if (uniqueConcreteType != null && !uniqueConcreteType.getResult().equals(type)) { | 76 if (leafConcreteSubtype != null && !leafConcreteSubtype.getResult().equals(type)) { |
77 assumptions.record(uniqueConcreteType); | 77 assumptions.record(leafConcreteSubtype); |
78 type = uniqueConcreteType.getResult(); | 78 type = leafConcreteSubtype.getResult(); |
79 } | 79 } |
80 } | 80 } |
81 return new CheckCastNode(type, object, profile, forStoreCheck); | 81 return new CheckCastNode(type, object, profile, forStoreCheck); |
82 } | 82 } |
83 | 83 |
168 return synonym; | 168 return synonym; |
169 } | 169 } |
170 | 170 |
171 Assumptions assumptions = graph().getAssumptions(); | 171 Assumptions assumptions = graph().getAssumptions(); |
172 if (assumptions != null) { | 172 if (assumptions != null) { |
173 AssumptionResult<ResolvedJavaType> exactTypeResult = type.findUniqueConcreteSubtype(); | 173 AssumptionResult<ResolvedJavaType> leafConcreteSubtype = type.findLeafConcreteSubtype(); |
174 if (exactTypeResult != null && !exactTypeResult.getResult().equals(type)) { | 174 if (leafConcreteSubtype != null && !leafConcreteSubtype.getResult().equals(type)) { |
175 // Propagate more precise type information to usages of the checkcast. | 175 // Propagate more precise type information to usages of the checkcast. |
176 assumptions.record(exactTypeResult); | 176 assumptions.record(leafConcreteSubtype); |
177 return new CheckCastNode(exactTypeResult.getResult(), object, profile, forStoreCheck); | 177 return new CheckCastNode(leafConcreteSubtype.getResult(), object, profile, forStoreCheck); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 return this; | 181 return this; |
182 } | 182 } |