public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType implements HotSpotProxified
JavaType for primitive HotSpot types.| Modifier and Type | Field and Description |
|---|---|
private Kind |
kind |
ANNOTATION, BRIDGE, ENUM, MANDATED, SYNTHETIC, VARARGS| Constructor and Description |
|---|
HotSpotResolvedPrimitiveType(Kind kind)
Creates the JVMCI mirror for a primitive
Kind. |
| Modifier and Type | Method and Description |
|---|---|
ResolvedJavaType |
asExactType()
Returns this type if it is an exact type otherwise returns null.
|
ResolvedJavaField |
findInstanceFieldWithOffset(long offset,
Kind expectedType)
Returns the instance field of this class (or one of its super classes) at the given offset,
or
null if there is no such field. |
Assumptions.AssumptionResult<ResolvedJavaType> |
findLeafConcreteSubtype()
Attempts to get a leaf concrete subclass of this type.
|
ResolvedJavaType |
findLeastCommonAncestor(ResolvedJavaType otherType)
Walks the class hierarchy upwards and returns the least common class that is a superclass of
both the current and the given type.
|
Assumptions.AssumptionResult<ResolvedJavaMethod> |
findUniqueConcreteMethod(ResolvedJavaMethod method)
Given a
ResolvedJavaMethod A, returns a concrete ResolvedJavaMethod B that is
the only possible unique target for a virtual call on A(). |
<T extends Annotation> |
getAnnotation(Class<T> annotationClass)
Returns the annotation for the specified type of this class, if such an annotation is
present.
|
HotSpotResolvedObjectTypeImpl |
getArrayClass()
Gets the array class type representing an array with elements of this type.
|
URL |
getClassFilePath()
Returns the class file path - if available - of this type, or
null. |
ResolvedJavaMethod |
getClassInitializer()
Returns the
<clinit> method for this class if there is one. |
ResolvedJavaType |
getComponentType()
For array types, gets the type of the components, or
null if this is not an array
type. |
ResolvedJavaMethod[] |
getDeclaredConstructors()
Returns an array reflecting all the constructors declared by this type.
|
ResolvedJavaMethod[] |
getDeclaredMethods()
Returns an array reflecting all the methods declared by this type.
|
ResolvedJavaType |
getElementalType()
Gets the elemental type for this given type.
|
ResolvedJavaType |
getEnclosingType()
Returns the enclosing type of this type, if it exists, or
null. |
ResolvedJavaField[] |
getInstanceFields(boolean includeSuperclasses)
Returns the instance fields of this class, including
internal fields.
|
ResolvedJavaType[] |
getInterfaces()
Gets the interfaces implemented or extended by this type.
|
JavaConstant |
getJavaClass()
Gets the runtime representation of the Java class object of this type.
|
Kind |
getKind()
Gets the kind of this type.
|
int |
getModifiers()
Returns the Java Virtual Machine modifiers for this element.
|
JavaConstant |
getObjectHub()
Gets the runtime representation of the "hub" of this type--that is, the closest part of the
type representation which is typically stored in the object header.
|
ResolvedJavaType |
getSingleImplementor()
Gets the single implementor of this type.
|
String |
getSourceFileName()
Returns name of source file of this type.
|
ResolvedJavaField[] |
getStaticFields()
Returns the static fields of this class, including
internal fields.
|
ResolvedJavaType |
getSuperclass()
Gets the super class of this type.
|
Assumptions.AssumptionResult<Boolean> |
hasFinalizableSubclass()
Checks whether this type has any finalizable subclasses so far.
|
boolean |
hasFinalizer()
Checks whether this type has a finalizer method.
|
void |
initialize()
Initializes this type.
|
boolean |
isArray()
Checks whether this type is an array class.
|
boolean |
isAssignableFrom(ResolvedJavaType other)
Determines if this type is either the same as, or is a superclass or superinterface of, the
type represented by the specified parameter.
|
boolean |
isInitialized()
Checks whether this type is initialized.
|
boolean |
isInstance(JavaConstant obj)
Checks whether the specified object is an instance of this type.
|
boolean |
isInstanceClass()
Checks whether this type is an instance class.
|
boolean |
isInterface()
Checks whether this type is an interface.
|
boolean |
isJavaLangObject()
Returns true if this type is exactly the type
Object. |
boolean |
isLinked()
Checks whether this type is linked and verified.
|
boolean |
isLocal()
Returns
true if the type is a local type. |
boolean |
isMember()
Returns
true if the type is a member type. |
boolean |
isPrimitive()
Checks whether this type is primitive.
|
boolean |
isTrustedInterfaceType()
Returns true if this type represents an interface and it should be trusted even in places
where the JVM verifier would not give any guarantees other than
Object. |
Class<?> |
mirror() |
ResolvedJavaType |
resolve(ResolvedJavaType accessingClass)
Resolves this type to a
ResolvedJavaType. |
ResolvedJavaMethod |
resolveConcreteMethod(ResolvedJavaMethod method,
ResolvedJavaType callerType)
Resolves the method implementation for virtual dispatches on objects of this dynamic type.
|
ResolvedJavaMethod |
resolveMethod(ResolvedJavaMethod method,
ResolvedJavaType callerType)
Resolves the method implementation for virtual dispatches on objects of this dynamic type.
|
String |
toString() |
equals, fromClass, hashCodegetNameclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindMethod, isLeafgetName, getUnqualifiedName, toClassName, toJavaName, toJavaNameisAbstract, isConcrete, isFinalFlagSet, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isTransient, isVolatile, jvmClassModifiers, jvmFieldModifiers, jvmMethodModifierspublic HotSpotResolvedPrimitiveType(Kind kind)
Kind.
NOTE: Creating an instance of this class does not install the mirror for the
Class type. Use HotSpotResolvedJavaType.fromClass(Class) instead.
kind - the Kind to create the mirror forpublic int getModifiers()
ResolvedJavaTypeResolvedJavaType) can not be private or protected.
Only the flags specified in the JVM specification will be included in the returned mask. This
method is identical to Class.getModifiers() in terms of the value return for this
type.
getModifiers in interface ModifiersProvidergetModifiers in interface ResolvedJavaTypepublic HotSpotResolvedObjectTypeImpl getArrayClass()
JavaTypegetArrayClass in interface JavaTypegetArrayClass in interface ResolvedJavaTypepublic ResolvedJavaType getElementalType()
JavaTypeint[][][] is
int. A non-array type is its own elemental type.getElementalType in interface JavaTypegetElementalType in interface ResolvedJavaTypepublic ResolvedJavaType getComponentType()
JavaTypenull if this is not an array
type. This method is analogous to Class.getComponentType().getComponentType in interface JavaTypegetComponentType in interface ResolvedJavaTypepublic ResolvedJavaType asExactType()
ResolvedJavaTypeasExactType in interface ResolvedJavaTypenull otherwisepublic ResolvedJavaType getSuperclass()
ResolvedJavaTypeObject class,
an interface, a primitive type, or void, then null is returned. If this object represents an
array class then the type object representing the Object class is returned.getSuperclass in interface ResolvedJavaTypepublic ResolvedJavaType[] getInterfaces()
ResolvedJavaTypeClass.getInterfaces() and as such, only returns the interfaces directly implemented
or extended by this type.getInterfaces in interface ResolvedJavaTypepublic ResolvedJavaType getSingleImplementor()
ResolvedJavaTypeIf the compiler uses the result of this method for its compilation, the usage must be guarded because the verifier can not guarantee that the assigned type really implements this interface. Additionally, class loading can invalidate the result of this method.
getSingleImplementor in interface ResolvedJavaTypenull if there is no implementor, the implementor if there is only one, or
this if there are more than one.public ResolvedJavaType findLeastCommonAncestor(ResolvedJavaType otherType)
ResolvedJavaTypefindLeastCommonAncestor in interface ResolvedJavaTypenull if primitive types are involved.public JavaConstant getObjectHub()
ResolvedJavaTypegetObjectHub in interface ResolvedJavaTypepublic JavaConstant getJavaClass()
ResolvedJavaTypegetJavaClass in interface ResolvedJavaTypepublic Assumptions.AssumptionResult<Boolean> hasFinalizableSubclass()
ResolvedJavaTypehasFinalizableSubclass in interface ResolvedJavaTypetrue if this class has any subclasses with finalizerspublic boolean hasFinalizer()
ResolvedJavaTypehasFinalizer in interface ResolvedJavaTypetrue if this class has a finalizerpublic boolean isArray()
ResolvedJavaTypeisArray in interface ResolvedJavaTypetrue if this type is an array classpublic boolean isPrimitive()
ResolvedJavaTypeisPrimitive in interface ResolvedJavaTypetrue if this type is primitivepublic boolean isInitialized()
ResolvedJavaTypelinked and that the static initializer has run.isInitialized in interface ResolvedJavaTypetrue if this type is initializedpublic boolean isLinked()
ResolvedJavaTypeinitialized type is always linked.isLinked in interface ResolvedJavaTypetrue if this type is linkedpublic boolean isInstance(JavaConstant obj)
ResolvedJavaTypeisInstance in interface ResolvedJavaTypeobj - the object to testtrue if the object is an instance of this typepublic boolean isInstanceClass()
ResolvedJavaTypeisInstanceClass in interface ResolvedJavaTypetrue if this type is an instance classpublic boolean isInterface()
ResolvedJavaTypeisInterface in interface ModifiersProviderisInterface in interface ResolvedJavaTypetrue if this type is an interfaceModifier.isInterface(int)public boolean isAssignableFrom(ResolvedJavaType other)
ResolvedJavaTypeClass.isAssignableFrom(Class) in terms of the value return for this type.isAssignableFrom in interface ResolvedJavaTypepublic Kind getKind()
JavaTypepublic boolean isJavaLangObject()
ResolvedJavaTypeObject.isJavaLangObject in interface ResolvedJavaTypepublic ResolvedJavaMethod resolveConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType callerType)
ResolvedJavaTypeResolvedJavaType.findUniqueConcreteMethod(ResolvedJavaMethod).resolveConcreteMethod in interface ResolvedJavaTypemethod - the method to select the implementation ofcallerType - the caller or context type used to perform access checksnull if there is no
concrete implementation of method in this type or any of its superclassespublic ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType)
ResolvedJavaTyperesolveMethod in interface ResolvedJavaTypemethod - the method to select the implementation ofcallerType - the caller or context type used to perform access checksnull if it can not be
linkedpublic Assumptions.AssumptionResult<ResolvedJavaType> findLeafConcreteSubtype()
ResolvedJavaType
For an array type A, the leaf concrete subclass is A if the
elemental type of A is final (which includes primitive
types). Otherwise null is returned for A.
For a non-array type T, the result is the leaf concrete type in the current hierarchy of T.
A runtime may decide not to manage or walk a large hierarchy and so the result is conservative. That is, a non-null result is guaranteed to be the leaf concrete class in T's hierarchy at the current point in time but a null result does not necessarily imply that there is no leaf concrete class in T's hierarchy.
If the compiler uses the result of this method for its compilation, it must register the
Assumptions.AssumptionResult in its Assumptions because dynamic class loading can
invalidate the result of this method.
findLeafConcreteSubtype in interface ResolvedJavaTypeAssumptions.AssumptionResult containing the leaf concrete subclass for this type as
described abovepublic Assumptions.AssumptionResult<ResolvedJavaMethod> findUniqueConcreteMethod(ResolvedJavaMethod method)
ResolvedJavaTypeResolvedJavaMethod A, returns a concrete ResolvedJavaMethod B that is
the only possible unique target for a virtual call on A(). Returns null if either no
such concrete method or more than one such method exists. Returns the method A if A is a
concrete method that is not overridden.
If the compiler uses the result of this method for its compilation, it must register an assumption because dynamic class loading can invalidate the result of this method.
findUniqueConcreteMethod in interface ResolvedJavaTypemethod - the method A for which a unique concrete target is searchednull if no such target exists or assumptions
are not supported by this runtimepublic ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses)
ResolvedJavaTypegetInstanceFields in interface ResolvedJavaTypeincludeSuperclasses - if true, then instance fields for the complete hierarchy of this
type are included in the resultpublic ResolvedJavaField[] getStaticFields()
ResolvedJavaTypegetStaticFields in interface ResolvedJavaTypepublic <T extends Annotation> T getAnnotation(Class<T> annotationClass)
ResolvedJavaTypegetAnnotation in interface ResolvedJavaTypeannotationClass - the Class object corresponding to the annotation typenullpublic ResolvedJavaType resolve(ResolvedJavaType accessingClass)
JavaTypeResolvedJavaType.public void initialize()
ResolvedJavaTypeinitialize in interface ResolvedJavaTypepublic ResolvedJavaField findInstanceFieldWithOffset(long offset, Kind expectedType)
ResolvedJavaTypenull if there is no such field.findInstanceFieldWithOffset in interface ResolvedJavaTypeoffset - the offset of the field to look fornull if there is no such field.public String getSourceFileName()
ResolvedJavaTypegetSourceFileName in interface ResolvedJavaTypepublic Class<?> mirror()
mirror in class HotSpotResolvedJavaTypepublic URL getClassFilePath()
ResolvedJavaTypenull.getClassFilePath in interface ResolvedJavaTypepublic boolean isLocal()
ResolvedJavaTypetrue if the type is a local type.isLocal in interface ResolvedJavaTypepublic boolean isMember()
ResolvedJavaTypetrue if the type is a member type.isMember in interface ResolvedJavaTypepublic ResolvedJavaType getEnclosingType()
ResolvedJavaTypenull.getEnclosingType in interface ResolvedJavaTypepublic ResolvedJavaMethod[] getDeclaredConstructors()
ResolvedJavaTypeClass.getDeclaredConstructors() in terms of returned constructors.getDeclaredConstructors in interface ResolvedJavaTypepublic ResolvedJavaMethod[] getDeclaredMethods()
ResolvedJavaTypeClass.getDeclaredMethods() in terms of returned methods.getDeclaredMethods in interface ResolvedJavaTypepublic ResolvedJavaMethod getClassInitializer()
ResolvedJavaType<clinit> method for this class if there is one.getClassInitializer in interface ResolvedJavaTypepublic boolean isTrustedInterfaceType()
ResolvedJavaTypeObject.isTrustedInterfaceType in interface ResolvedJavaType