728 public Class<?> mirror() { 729 return javaClass; 730 } 731 732 @Override 733 public String getSourceFileName() { 734 HotSpotVMConfig config = config(); 735 final int sourceFileNameIndex = UNSAFE.getChar(getMetaspaceKlass() + config.instanceKlassSourceFileNameIndexOffset); 736 if (sourceFileNameIndex == 0) { 737 return null; 738 } 739 return getConstantPool().lookupUtf8(sourceFileNameIndex); 740 } 741 742 @Override 743 public Annotation[] getAnnotations() { 744 return mirror().getAnnotations(); 745 } 746 747 @Override 748 public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { 749 return mirror().getAnnotation(annotationClass); 750 } 751 752 /** 753 * Performs a fast-path check that this type is resolved in the context of a given accessing 754 * class. A negative result does not mean this type is not resolved with respect to 755 * {@code accessingClass}. That can only be determined by 756 * {@linkplain HotSpotJVMCIRuntime#lookupType(String, HotSpotResolvedObjectType, boolean) 757 * re-resolving} the type. 758 */ 759 public boolean isDefinitelyResolvedWithRespectTo(ResolvedJavaType accessingClass) { 760 assert accessingClass != null; 761 ResolvedJavaType elementType = getElementalType(); 762 if (elementType.isPrimitive()) { 763 // Primitive type resolution is context free. 764 return true; 765 } 766 if (elementType.getName().startsWith("Ljava/")) { 767 // Classes in a java.* package can only be defined by the | 728 public Class<?> mirror() { 729 return javaClass; 730 } 731 732 @Override 733 public String getSourceFileName() { 734 HotSpotVMConfig config = config(); 735 final int sourceFileNameIndex = UNSAFE.getChar(getMetaspaceKlass() + config.instanceKlassSourceFileNameIndexOffset); 736 if (sourceFileNameIndex == 0) { 737 return null; 738 } 739 return getConstantPool().lookupUtf8(sourceFileNameIndex); 740 } 741 742 @Override 743 public Annotation[] getAnnotations() { 744 return mirror().getAnnotations(); 745 } 746 747 @Override 748 public Annotation[] getDeclaredAnnotations() { 749 return mirror().getDeclaredAnnotations(); 750 } 751 752 @Override 753 public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { 754 return mirror().getAnnotation(annotationClass); 755 } 756 757 /** 758 * Performs a fast-path check that this type is resolved in the context of a given accessing 759 * class. A negative result does not mean this type is not resolved with respect to 760 * {@code accessingClass}. That can only be determined by 761 * {@linkplain HotSpotJVMCIRuntime#lookupType(String, HotSpotResolvedObjectType, boolean) 762 * re-resolving} the type. 763 */ 764 public boolean isDefinitelyResolvedWithRespectTo(ResolvedJavaType accessingClass) { 765 assert accessingClass != null; 766 ResolvedJavaType elementType = getElementalType(); 767 if (elementType.isPrimitive()) { 768 // Primitive type resolution is context free. 769 return true; 770 } 771 if (elementType.getName().startsWith("Ljava/")) { 772 // Classes in a java.* package can only be defined by the |