Class JavaArrayClass
-
Field Summary
Fields declared in class com.ibm.dtfj.java.j9.JavaAbstractClass
_classPointer, _javaVM
Fields declared in interface com.ibm.dtfj.java.JavaClass
MODIFIERS_UNAVAILABLE
-
Constructor Summary
ConstructorDescriptionJavaArrayClass
(JavaRuntime runtime, ImagePointer pointer, int modifiers, int flagOffset, int sizeOffset, int bytesForSize, int firstElementOffset, long leafClassID, int dimension, long loaderID, ImagePointer objectID, int hashcodeSlot) -
Method Summary
Modifier and TypeMethodDescriptionint
getBytesPerElement
(int refFieldSize) Looks up the class name of the child elements to determine the size of one elementFor array classes, returns a JavaClass representing the component type of this array class.Java classes may refer to other classes and to String objects via the class's constant pool.Get the set of fields declared in this class.Get the set of methods declared in this class.int
long
Returns the size in bytes of an instance of this class on the heap.int
getInstanceSize
(JavaObject instance) getName()
Get the name of the class.int
Get the set of references from this class.int
Get the immediate superclass of this class.boolean
isArray()
Is this an array class ?Methods declared in class com.ibm.dtfj.java.j9.JavaAbstractClass
addClassLoaderReference, addClassObjectReference, addInterfaceName, addSuperclassReference, equals, getClassLoader, getHashcodeSlotSize, getID, getInterfaces, getModifiers, getObject, getProtectionDomain, hashCode, readFlagsFromInstance
-
Constructor Details
-
JavaArrayClass
public JavaArrayClass(JavaRuntime runtime, ImagePointer pointer, int modifiers, int flagOffset, int sizeOffset, int bytesForSize, int firstElementOffset, long leafClassID, int dimension, long loaderID, ImagePointer objectID, int hashcodeSlot)
-
-
Method Details
-
getName
Description copied from interface:JavaClass
Get the name of the class.- Returns:
- the name of the class in the form: "full/package/class$innerclass"
- Throws:
CorruptDataException
-
getSuperclass
Description copied from interface:JavaClass
Get the immediate superclass of this class.- Returns:
- the immediate superclass of this class, or null if this class has no superclass. For interfaces, Object, primitive types and void null is always returned.
- Throws:
CorruptDataException
-
isArray
Description copied from interface:JavaClass
Is this an array class ?- Returns:
- true if this class is an array class
- Throws:
CorruptDataException
-
getLeafClass
-
getComponentType
Description copied from interface:JavaClass
For array classes, returns a JavaClass representing the component type of this array class.- Returns:
- a JavaClass representing the component type of this array class
- Throws:
CorruptDataException
-
getDeclaredFields
-
getDeclaredMethods
-
getConstantPoolReferences
Description copied from interface:JavaClass
Java classes may refer to other classes and to String objects via the class's constant pool. These references are followed by the garbage collector, forming edges on the graph of reachable objects. This getConstantPoolReferences() may be used to determine which objects are referred to by the receiver's constant pool.Although Java VMs typically permit only Class and String objects in the constant pool, some esoteric or future virtual machines may permit other types of objects to occur in the constant pool. This API imposes no restrictions on the types of JavaObjects which might be included in the Iterator.
No assumption should be made about the order in which constant pool references are returned.
Classes may also refer to objects through static variables. These may be found with the getDeclaredFields() API. Objects referenced by static variables are not returned by getConstantPoolReferences() unless the object is also referenced by the constant pool.
- Returns:
- an iterator over the collection of JavaObjects which are referred to by the constant pool of this class
- See Also:
-
getInstanceSize
- Specified by:
getInstanceSize
in classJavaAbstractClass
- Parameters:
instance
- The instance is needed for array types to calculate the size of a per-instance basis- Returns:
- The size, in bytes, of an instance of this class (required for iterating the heap)
-
getBytesPerElement
Looks up the class name of the child elements to determine the size of one element- Parameters:
refFieldSize
- The size of reference fields (fj9object_t) in the heap of the object instance we are sizing- Returns:
- The size of one element, in bytes
- Throws:
CorruptDataException
-
getFirstElementOffset
public int getFirstElementOffset()- Returns:
-
getSizeOffset
public int getSizeOffset()- Returns:
- The offset into an array where the length (in elements) is found
-
getNumberOfSizeBytes
public int getNumberOfSizeBytes()- Returns:
- The number of bytes to read from the object header as the size field
-
getReferences
-
getInstanceSize
Description copied from interface:JavaClass
Returns the size in bytes of an instance of this class on the heap.The call is only meaningful for a non-array JavaClass, where all instances of the class are of the same size. If this method is called on a JavaArrayClass, where instances can be of different sizes, an UnsupportedOperationException will be thrown. DataUnavailable can be thrown if no value is available: for example when DTFJ is examining a javacore, where the instance size for a class is not recorded.
- Returns:
- size in bytes of an instance
- Throws:
CorruptDataException
-