Top Description Inners Fields Constructors Methods
jdk.vm.ci.hotspot

pack-priv final Class HotSpotResolvedObjectTypeImpl

extends HotSpotResolvedJavaType
implements HotSpotResolvedObjectType, MetaspaceObject
Class Inheritance
All Implemented Interfaces
jdk.vm.ci.hotspot.MetaspaceObject, jdk.vm.ci.hotspot.HotSpotResolvedObjectType, jdk.vm.ci.meta.ResolvedJavaType, jdk.vm.ci.meta.Annotated, java.lang.reflect.AnnotatedElement, jdk.vm.ci.meta.ModifiersProvider, jdk.vm.ci.meta.JavaType
Static Imports
java.util.Objects.requireNonNull, jdk.vm.ci.hotspot.CompilerToVM.compilerToVM, .HotSpotConstantPool.isSignaturePolymorphicHolder, .HotSpotJVMCIRuntime.runtime, .HotSpotModifiers.jvmClassModifiers, .HotSpotVMConfig.config, .UnsafeAccess.UNSAFE

Implementation of JavaType for resolved non-primitive HotSpot classes. This class is not an MetaspaceHandleObject because it doesn't have to be scanned for GC. It's liveness is maintained by a reference to the Class instance.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
HotSpotResolvedObjectTypeImpl.FieldInfo

This class represents the field information for one field contained in the fields array of an InstanceKlass.

pack-priv static class

Field Summary

Modifier and TypeField and Description
private HotSpotResolvedJavaType
componentType

Lazily initialized cache for getComponentType().

private HotSpotConstantPool
private HotSpotResolvedObjectTypeImpl.FieldInfo[]
fieldInfo

Lazily initialized cache for FieldInfo.

private static final HotSpotResolvedObjectTypeImpl.SortByOffset
private volatile HotSpotResolvedJavaField[]
private volatile HotSpotResolvedObjectTypeImpl[]
private final long
klassPointer

The Klass* of this type.

private static final int
private HotSpotResolvedJavaMethodImpl[]
private HashMap<Long, HotSpotResolvedJavaMethodImpl>
private final JavaConstant
private static final Annotation[]
private static final HotSpotResolvedJavaField[]
pack-priv HashMap<HotSpotResolvedJavaFieldImpl, Field>
private HotSpotResolvedObjectTypeImpl
Inherited from jdk.vm.ci.hotspot.HotSpotResolvedJavaType:
arrayOfType

Constructor Summary

AccessConstructor and Description
pack-priv
HotSpotResolvedObjectTypeImpl(long
the Klass* for the type
klass
,
String name)

Creates the JVMCI mirror for a Class object

Note

Creating an instance of this class does not install the mirror for the Class type.

Method Summary

Modifier and TypeMethod and Description
private Assumptions.AssumptionResult<ResolvedJavaType>
pack-priv HotSpotResolvedJavaField
createField(JavaType type, int offset, int classfileFlags, int internalFlags, int index)

pack-priv synchronized HotSpotResolvedJavaMethod
createMethod(long metaspaceHandle)

public boolean
declaresDefaultMethods()

Overrides default jdk.vm.ci.meta.ResolvedJavaType.declaresDefaultMethods.

Checks whether this type declares defaults methods.

public void
public boolean
equals(Object
the reference object with which to compare.
obj
)

Implements abstract jdk.vm.ci.hotspot.HotSpotResolvedJavaType.equals.

Indicates whether some other object is "equal to" this one.

private static ResolvedJavaField
findFieldWithOffset(long offset, JavaKind expectedEntryKind, ResolvedJavaField[] declaredFields)

public ResolvedJavaField
findInstanceFieldWithOffset(long
the offset of the field to look for
offset
,
JavaKind expectedEntryKind)

Implements jdk.vm.ci.meta.ResolvedJavaType.findInstanceFieldWithOffset.

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.

public Assumptions.AssumptionResult<ResolvedJavaType>
public HotSpotResolvedObjectType
findLeastCommonAncestor(ResolvedJavaType otherType)

Implements jdk.vm.ci.hotspot.HotSpotResolvedObjectType.findLeastCommonAncestor, jdk.vm.ci.meta.ResolvedJavaType.findLeastCommonAncestor.

Walks the class hierarchy upwards and returns the least common class that is a superclass of both the current and the given type.

public ResolvedJavaField
findStaticFieldWithOffset(long offset, JavaKind expectedEntryKind)

public Assumptions.AssumptionResult<ResolvedJavaMethod>
findUniqueConcreteMethod(ResolvedJavaMethod
the method A for which a unique concrete target is searched
method
)

Implements jdk.vm.ci.hotspot.HotSpotResolvedObjectType.findUniqueConcreteMethod, jdk.vm.ci.meta.ResolvedJavaType.findUniqueConcreteMethod.

Given a ResolvedJavaMethod A, returns a concrete ResolvedJavaMethod B that is the only possible unique target for a virtual call on A().

private static HotSpotResolvedObjectTypeImpl

Returns:

the ResolvedJavaType corresponding to javaClass
fromMetaspace
(long
a native pointer to the Klass*
klassPointer
)

Gets the JVMCI mirror from a HotSpot type.

public int
public <T extends Annotation> T
getAnnotation(Class<T>
the Class object corresponding to the annotation type
annotationClass
)

Implements java.lang.reflect.AnnotatedElement.getAnnotation.

Returns this element's annotation for the specified type if such an annotation is present, else null.

public AnnotationData
getAnnotationData(ResolvedJavaType
the type object corresponding to the annotation interface type
annotationType
)

Overrides default jdk.vm.ci.meta.Annotated.getAnnotationData.

Constructs the annotation present on this element of type type.

public List<AnnotationData>
getAnnotationData(ResolvedJavaType
an annotation type
type1
,
ResolvedJavaType
an annotation type
type2
,
ResolvedJavaType...
more annotation types
types
)

Overrides default jdk.vm.ci.meta.Annotated.getAnnotationData.

Constructs the annotations present on this element whose types are in the set composed of type1, type2 and types.

private List<AnnotationData>
public Annotation[]
getAnnotations()

Implements java.lang.reflect.AnnotatedElement.getAnnotations.

Returns annotations that are present on this element.

pack-priv HotSpotResolvedObjectTypeImpl
public ResolvedJavaMethod
public ResolvedJavaType
public HotSpotConstantPool
public Annotation[]
getDeclaredAnnotations()

Implements java.lang.reflect.AnnotatedElement.getDeclaredAnnotations.

Returns annotations that are directly present on this element.

public ResolvedJavaMethod[]
getDeclaredConstructors()

Implements jdk.vm.ci.meta.ResolvedJavaType.getDeclaredConstructors.

Returns an array reflecting all the constructors declared by this type.

public ResolvedJavaMethod[]
getDeclaredConstructors(boolean
if true, forces this type to be linked
forceLink
)

Overrides default jdk.vm.ci.meta.ResolvedJavaType.getDeclaredConstructors.

Returns an array reflecting all the constructors declared by this type.

public ResolvedJavaMethod[]
getDeclaredMethods()

Implements jdk.vm.ci.meta.ResolvedJavaType.getDeclaredMethods.

Returns an array reflecting all the methods declared by this type.

public ResolvedJavaMethod[]
getDeclaredMethods(boolean
if true, forces this type to be linked
forceLink
)

Overrides default jdk.vm.ci.meta.ResolvedJavaType.getDeclaredMethods.

Returns an array reflecting all the methods declared by this type.

public HotSpotResolvedObjectType
private HotSpotResolvedObjectTypeImpl.FieldInfo[]
pack-priv HotSpotResolvedObjectTypeImpl.FieldInfo
getFieldInfo(int index)

private HotSpotResolvedJavaField[]
getFields(boolean
specifies whether to return instance or static fields
retrieveStaticFields
,
HotSpotResolvedJavaField[]
an array to be prepended to the returned result
prepend
)

Gets the instance or static fields of this class.

private int

Returns:

state field value of this type
getInitState
()

Returns the value of the state field InstanceKlass::_init_state of the metaspace klass.

public ResolvedJavaField[]
getInstanceFields(boolean
if true, then instance fields for the complete hierarchy of this type are included in the result
includeSuperclasses
)

Implements jdk.vm.ci.meta.ResolvedJavaType.getInstanceFields.

Returns the instance fields of this class, including internal fields.

public HotSpotResolvedObjectTypeImpl[]
public JavaKind
pack-priv static HotSpotResolvedObjectTypeImpl
pack-priv JavaConstant
pack-priv long
getKlassPointer()

Gets the Klass* for this type.

public long
getMetaspacePointer()

Implements jdk.vm.ci.hotspot.MetaspaceObject.getMetaspacePointer.

Gets the raw pointer to the Metaspace object.

public int
getModifiers()

Implements jdk.vm.ci.meta.ModifiersProvider.getModifiers.

Returns the modifiers for this element.

public HotSpotResolvedObjectTypeImpl
getSingleImplementor()

Implements jdk.vm.ci.meta.ResolvedJavaType.getSingleImplementor.

Gets the single implementor of this type.

public String
getSourceFileName()

Implements jdk.vm.ci.meta.ResolvedJavaType.getSourceFileName.

Returns name of source file of this type.

public ResolvedJavaField[]
getStaticFields()

Implements jdk.vm.ci.meta.ResolvedJavaType.getStaticFields.

Returns the static fields of this class, including internal fields.

private HotSpotResolvedObjectTypeImpl

Returns:

value of the subklass field as metaspace klass pointer
getSubklass
()

Returns the Klass::_subklass field of the underlying metaspace klass for the given type type.

public HotSpotResolvedObjectTypeImpl
public HotSpotResolvedObjectTypeImpl
public int
public boolean
hasDefaultMethods()

Overrides default jdk.vm.ci.meta.ResolvedJavaType.hasDefaultMethods.

Checks whether this type or any of its supertypes or superinterfaces has default methods.

public Assumptions.AssumptionResult<Boolean>
hasFinalizableSubclass()

Implements jdk.vm.ci.meta.ResolvedJavaType.hasFinalizableSubclass.

Checks whether this type has any finalizable subclasses so far.

public boolean
hasFinalizer()

Implements jdk.vm.ci.meta.ResolvedJavaType.hasFinalizer.

Checks whether this type has a finalizer method.

private boolean
public void
initialize()

Implements jdk.vm.ci.meta.ResolvedJavaType.initialize.

Initializes this type.

public int
instanceSize()

Implements jdk.vm.ci.hotspot.HotSpotResolvedObjectType.instanceSize.

Gets the instance size of this type.

public boolean
isArray()

Overrides default jdk.vm.ci.meta.JavaType.isArray.

Checks whether this type is an array class.

public boolean
isAssignableFrom(ResolvedJavaType other)

Implements jdk.vm.ci.meta.ResolvedJavaType.isAssignableFrom.

Determines if this type is either the same as, or is a superclass or superinterface of, the type represented by the specified parameter.

public boolean
isBeingInitialized()

Implements abstract jdk.vm.ci.hotspot.HotSpotResolvedJavaType.isBeingInitialized.

Checks whether this type is currently being initialized.

public boolean
isCloneableWithAllocation()

Implements jdk.vm.ci.meta.ResolvedJavaType.isCloneableWithAllocation.

Returns true if this type is Cloneable and can be safely cloned by creating a normal Java allocation and populating it from the fields returned by getInstanceFields(boolean).

public boolean
isDefinitelyResolvedWithRespectTo(ResolvedJavaType accessingClass)

Implements jdk.vm.ci.hotspot.HotSpotResolvedObjectType.isDefinitelyResolvedWithRespectTo.

Performs a fast-path check that this type is resolved in the context of a given accessing class.

public boolean
isEnum()

Implements jdk.vm.ci.meta.ResolvedJavaType.isEnum.

Checks whether this type is an enum.

public boolean
isInitialized()

Implements jdk.vm.ci.meta.ResolvedJavaType.isInitialized.

Checks whether this type is initialized.

public boolean
isInstance(JavaConstant
the object to test
obj
)

Implements jdk.vm.ci.meta.ResolvedJavaType.isInstance.

Checks whether the specified object is an instance of this type.

public boolean
isInstanceClass()

Implements jdk.vm.ci.meta.ResolvedJavaType.isInstanceClass.

Checks whether this type is an instance class.

public boolean
isInterface()

Implements jdk.vm.ci.meta.ResolvedJavaType.isInterface.

Checks whether this type is an interface.

public boolean
isJavaLangObject()

Overrides default jdk.vm.ci.meta.ResolvedJavaType.isJavaLangObject.

Returns true if this type is exactly the type java.lang.Object.

private boolean

Returns:

true if the type is a leaf class
isLeafClass
()

Returns if type type is a leaf class.

public boolean
isLinked()

Implements jdk.vm.ci.meta.ResolvedJavaType.isLinked.

Checks whether this type is linked and verified.

public boolean
isLocal()

Implements jdk.vm.ci.meta.ResolvedJavaType.isLocal.

Returns true if the type is a local type.

public boolean
isMember()

Implements jdk.vm.ci.meta.ResolvedJavaType.isMember.

Returns true if the type is a member type.

public boolean
public Constant
klass()

Implements jdk.vm.ci.hotspot.HotSpotResolvedObjectType.klass.

Gets the metaspace Klass boxed in a JavaConstant.

public int
public ResolvedJavaType
lookupType(UnresolvedJavaType unresolvedJavaType, boolean resolve)

Overrides default jdk.vm.ci.meta.ResolvedJavaType.lookupType.

Lookup an unresolved type relative to an existing resolved type.

private boolean
mayHaveAnnotations(boolean
if true, expand this query to include superclasses of this type
includingInherited
)

Determines if this type may have annotations.

public long
public ResolvedJavaType
resolve(ResolvedJavaType
the context of resolution (must not be null)
accessingClass
)

Implements jdk.vm.ci.meta.JavaType.resolve.

Resolves this type to a ResolvedJavaType.

public ResolvedJavaField
public ResolvedJavaMethod
resolveMethod(ResolvedJavaMethod
the method to select the implementation of
method
,
ResolvedJavaType
the caller or context type used to perform access checks
callerType
)

Implements jdk.vm.ci.meta.ResolvedJavaType.resolveMethod.

Resolves the method implementation for virtual dispatches on objects of this dynamic type.

public int
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from jdk.vm.ci.hotspot.HotSpotResolvedJavaType:
getArrayClasshashCode