comparison jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java @ 23338:a3471785190d

findLeafConcreteSubtype should handle arrays of leaf concrete subtype
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Fri, 25 Mar 2016 14:08:23 -0700
parents 90da61843aa4
children 22c3bdf28fff
comparison
equal deleted inserted replaced
23337:62804a7d3877 23338:a3471785190d
169 169
170 @Override 170 @Override
171 public AssumptionResult<ResolvedJavaType> findLeafConcreteSubtype() { 171 public AssumptionResult<ResolvedJavaType> findLeafConcreteSubtype() {
172 HotSpotVMConfig config = config(); 172 HotSpotVMConfig config = config();
173 if (isArray()) { 173 if (isArray()) {
174 return getElementalType().isLeaf() ? new AssumptionResult<>(this) : null; 174 ResolvedJavaType elementalType = getElementalType();
175 AssumptionResult<ResolvedJavaType> elementType = elementalType.findLeafConcreteSubtype();
176 if (elementType != null && elementType.getResult().equals(elementalType)) {
177 /*
178 * If the elementType is leaf then the array is leaf under the same assumptions but
179 * only if the element type is exactly the leaf type. The element type can be
180 * abstract even if there is only one implementor of the abstract type.
181 */
182 AssumptionResult<ResolvedJavaType> result = new AssumptionResult<>(this);
183 result.add(elementType);
184 return result;
185 }
186 return null;
175 } else if (isInterface()) { 187 } else if (isInterface()) {
176 HotSpotResolvedObjectTypeImpl implementor = getSingleImplementor(); 188 HotSpotResolvedObjectTypeImpl implementor = getSingleImplementor();
177 /* 189 /*
178 * If the implementor field contains itself that indicates that the interface has more 190 * If the implementor field contains itself that indicates that the interface has more
179 * than one implementors (see: InstanceKlass::add_implementor). 191 * than one implementors (see: InstanceKlass::add_implementor).