java.lang.Object
com.ibm.dtfj.java.j9.JavaObject
- All Implemented Interfaces:
JavaObject
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Method Summary
Modifier and TypeMethodDescriptionvoidCopies data from the image array into a local Java array.static JavaObjectcreateJavaObject(JavaRuntime vm, ImagePointer address) Deprecated.static JavaObjectcreateJavaObject(JavaRuntime vm, ImagePointer address, JavaHeap containingHeap, JavaHeapRegion containingRegion) Deprecated.Useinsteadinvalid reference
JavaRuntime#getObjectInHeapRegion(ImagePointer,JavaHeap,JavaHeapRegion)booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.intGet the number of elements in this array.getFObjectAtOffset(int offset) intA method required for the JavaArrayClass so it can ask the instance it is trying to size how big reference fields are in its heaplongFetch the basic hash code for the object.getHeap()Gets the heap where this object is located.getID()The ID of an object is a unique address is memory which identifies the object.Get the JavaClass instance which represents the class of this object.longFetch the basic hash code of the object in the image.Get the set of references from this object.An object is represented in the Java runtime by one or more regions of memory.longgetSize()Get the number of bytes of memory occupied by this object on the heap.inthashCode()Answers an integer hash code for the receiver.booleanisArray()Is this object an array?booleanbooleanisClass()booleanbooleanbooleanisThread()voidsetAssociatedClass(JavaClass associatedClass) voidsetAssociatedClassLoader(JavaClassLoader associatedClassLoader) voidsetAssociatedMonitor(JavaMonitor associatedMonitor) voidsetAssociatedThread(JavaThread associatedThread)
-
Field Details
-
BOOLEAN_SIGNATURE
- See Also:
-
BYTE_SIGNATURE
- See Also:
-
CHAR_SIGNATURE
- See Also:
-
SHORT_SIGNATURE
- See Also:
-
INTEGER_SIGNATURE
- See Also:
-
LONG_SIGNATURE
- See Also:
-
FLOAT_SIGNATURE
- See Also:
-
DOUBLE_SIGNATURE
- See Also:
-
ARRAY_PREFIX_SIGNATURE
- See Also:
-
OBJECT_PREFIX_SIGNATURE
- See Also:
-
-
Method Details
-
createJavaObject
@Deprecated public static JavaObject createJavaObject(JavaRuntime vm, ImagePointer address) throws CorruptDataException Deprecated.UseJavaRuntime.getObjectAtAddress(ImagePointer)instead- Throws:
CorruptDataException
-
createJavaObject
@Deprecated public static JavaObject createJavaObject(JavaRuntime vm, ImagePointer address, JavaHeap containingHeap, JavaHeapRegion containingRegion) throws CorruptDataException Deprecated.Useinsteadinvalid reference
JavaRuntime#getObjectInHeapRegion(ImagePointer,JavaHeap,JavaHeapRegion)- Throws:
CorruptDataException
-
getJavaClass
Description copied from interface:JavaObjectGet the JavaClass instance which represents the class of this object.- Specified by:
getJavaClassin interfaceJavaObject- Returns:
- the JavaClass instance which represents the class of this object
- Throws:
CorruptDataException
-
isArray
Description copied from interface:JavaObjectIs this object an array?- Specified by:
isArrayin interfaceJavaObject- Returns:
- true if the receiver represents an instance of an array, or false otherwise
- Throws:
CorruptDataException
-
getArraySize
Description copied from interface:JavaObjectGet the number of elements in this array.- Specified by:
getArraySizein interfaceJavaObject- Returns:
- the number of elements in this array
- Throws:
CorruptDataException
-
arraycopy
public void arraycopy(int srcStart, Object dst, int dstStart, int length) throws CorruptDataException, MemoryAccessException Description copied from interface:JavaObjectCopies data from the image array into a local Java array. The dst object must be an array of the appropriate type -- a base type array for base types, or a JavaObject array for reference arrays.- Specified by:
arraycopyin interfaceJavaObject- Parameters:
srcStart- index in the receiver to start copying fromdst- the destination arraydstStart- index in the destination array to start copying intolength- the number of elements to be copied- Throws:
CorruptDataExceptionMemoryAccessException
-
getSize
Description copied from interface:JavaObjectGet the number of bytes of memory occupied by this object on the heap. The memory may not necessarily be contiguous.- Specified by:
getSizein interfaceJavaObject- Throws:
CorruptDataException
-
getHashcode
Description copied from interface:JavaObjectFetch the basic hash code for the object. This is the hash code which would be returned if a Java thread had requested it. Typically the hash code is based on the address of an object, and may change if the object is moved by a garbage collection cycle.- Specified by:
getHashcodein interfaceJavaObject- Returns:
- the basic hash code of the object in the image
- Throws:
DataUnavailable- if the hash code cannot be determinedCorruptDataException- See Also:
-
getPersistentHashcode
Description copied from interface:JavaObjectFetch the basic hash code of the object in the image. This hash code is guaranteed to be persistent between multiple snapshots of the same Image. If the hash code cannot be determined, or if the hash code for this object could change between snapshots, an exception is thrown.If the VM uses a 'hasBeenHashed' bit, the value of this bit can be inferred by calling getPersistentHashcode(). If the persistent hash code is not available, then the 'hasBeenHashed' bit has not been set, and the hash of the object could change if the object moves between snapshots
- Specified by:
getPersistentHashcodein interfaceJavaObject- Returns:
- the basic hash code of the object in the image
- Throws:
DataUnavailable- if a hash code cannot be determined, or if the hash code could change between successive snapshotsCorruptDataException- See Also:
-
getID
Description copied from interface:JavaObjectThe ID of an object is a unique address is memory which identifies the object. The data at this memory is implementation defined. The object may be non-contiguous. Portions of the object may appear below or above this address.- Specified by:
getIDin interfaceJavaObject- Returns:
- the runtime-wide unique identifier for the object
-
getSections
Description copied from interface:JavaObjectAn object is represented in the Java runtime by one or more regions of memory. These include the object's header and the data in the object. In certain allocation strategies, an object's header and data may be allocated contiguously. In this case, this method may return an iterator for a single section. In other schemes, the header may be separate from the data or the data may be broken up into multiple regions. Additionally, this function does not guarantee that the memory used by this object is not also shared by one or more other objects. Callers should not make any assumptions about the contents of the memory.- Specified by:
getSectionsin interfaceJavaObject- Returns:
- a collection of sections that make up this object
- See Also:
-
equals
Description copied from class:java.lang.ObjectCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. The implementation in Object answers true only if the argument is the exact same object as the receiver (==).- Specified by:
equalsin interfaceJavaObject- Overrides:
equalsin classObject- Parameters:
obj- Object the object to compare with this object.- Returns:
- boolean
trueif the object is the same as this objectfalseif it is different from this object. - See Also:
-
hashCode
public int hashCode()Description copied from class:java.lang.ObjectAnswers an integer hash code for the receiver. Any two objects which answertruewhen passed to.equalsmust answer the same value for this method.- Specified by:
hashCodein interfaceJavaObject- Overrides:
hashCodein classObject- Returns:
- the receiver's hash.
- See Also:
-
isArraylet
public boolean isArraylet() -
getFObjectAtOffset
public ImagePointer getFObjectAtOffset(int offset) throws MemoryAccessException, CorruptDataException -
getFObjectSize
public int getFObjectSize()A method required for the JavaArrayClass so it can ask the instance it is trying to size how big reference fields are in its heap- Returns:
- The size of fj9object_t in the heap containing this instance
-
getReferences
Description copied from interface:JavaObjectGet the set of references from this object. Corrupt references will be returned as CorruptData objects by the Iterator.- Specified by:
getReferencesin interfaceJavaObject- Returns:
- an iterator of JavaReference and CorruptData objects
- See Also:
-
isClass
public boolean isClass() -
isMonitor
public boolean isMonitor() -
isThread
public boolean isThread() -
isClassLoader
public boolean isClassLoader() -
getHeap
Description copied from interface:JavaObjectGets the heap where this object is located.- Specified by:
getHeapin interfaceJavaObject- Returns:
- the
JavaHeapinstance representing the heap where this object is stored in memory - Throws:
DataUnavailable- if the heap information for this object is not available- See Also:
-
getAssociatedClass
- Returns:
- the associatedClass
-
setAssociatedClass
- Parameters:
associatedClass- the associatedClass to set
-
getAssociatedMonitor
- Returns:
- the associatedMonitor
-
setAssociatedMonitor
- Parameters:
associatedMonitor- the associatedMonitor to set
-
getAssociatedThread
- Returns:
- the associatedThread
-
setAssociatedThread
- Parameters:
associatedThread- the associatedThread to set
-
getAssociatedClassLoader
- Returns:
- the associatedClassLoader
-
setAssociatedClassLoader
- Parameters:
associatedClassLoader- the associatedClassLoader to set
-
JavaRuntime.getObjectAtAddress(ImagePointer)instead