Module openj9.dtfj

Class GCObjectModel


  • public abstract class GCObjectModel
    extends GCBase
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.ibm.j9ddr.vm29.j9.gc.GCArrayObjectModel indexableObjectModel  
      protected com.ibm.j9ddr.vm29.j9.gc.GCMixedObjectModel mixedObjectModel  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GCObjectModel()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract UDATA adjustSizeInBytes​(UDATA sizeInBytes)
      Object size should be at least minimumConsumedSize and 8 byte aligned.
      static GCObjectModel from()
      Factory method to construct an appropriate object model.
      abstract U32 getAge​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the age of an object.
      abstract UDATA getClassShape​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
      Returns the shape of a class.
      abstract UDATA getClassShape​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the shape of an object.
      abstract UDATA getConsumedSizeInBytesWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Same as getSizeInBytesWithHeader, except it takes into account object alignment and minimum object size
      UDATA getConsumedSizeInSlotsWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Same as getSizeInSlotsWithHeader, except it takes into account object alignment and minimum object size
      UDATA getDataSizeInBytes​(com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer array)
      Returns the size of data in an indexable object, in bytes, including leaves, excluding the header.
      abstract VoidPointer getElementAddress​(com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer indexableObjectPointer, int elementIndex, int elementSize)
      Returns the address of the element at elementIndex logical offset into indexableObjectPointer, assuming that each element is dataSize bytes.
      abstract UDATA getHashcodeOffset​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)  
      abstract UDATA getHeaderSize​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the size of an object header, in bytes.
      abstract long getObjectAlignmentInBytes()
      Returns run-time object alignment in bytes.
      abstract I32 getObjectHashCode​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Determine the basic hash code for the specified object.
      abstract UDATA getRememberedBits​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the collector bits from object's header.
      abstract long getScanType​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)  
      abstract UDATA getSizeInBytesHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the size in bytes of a hole object.
      abstract UDATA getSizeInBytesMultiSlotHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the size, in bytes, of a multi-slot hole object.
      abstract UDATA getSizeInBytesSingleSlotHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the size, in bytes, of a single slot hole object.
      abstract UDATA getSizeInBytesWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the size of an object, in bytes, including the header.
      abstract UDATA getSizeInElements​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the size of an indexable object in elements.
      UDATA getSizeInSlotsWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns the size of an object, in slots, including the header.
      abstract UDATA getTotalFootprintInBytesWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Get the total footprint of an object, in bytes, including the object header and all data.
      abstract boolean hasBeenHashed​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns TRUE if an object has been hashed, FALSE otherwise.
      abstract boolean hasBeenMoved​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns TRUE if an object has been moved after being hashed, FALSE otherwise.
      abstract boolean isDarkMatterObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns TRUE if an object is dark matter, FALSE otherwise.
      abstract boolean isHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns TRUE if an object is a hole, FALSE otherwise.
      abstract boolean isIndexable​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
      Returns TRUE if an class is indexable, FALSE otherwise.
      abstract boolean isIndexable​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns TRUE if an object is indexable, FALSE otherwise.
      boolean isInlineContiguousArraylet​(com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer arrayPtr)  
      abstract boolean isOld​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns TRUE if an object is old, FALSE otherwise.
      abstract boolean isRemembered​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns TRUE if an object is remembered, FALSE otherwise.
      abstract boolean isSingleSlotHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
      Returns TRUE if an object is a single slot hole object, FALSE otherwise.
    • Field Detail

      • mixedObjectModel

        protected com.ibm.j9ddr.vm29.j9.gc.GCMixedObjectModel mixedObjectModel
      • indexableObjectModel

        protected com.ibm.j9ddr.vm29.j9.gc.GCArrayObjectModel indexableObjectModel
    • Method Detail

      • adjustSizeInBytes

        public abstract UDATA adjustSizeInBytes​(UDATA sizeInBytes)
        Object size should be at least minimumConsumedSize and 8 byte aligned.
        Parameters:
        sizeInBytes - Real size of an object
        Returns:
        Adjusted size
      • getClassShape

        public abstract UDATA getClassShape​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                     throws CorruptDataException
        Returns the shape of an object.
        Parameters:
        object - Pointer to object whose shape is required.
        Returns:
        The shape of the object
        Throws:
        CorruptDataException
      • getClassShape

        public abstract UDATA getClassShape​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
                                     throws CorruptDataException
        Returns the shape of a class.
        Parameters:
        clazz - Pointer to J9ClassPointer whose shape is required.
        Returns:
        The shape of the class
        Throws:
        CorruptDataException
      • isIndexable

        public abstract boolean isIndexable​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                     throws CorruptDataException
        Returns TRUE if an object is indexable, FALSE otherwise.
        Parameters:
        object - Pointer to an object
        Returns:
        TRUE if an object is indexable, FALSE otherwise
        Throws:
        CorruptDataException
      • isIndexable

        public abstract boolean isIndexable​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
                                     throws CorruptDataException
        Returns TRUE if an class is indexable, FALSE otherwise.
        Parameters:
        clazz - Pointer to an J9Class
        Returns:
        TRUE if an class is indexable, FALSE otherwise
        Throws:
        CorruptDataException
      • isHoleObject

        public abstract boolean isHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                      throws CorruptDataException
        Returns TRUE if an object is a hole, FALSE otherwise.
        Parameters:
        object - Pointer to an object
        Returns:
        TRUE if an object is a hole, FALSE otherwise
        Throws:
        CorruptDataException
      • isSingleSlotHoleObject

        public abstract boolean isSingleSlotHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                                throws CorruptDataException
        Returns TRUE if an object is a single slot hole object, FALSE otherwise.
        Parameters:
        object - Pointer to an object
        Returns:
        TRUE if an object is a single slot hole object, FALSE otherwise
        Throws:
        CorruptDataException
      • getSizeInBytesMultiSlotHoleObject

        public abstract UDATA getSizeInBytesMultiSlotHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                                         throws CorruptDataException
        Returns the size, in bytes, of a multi-slot hole object.
        Parameters:
        object - Pointer to an object
        Returns:
        The size, in bytes, of a multi-slot hole object
        Throws:
        CorruptDataException
      • getSizeInBytesSingleSlotHoleObject

        public abstract UDATA getSizeInBytesSingleSlotHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
        Returns the size, in bytes, of a single slot hole object.
        Parameters:
        object - Pointer to an object
        Returns:
        The size, in bytes, of a single slot hole object
      • getObjectAlignmentInBytes

        public abstract long getObjectAlignmentInBytes()
        Returns run-time object alignment in bytes.
        Returns:
        The alignment in bytes
      • getSizeInBytesHoleObject

        public abstract UDATA getSizeInBytesHoleObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                                throws CorruptDataException
        Returns the size in bytes of a hole object.
        Parameters:
        object - Pointer to an object
        Returns:
        The size in bytes of a hole object
        Throws:
        CorruptDataException
      • isDarkMatterObject

        public abstract boolean isDarkMatterObject​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                            throws CorruptDataException
        Returns TRUE if an object is dark matter, FALSE otherwise.
        Parameters:
        object - Pointer to an object
        Returns:
        TRUE if an object is dark matter, FALSE otherwise
        Throws:
        CorruptDataException
      • getSizeInBytesWithHeader

        public abstract UDATA getSizeInBytesWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                                throws CorruptDataException
        Returns the size of an object, in bytes, including the header.
        Parameters:
        object - Pointer to an object
        Returns:
        The size of an object, in bytes, including the header
        Throws:
        CorruptDataException
      • getTotalFootprintInBytesWithHeader

        public abstract UDATA getTotalFootprintInBytesWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                                          throws CorruptDataException
        Get the total footprint of an object, in bytes, including the object header and all data. If the object has a discontiguous representation, this method should return the size of the root object plus the total of all the discontiguous parts of the object.
        Parameters:
        object - Pointer to an object
        Returns:
        the total size of an object, in bytes, including discontiguous parts
        Throws:
        CorruptDataException
      • getConsumedSizeInBytesWithHeader

        public abstract UDATA getConsumedSizeInBytesWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                                        throws CorruptDataException
        Same as getSizeInBytesWithHeader, except it takes into account object alignment and minimum object size
        Parameters:
        object - Pointer to an object
        Returns:
        The consumed heap size of an object, in bytes, including the header
        Throws:
        CorruptDataException
      • getSizeInSlotsWithHeader

        public UDATA getSizeInSlotsWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                       throws CorruptDataException
        Returns the size of an object, in slots, including the header.
        Parameters:
        object - Pointer to an object
        Returns:
        The size of an object, in slots, including the header
        Throws:
        CorruptDataException
      • getConsumedSizeInSlotsWithHeader

        public UDATA getConsumedSizeInSlotsWithHeader​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                               throws CorruptDataException
        Same as getSizeInSlotsWithHeader, except it takes into account object alignment and minimum object size
        Parameters:
        object - Pointer to an object
        Returns:
        The consumed heap size of an object, in slots, including the header
        Throws:
        CorruptDataException
      • getAge

        public abstract U32 getAge​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                            throws CorruptDataException
        Returns the age of an object.
        Parameters:
        object - Pointer to an object
        Returns:
        The age of the object
        Throws:
        CorruptDataException
      • isRemembered

        public abstract boolean isRemembered​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                      throws CorruptDataException
        Returns TRUE if an object is remembered, FALSE otherwise.
        Parameters:
        object - Pointer to an object
        Returns:
        TRUE if an object is remembered, FALSE otherwise
        Throws:
        CorruptDataException
      • getRememberedBits

        public abstract UDATA getRememberedBits​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                         throws CorruptDataException
        Returns the collector bits from object's header.
        Parameters:
        object - Pointer to an object
        Returns:
        collector bits
        Throws:
        CorruptDataException
      • isOld

        public abstract boolean isOld​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                               throws CorruptDataException
        Returns TRUE if an object is old, FALSE otherwise.
        Parameters:
        object - Pointer to an object
        Returns:
        TRUE if an object is in the old area, FALSE otherwise
        Throws:
        CorruptDataException
      • hasBeenHashed

        public abstract boolean hasBeenHashed​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                       throws CorruptDataException
        Returns TRUE if an object has been hashed, FALSE otherwise.
        Parameters:
        object - Pointer to an object
        Returns:
        TRUE if an object has been hashed, FALSE otherwise
        Throws:
        CorruptDataException
      • hasBeenMoved

        public abstract boolean hasBeenMoved​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                      throws CorruptDataException
        Returns TRUE if an object has been moved after being hashed, FALSE otherwise.
        Parameters:
        object - Pointer to an object
        Returns:
        TRUE if an object has been moved after being hashed, FALSE otherwise
        Throws:
        CorruptDataException
      • getObjectHashCode

        public abstract I32 getObjectHashCode​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                       throws CorruptDataException
        Determine the basic hash code for the specified object.
        Parameters:
        object - [in] the object to be hashed
        Returns:
        the persistent, basic hash code for the object
        Throws:
        CorruptDataException
      • getDataSizeInBytes

        public UDATA getDataSizeInBytes​(com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer array)
                                 throws CorruptDataException
        Returns the size of data in an indexable object, in bytes, including leaves, excluding the header.
        Parameters:
        array - Pointer to the indexable object whose size is required
        Returns:
        The size of an object in bytes excluding the header
        Throws:
        CorruptDataException
      • getHeaderSize

        public abstract UDATA getHeaderSize​(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer object)
                                     throws CorruptDataException
        Returns the size of an object header, in bytes.
        Parameters:
        object - Pointer to an object
        Returns:
        The size of an object header, in bytes.
        Throws:
        CorruptDataException
      • getElementAddress

        public abstract VoidPointer getElementAddress​(com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer indexableObjectPointer,
                                                      int elementIndex,
                                                      int elementSize)
                                               throws CorruptDataException
        Returns the address of the element at elementIndex logical offset into indexableObjectPointer, assuming that each element is dataSize bytes.
        Parameters:
        indexableObjectPointer - The array from which we should look-up the address
        elementIndex - The logical index number of the element within the array
        elementSize - The size, in bytes, of a single element of the array
        Returns:
        A pointer to the element
        Throws:
        CorruptDataException
      • isInlineContiguousArraylet

        public boolean isInlineContiguousArraylet​(com.ibm.j9ddr.vm29.pointer.generated.J9IndexableObjectPointer arrayPtr)
                                           throws CorruptDataException
        Parameters:
        arrayPtr - array object we are checking for isInlineContiguousArraylet
        Throws:
        CorruptDataException - If there's a problem accessing the layout of the indexable object