Class PHDJavaObject

java.lang.Object
com.ibm.dtfj.phd.PHDJavaObject
All Implemented Interfaces:
JavaObject

public class PHDJavaObject extends Object implements JavaObject
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The constructors for PHDJavaObject used to take up to 11 arguments, many of which were ints.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    instance size is an unsigned int in the datastream, so -1L is a value that cannot collide
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    arraycopy(int srcStart, Object dst, int dstStart, int length)
    Copies data from the image array into a local Java array.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    int
    Get the number of elements in this array.
    long
    Fetch the basic hash code for the object.
    Gets the heap where this object is located.
    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.
    long
    Fetch 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.
    long
    Get the number of bytes of memory occupied by this object on the heap.
    int
    Answers an integer hash code for the receiver.
    boolean
    Is this object an array?

    Methods declared in class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • UNSPECIFIED_INSTANCE_SIZE

      public static final long UNSPECIFIED_INSTANCE_SIZE
      instance size is an unsigned int in the datastream, so -1L is a value that cannot collide
      See Also:
  • Constructor Details

  • Method Details

    • arraycopy

      public void arraycopy(int srcStart, Object dst, int dstStart, int length) throws CorruptDataException, MemoryAccessException
      Description copied from interface: JavaObject
      Copies 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:
      arraycopy in interface JavaObject
      Parameters:
      srcStart - index in the receiver to start copying from
      dst - the destination array
      dstStart - index in the destination array to start copying into
      length - the number of elements to be copied
      Throws:
      CorruptDataException
      MemoryAccessException
    • getArraySize

      public int getArraySize() throws CorruptDataException
      Description copied from interface: JavaObject
      Get the number of elements in this array.
      Specified by:
      getArraySize in interface JavaObject
      Returns:
      the number of elements in this array
      Throws:
      CorruptDataException
    • getHashcode

      public long getHashcode() throws DataUnavailable, CorruptDataException
      Description copied from interface: JavaObject
      Fetch 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:
      getHashcode in interface JavaObject
      Returns:
      the basic hash code of the object in the image
      Throws:
      DataUnavailable - if the hash code cannot be determined
      CorruptDataException
      See Also:
    • getHeap

      public JavaHeap getHeap() throws CorruptDataException, DataUnavailable
      Description copied from interface: JavaObject
      Gets the heap where this object is located.
      Specified by:
      getHeap in interface JavaObject
      Returns:
      the JavaHeap instance representing the heap where this object is stored in memory
      Throws:
      CorruptDataException - if the heap information for this object is corrupt
      DataUnavailable - if the heap information for this object is not available
      See Also:
    • getID

      public ImagePointer getID()
      Description copied from interface: JavaObject
      The 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:
      getID in interface JavaObject
      Returns:
      the runtime-wide unique identifier for the object
    • getJavaClass

      public JavaClass getJavaClass() throws CorruptDataException
      Description copied from interface: JavaObject
      Get the JavaClass instance which represents the class of this object.
      Specified by:
      getJavaClass in interface JavaObject
      Returns:
      the JavaClass instance which represents the class of this object
      Throws:
      CorruptDataException
    • getPersistentHashcode

      public long getPersistentHashcode() throws DataUnavailable, CorruptDataException
      Description copied from interface: JavaObject
      Fetch 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:
      getPersistentHashcode in interface JavaObject
      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 snapshots
      CorruptDataException
      See Also:
    • getReferences

      public Iterator<JavaReference> getReferences()
      Description copied from interface: JavaObject
      Get the set of references from this object. Corrupt references will be returned as CorruptData objects by the Iterator.
      Specified by:
      getReferences in interface JavaObject
      Returns:
      an iterator of JavaReference and CorruptData objects
      See Also:
    • getSections

      public Iterator<ImageSection> getSections()
      Description copied from interface: JavaObject
      An 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:
      getSections in interface JavaObject
      Returns:
      a collection of sections that make up this object
      See Also:
    • getSize

      public long getSize() throws CorruptDataException
      Description copied from interface: JavaObject
      Get the number of bytes of memory occupied by this object on the heap. The memory may not necessarily be contiguous.
      Specified by:
      getSize in interface JavaObject
      Throws:
      CorruptDataException
    • isArray

      public boolean isArray() throws CorruptDataException
      Description copied from interface: JavaObject
      Is this object an array?
      Specified by:
      isArray in interface JavaObject
      Returns:
      true if the receiver represents an instance of an array, or false otherwise
      Throws:
      CorruptDataException
    • equals

      public boolean equals(Object o)
      Description copied from interface: JavaObject
      Compares 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:
      equals in interface JavaObject
      Overrides:
      equals in class Object
      Parameters:
      o - Object the object to compare with this object.
      Returns:
      boolean true if the object is the same as this object false if it is different from this object.
      See Also:
    • hashCode

      public int hashCode()
      Description copied from interface: JavaObject
      Answers an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.
      Specified by:
      hashCode in interface JavaObject
      Overrides:
      hashCode in class Object
      Returns:
      the receiver's hash.
      See Also: