public final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implements HotSpotResolvedObjectType, HotSpotProxified
JavaType
for resolved non-primitive HotSpot classes.Modifier and Type | Class and Description |
---|---|
private class |
HotSpotResolvedObjectTypeImpl.FieldInfo
This class represents the field information for one field contained in the fields array of an
InstanceKlass . |
private static class |
HotSpotResolvedObjectTypeImpl.OffsetComparator |
Modifier and Type | Field and Description |
---|---|
private HotSpotResolvedObjectType |
arrayOfType |
private ConstantPool |
constantPool |
private HashMap<Long,HotSpotResolvedJavaField> |
fieldCache |
private HotSpotResolvedJavaField[] |
instanceFields |
private HotSpotResolvedObjectTypeImpl[] |
interfaces |
private Class<?> |
javaClass
The Java class this type represents.
|
private HashMap<Long,HotSpotResolvedJavaMethod> |
methodCache |
ANNOTATION, BRIDGE, ENUM, MANDATED, SYNTHETIC, VARARGS
Constructor and Description |
---|
HotSpotResolvedObjectTypeImpl(Class<?> javaClass)
Creates the JVMCI mirror for a
Class object. |
equals, fromClass, hashCode
getName
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findMethod, getElementalType, isLeaf
getName, getUnqualifiedName, toClassName, toJavaName, toJavaName
isAbstract, isConcrete, isFinalFlagSet, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isTransient, isVolatile, jvmClassModifiers, jvmFieldModifiers, jvmMethodModifiers
private HashMap<Long,HotSpotResolvedJavaField> fieldCache
private HashMap<Long,HotSpotResolvedJavaMethod> methodCache
private HotSpotResolvedJavaField[] instanceFields
private HotSpotResolvedObjectTypeImpl[] interfaces
private ConstantPool constantPool
private HotSpotResolvedObjectType arrayOfType
public HotSpotResolvedObjectTypeImpl(Class<?> javaClass)
Class
object.
NOTE: Creating an instance of this class does not install the mirror for the
Class
type. Use fromObjectClass(Class)
or fromMetaspaceKlass(long)
instead.
javaClass
- the Class to create the mirror forpublic static HotSpotResolvedObjectTypeImpl fromObjectClass(Class<?> javaClass)
Class
object.HotSpotResolvedJavaType
corresponding to javaClass
public static HotSpotResolvedObjectTypeImpl fromMetaspaceKlass(long metaspaceKlass)
metaspaceKlass
- a metaspace Klass objectResolvedJavaType
corresponding to metaspaceKlass
private static String getSignatureName(Class<?> javaClass)
public long getMetaspaceKlass()
public int getModifiers()
getModifiers
in interface ModifiersProvider
getModifiers
in interface ResolvedJavaType
public int getAccessFlags()
public HotSpotResolvedObjectType getArrayClass()
getArrayClass
in interface HotSpotResolvedObjectType
getArrayClass
in interface JavaType
getArrayClass
in interface ResolvedJavaType
public ResolvedJavaType getComponentType()
getComponentType
in interface HotSpotResolvedObjectType
getComponentType
in interface JavaType
getComponentType
in interface ResolvedJavaType
public Assumptions.AssumptionResult<ResolvedJavaType> findLeafConcreteSubtype()
findLeafConcreteSubtype
in interface HotSpotResolvedObjectType
findLeafConcreteSubtype
in interface ResolvedJavaType
private boolean isLeafClass()
type
is a leaf class. This is the case if the
Klass::_subklass
field of the underlying class is zero.private long getSubklass()
Klass::_subklass
field of the underlying metaspace klass for the given
type type
.public HotSpotResolvedObjectTypeImpl getSuperclass()
getSuperclass
in interface HotSpotResolvedObjectType
getSuperclass
in interface ResolvedJavaType
public HotSpotResolvedObjectTypeImpl[] getInterfaces()
getInterfaces
in interface HotSpotResolvedObjectType
getInterfaces
in interface ResolvedJavaType
public HotSpotResolvedObjectTypeImpl getSingleImplementor()
getSingleImplementor
in interface ResolvedJavaType
public HotSpotResolvedObjectTypeImpl getSupertype()
getSupertype
in interface HotSpotResolvedObjectType
public HotSpotResolvedObjectType findLeastCommonAncestor(ResolvedJavaType otherType)
findLeastCommonAncestor
in interface HotSpotResolvedObjectType
findLeastCommonAncestor
in interface ResolvedJavaType
public HotSpotResolvedObjectType asExactType()
asExactType
in interface HotSpotResolvedObjectType
asExactType
in interface ResolvedJavaType
public JavaConstant getJavaClass()
getJavaClass
in interface ResolvedJavaType
public JavaConstant getObjectHub()
getObjectHub
in interface ResolvedJavaType
public Assumptions.AssumptionResult<Boolean> hasFinalizableSubclass()
hasFinalizableSubclass
in interface ResolvedJavaType
public boolean hasFinalizer()
hasFinalizer
in interface ResolvedJavaType
public boolean isPrimitive()
isPrimitive
in interface HotSpotResolvedObjectType
isPrimitive
in interface ResolvedJavaType
public boolean isArray()
isArray
in interface ResolvedJavaType
public boolean isInitialized()
isInitialized
in interface ResolvedJavaType
public boolean isLinked()
isLinked
in interface ResolvedJavaType
private int getInitState()
InstanceKlass::_init_state
of the metaspace
klass.public void initialize()
initialize
in interface ResolvedJavaType
public boolean isInstance(JavaConstant obj)
isInstance
in interface ResolvedJavaType
public boolean isInstanceClass()
isInstanceClass
in interface ResolvedJavaType
public boolean isInterface()
isInterface
in interface ModifiersProvider
isInterface
in interface ResolvedJavaType
public boolean isAssignableFrom(ResolvedJavaType other)
isAssignableFrom
in interface ResolvedJavaType
public boolean isJavaLangObject()
isJavaLangObject
in interface ResolvedJavaType
public Kind getKind()
getKind
in interface HotSpotResolvedObjectType
getKind
in interface JavaType
public ResolvedJavaMethod resolveConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType callerType)
resolveConcreteMethod
in interface ResolvedJavaType
public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType)
resolveMethod
in interface ResolvedJavaType
public ConstantPool constantPool()
constantPool
in interface HotSpotResolvedObjectType
public int instanceSize()
instanceSize
in interface HotSpotResolvedObjectType
public int layoutHelper()
layoutHelper
in interface HotSpotResolvedObjectType
public HotSpotResolvedJavaMethod createMethod(long metaspaceMethod)
public int getVtableLength()
getVtableLength
in interface HotSpotResolvedObjectType
public HotSpotResolvedJavaField createField(String fieldName, JavaType type, long offset, int rawFlags)
createField
in interface HotSpotResolvedObjectType
public Assumptions.AssumptionResult<ResolvedJavaMethod> findUniqueConcreteMethod(ResolvedJavaMethod method)
findUniqueConcreteMethod
in interface HotSpotResolvedObjectType
findUniqueConcreteMethod
in interface ResolvedJavaType
public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses)
getInstanceFields
in interface ResolvedJavaType
public ResolvedJavaField[] getStaticFields()
getStaticFields
in interface ResolvedJavaType
private int getFieldCount()
InstanceKlass::_fields
array
by walking the array and discounting the generic signature slots at the end of the array.
See FieldStreamBase::init_generic_signature_start_slot
public Class<?> mirror()
mirror
in class HotSpotResolvedJavaType
public String getSourceFileName()
getSourceFileName
in interface ResolvedJavaType
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
getAnnotation
in interface ResolvedJavaType
public boolean isDefinitelyResolvedWithRespectTo(ResolvedJavaType accessingClass)
accessingClass
. That can only be determined by
re-resolving the type.isDefinitelyResolvedWithRespectTo
in interface HotSpotResolvedObjectType
public ResolvedJavaType resolve(ResolvedJavaType accessingClass)
public JavaConstant klass()
JavaConstant
.klass
in interface HotSpotResolvedObjectType
public boolean isPrimaryType()
isPrimaryType
in interface HotSpotResolvedObjectType
public int superCheckOffset()
superCheckOffset
in interface HotSpotResolvedObjectType
public long prototypeMarkWord()
prototypeMarkWord
in interface HotSpotResolvedObjectType
public ResolvedJavaField findInstanceFieldWithOffset(long offset, Kind expectedEntryKind)
findInstanceFieldWithOffset
in interface ResolvedJavaType
public URL getClassFilePath()
getClassFilePath
in interface ResolvedJavaType
public boolean isLocal()
isLocal
in interface ResolvedJavaType
public boolean isMember()
isMember
in interface ResolvedJavaType
public HotSpotResolvedObjectTypeImpl getEnclosingType()
getEnclosingType
in interface HotSpotResolvedObjectType
getEnclosingType
in interface ResolvedJavaType
public ResolvedJavaMethod[] getDeclaredConstructors()
getDeclaredConstructors
in interface ResolvedJavaType
public ResolvedJavaMethod[] getDeclaredMethods()
getDeclaredMethods
in interface ResolvedJavaType
public ResolvedJavaMethod getClassInitializer()
getClassInitializer
in interface HotSpotResolvedObjectType
getClassInitializer
in interface ResolvedJavaType
public boolean isTrustedInterfaceType()
isTrustedInterfaceType
in interface ResolvedJavaType