public abstract class AnalysisType extends AnalysisElement implements WrappedJavaType, OriginalClassProvider, Comparable<AnalysisType>
| Modifier and Type | Class and Description |
|---|---|
static interface |
AnalysisType.InstanceFieldsInterceptor |
static class |
AnalysisType.UsageKind |
AnalysisElement.ElementNotification, AnalysisElement.MethodOverrideReachableNotification, AnalysisElement.ReachabilityReason, AnalysisElement.ReachabilityTraceBuilder, AnalysisElement.SubtypeReachableNotification| Modifier and Type | Field and Description |
|---|---|
TypeState |
assignableTypesNonNullState |
TypeState |
assignableTypesState
Stores the list of all assignable types for each analysis type.
|
AllInstantiatedTypeFlow |
instantiatedTypes
Type flows containing all the instantiated sub-types.
|
AllInstantiatedTypeFlow |
instantiatedTypesNonNull |
protected AnalysisUniverse |
universe |
| Constructor and Description |
|---|
AnalysisType(AnalysisUniverse universe,
ResolvedJavaType javaType,
JavaKind storageKind,
AnalysisType objectType,
AnalysisType cloneableType) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAssignableType(BigBang bb,
TypeState typeState) |
void |
addInstanceFieldsInterceptor(AnalysisType.InstanceFieldsInterceptor interceptor) |
void |
cleanupAfterAnalysis() |
void |
clearInstanceFieldsCache() |
int |
compareTo(AnalysisType other) |
boolean |
declaresDefaultMethods() |
void |
ensureOnTypeReachableTaskDone() |
boolean |
equals(Object obj) |
ResolvedJavaField |
findInstanceFieldWithOffset(long offset,
JavaKind expectedKind) |
<any> |
findLeafConcreteSubtype() |
AnalysisType |
findLeastCommonAncestor(ResolvedJavaType otherType) |
AnalysisMethod |
findMethod(String name,
Signature signature) |
<any> |
findUniqueConcreteMethod(ResolvedJavaMethod method) |
void |
forAllSuperTypes(Consumer<AnalysisType> superTypeConsumer)
Iterates all super types for this type, where a super type is defined as any type that is
assignable from this type, feeding each of them to the consumer.
|
protected void |
forAllSuperTypes(Consumer<AnalysisType> superTypeConsumer,
boolean includeThisType) |
Object |
getAllocatedReason() |
Set<AnalysisType> |
getAllSubtypes()
Collects and returns *all* subtypes of this type, not only the immediate subtypes, including
this type itself, regardless of reachability status.
|
AnalysisType |
getArrayClass() |
AnalysisType |
getArrayClass(int dim) |
int |
getArrayDimension() |
TypeState |
getAssignableTypes(boolean includeNull)
Returns the assignable types.
|
AnalysisObject |
getCachedConstantObject(PointsToAnalysis bb,
JavaConstant constant,
Function<JavaConstant,AnalysisObject> constantTransformer) |
AnalysisMethod |
getClassInitializer() |
AnalysisType |
getComponentType() |
AnalysisObject |
getContextInsensitiveAnalysisObject() |
ResolvedJavaMethod[] |
getDeclaredConstructors() |
AnalysisMethod[] |
getDeclaredConstructors(boolean forceLink) |
ResolvedJavaMethod[] |
getDeclaredMethods() |
AnalysisMethod[] |
getDeclaredMethods(boolean forceLink) |
AnalysisType |
getElementalType() |
AnalysisType |
getEnclosingType() |
ResolvedJavaType |
getHostClass() |
int |
getId() |
Object |
getInHeapReason() |
AnalysisFuture<Void> |
getInitializeMetaDataTask() |
ResolvedJavaField[] |
getInstanceFields(boolean includeSuperclasses)
Note that although this returns a ResolvedJavaField[], all instance fields are of type
AnalysisField and can be casted to AnalysisField without problem.
|
AnalysisType[] |
getInterfaces() |
Class<?> |
getJavaClass() |
JavaKind |
getJavaKind() |
int |
getModifiers() |
String |
getName() |
TypeData |
getOrComputeData() |
Set<AnalysisElement.MethodOverrideReachableNotification> |
getOverrideReachabilityNotifications(AnalysisMethod method) |
boolean |
getReachabilityListenerNotified() |
Object |
getReachableReason() |
ResolvedJavaType |
getSingleImplementor() |
String |
getSourceFileName() |
ResolvedJavaField[] |
getStaticFields()
Note that although this returns a ResolvedJavaField[], all instance fields are of type
AnalysisField and can be casted to AnalysisField without problem.
|
JavaKind |
getStorageKind()
The kind of the field in memory (in contrast to
AnalysisType.getJavaKind(), which is the kind of
the field on the Java type system level). |
Set<AnalysisType> |
getSubTypes()
Get the immediate subtypes, including this type itself.
|
AnalysisType |
getSuperclass() |
AllInstantiatedTypeFlow |
getTypeFlow(BigBang bb,
boolean includeNull) |
AnalysisObject |
getUniqueConstantObject() |
AnalysisUniverse |
getUniverse() |
ResolvedJavaType |
getWrapped() |
ResolvedJavaType |
getWrappedWithResolve() |
boolean |
hasDefaultMethods() |
<any> |
hasFinalizableSubclass() |
boolean |
hasFinalizer() |
int |
hashCode() |
boolean |
hasSubTypes() |
void |
initialize() |
boolean |
isAllocated() |
boolean |
isAnnotation() |
boolean |
isAnySubtypeInstantiated()
Returns true if this type or any of its subtypes was marked as instantiated.
|
boolean |
isArray() |
boolean |
isAssignableFrom(ResolvedJavaType other) |
boolean |
isCloneableWithAllocation() |
boolean |
isEnum() |
boolean |
isInHeap() |
boolean |
isInitialized() |
boolean |
isInstance(JavaConstant obj) |
boolean |
isInstanceClass() |
boolean |
isInstantiated() |
boolean |
isInterface() |
boolean |
isJavaLangObject() |
boolean |
isLinked() |
boolean |
isLocal() |
boolean |
isMember() |
boolean |
isPrimitive() |
boolean |
isReachable() |
boolean |
isWordType()
Returns true if this type is part of the word type hierarchy, i.e, implements
WordBase. |
void |
link() |
protected void |
notifyInstantiatedCallbacks() |
protected void |
onInstantiated(AnalysisType.UsageKind usage) |
protected void |
onReachable() |
boolean |
registerAsAllocated(Object reason) |
void |
registerAsAssignable(BigBang bb)
Register the type as assignable with all its super types.
|
boolean |
registerAsInHeap(Object reason) |
boolean |
registerAsReachable(Object reason) |
void |
registerInstantiatedCallback(Consumer<org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess> callback) |
void |
registerOverrideReachabilityNotification(AnalysisMethod declaredMethod,
AnalysisElement.MethodOverrideReachableNotification notification) |
void |
registerSubtypeReachabilityNotification(AnalysisElement.SubtypeReachableNotification notification) |
void |
registerUnsafeAccessedField(AnalysisField field,
com.oracle.svm.util.UnsafePartitionKind partitionKind)
Add the field to the collection of unsafe accessed fields declared by this type.
|
void |
registerUnsafeFieldsRecomputed()
Says that all instance fields which hold offsets to unsafe field accesses are already
recomputed with the correct values from the substrate object layout and therefore don't need
a RecomputeFieldValue annotation.
|
AnalysisType |
resolve(ResolvedJavaType accessingClass) |
AnalysisMethod |
resolveConcreteMethod(ResolvedJavaMethod method)
Wrapper for resolveConcreteMethod() without the callerType parameter.
|
AnalysisMethod |
resolveConcreteMethod(ResolvedJavaMethod method,
ResolvedJavaType callerType) |
AnalysisMethod |
resolveMethod(ResolvedJavaMethod method,
ResolvedJavaType callerType) |
void |
setReachabilityListenerNotified(boolean reachabilityListenerNotified) |
String |
toJavaName() |
String |
toJavaName(boolean qualified) |
String |
toString() |
List<AnalysisField> |
unsafeAccessedFields() |
List<AnalysisField> |
unsafeAccessedFields(com.oracle.svm.util.UnsafePartitionKind partitionKind) |
boolean |
unsafeFieldsRecomputed()
Returns true if all instance fields which hold offsets to unsafe field accesses are already
recomputed with the correct values from the substrate object layout.
|
static boolean |
verifyAssignableTypes(BigBang bb) |
execute, getAnnotation, getAnnotations, getDeclaredAnnotation, getDeclaredAnnotations, isAnnotationPresent, isTriggered, notifyReachabilityCallback, notifyReachabilityCallbacks, registerReachabilityNotificationgetJavaClassgetAnnotationsByType, getDeclaredAnnotationsByTypeprotected final AnalysisUniverse universe
public TypeState assignableTypesState
public TypeState assignableTypesNonNullState
public AllInstantiatedTypeFlow instantiatedTypes
public AllInstantiatedTypeFlow instantiatedTypesNonNull
public AnalysisType(AnalysisUniverse universe, ResolvedJavaType javaType, JavaKind storageKind, AnalysisType objectType, AnalysisType cloneableType)
public AnalysisType getArrayClass(int dim)
public int getArrayDimension()
public void cleanupAfterAnalysis()
public int getId()
public AnalysisObject getContextInsensitiveAnalysisObject()
public AnalysisObject getUniqueConstantObject()
public AnalysisObject getCachedConstantObject(PointsToAnalysis bb, JavaConstant constant, Function<JavaConstant,AnalysisObject> constantTransformer)
public AllInstantiatedTypeFlow getTypeFlow(BigBang bb, boolean includeNull)
public TypeState getAssignableTypes(boolean includeNull)
public static boolean verifyAssignableTypes(BigBang bb)
public boolean registerAsInHeap(Object reason)
reason - the BytecodePosition where this type is marked as in-heap, or a
ObjectScanner.ScanReason, or a String
describing why this type was manually marked as in-heappublic boolean registerAsAllocated(Object reason)
reason - the BytecodePosition where this type is marked as allocated, or a
ObjectScanner.ScanReason, or a String
describing why this type was manually marked as allocatedprotected void onInstantiated(AnalysisType.UsageKind usage)
public void registerAsAssignable(BigBang bb)
public boolean registerAsReachable(Object reason)
protected void onReachable()
onReachable in class AnalysisElementpublic void registerSubtypeReachabilityNotification(AnalysisElement.SubtypeReachableNotification notification)
public void registerOverrideReachabilityNotification(AnalysisMethod declaredMethod, AnalysisElement.MethodOverrideReachableNotification notification)
public Set<AnalysisElement.MethodOverrideReachableNotification> getOverrideReachabilityNotifications(AnalysisMethod method)
public void registerInstantiatedCallback(Consumer<org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess> callback)
protected void notifyInstantiatedCallbacks()
public void forAllSuperTypes(Consumer<AnalysisType> superTypeConsumer)
protected void forAllSuperTypes(Consumer<AnalysisType> superTypeConsumer, boolean includeThisType)
public TypeData getOrComputeData()
public void ensureOnTypeReachableTaskDone()
public AnalysisFuture<Void> getInitializeMetaDataTask()
public boolean getReachabilityListenerNotified()
public void setReachabilityListenerNotified(boolean reachabilityListenerNotified)
public void registerUnsafeFieldsRecomputed()
public void registerUnsafeAccessedField(AnalysisField field, com.oracle.svm.util.UnsafePartitionKind partitionKind)
public List<AnalysisField> unsafeAccessedFields()
public List<AnalysisField> unsafeAccessedFields(com.oracle.svm.util.UnsafePartitionKind partitionKind)
public boolean isInstantiated()
public boolean isAnySubtypeInstantiated()
public boolean unsafeFieldsRecomputed()
public boolean isReachable()
isReachable in class AnalysisElementpublic Object getReachableReason()
public final JavaKind getStorageKind()
AnalysisType.getJavaKind(), which is the kind of
the field on the Java type system level). For example word types have a
AnalysisType.getJavaKind() of JavaKind#Object, but a primitive AnalysisType.storageKind.public boolean isWordType()
WordBase.public ResolvedJavaType getWrapped()
getWrapped in interface WrappedElementgetWrapped in interface WrappedJavaTypegetWrapped in class AnalysisElementpublic ResolvedJavaType getWrappedWithResolve()
public Class<?> getJavaClass()
getJavaClass in interface OriginalClassProviderpublic final String getName()
public String toJavaName()
public String toJavaName(boolean qualified)
public final JavaKind getJavaKind()
public final AnalysisType resolve(ResolvedJavaType accessingClass)
public final boolean hasFinalizer()
public final <any> hasFinalizableSubclass()
public final boolean isInitialized()
public void initialize()
public final AnalysisType getArrayClass()
public boolean isInterface()
public boolean isEnum()
public boolean isInstanceClass()
public boolean isArray()
public boolean isJavaLangObject()
public boolean isPrimitive()
public int getModifiers()
public boolean isAssignableFrom(ResolvedJavaType other)
public boolean isInstance(JavaConstant obj)
public AnalysisType getSuperclass()
public AnalysisType[] getInterfaces()
public ResolvedJavaType getSingleImplementor()
public Set<AnalysisType> getSubTypes()
public Set<AnalysisType> getAllSubtypes()
AnalysisType.getSubTypes().
Since the subtypes are updated continuously as the universe is expanded this method may
return different results on each call, until the analysis universe reaches a stable state.public AnalysisType findLeastCommonAncestor(ResolvedJavaType otherType)
public <any> findLeafConcreteSubtype()
public AnalysisType getComponentType()
public AnalysisType getElementalType()
public boolean hasSubTypes()
public AnalysisMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType)
public AnalysisMethod resolveConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType callerType)
public AnalysisMethod resolveConcreteMethod(ResolvedJavaMethod method)
public <any> findUniqueConcreteMethod(ResolvedJavaMethod method)
public ResolvedJavaField findInstanceFieldWithOffset(long offset,
JavaKind expectedKind)
public void clearInstanceFieldsCache()
public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses)
public ResolvedJavaField[] getStaticFields()
public String getSourceFileName()
public boolean isLocal()
public boolean isMember()
public AnalysisType getEnclosingType()
public ResolvedJavaMethod[] getDeclaredMethods()
public AnalysisMethod[] getDeclaredMethods(boolean forceLink)
public ResolvedJavaMethod[] getDeclaredConstructors()
public AnalysisMethod[] getDeclaredConstructors(boolean forceLink)
public AnalysisMethod findMethod(String name, Signature signature)
public AnalysisMethod getClassInitializer()
public boolean isLinked()
public boolean isInHeap()
public Object getInHeapReason()
public boolean isAllocated()
public Object getAllocatedReason()
public void link()
public boolean hasDefaultMethods()
public boolean declaresDefaultMethods()
public boolean isCloneableWithAllocation()
public ResolvedJavaType getHostClass()
public AnalysisUniverse getUniverse()
getUniverse in class AnalysisElementpublic int compareTo(AnalysisType other)
compareTo in interface Comparable<AnalysisType>public boolean isAnnotation()
public void addInstanceFieldsInterceptor(AnalysisType.InstanceFieldsInterceptor interceptor)