Module openj9.dtfj

Class J9MemTagHelper


  • public class J9MemTagHelper
    extends Object
    • Field Detail

      • J9PORT_MEMTAG_HEADER_TAG_CORRUPTED

        public static IDATA J9PORT_MEMTAG_HEADER_TAG_CORRUPTED
      • J9PORT_MEMTAG_FOOTER_TAG_CORRUPTED

        public static IDATA J9PORT_MEMTAG_FOOTER_TAG_CORRUPTED
      • J9PORT_MEMTAG_FOOTER_PADDING_CORRUPTED

        public static IDATA J9PORT_MEMTAG_FOOTER_PADDING_CORRUPTED
      • J9PORT_MEMTAG_NOT_A_TAG

        public static IDATA J9PORT_MEMTAG_NOT_A_TAG
      • J9PORT_MEMTAG_VALID_TAG

        public static IDATA J9PORT_MEMTAG_VALID_TAG
    • Constructor Detail

      • J9MemTagHelper

        public J9MemTagHelper()
    • Method Detail

      • j9mem_check_tags

        public static IDATA j9mem_check_tags​(VoidPointer memoryPointer,
                                             long headerEyecatcher,
                                             long footerEyecatcher)
                                      throws J9MemTagHelper.J9MemTagCheckError
        Performs validation checks on the memory block starting at memoryPointer. The memory passed in could fall into one of three categories: 1) It could be a valid J9MemTag region with valid headers and footers 2) It could be not be a J9MemTag region 3) It could be a J9MemTag region with some corruption in either the header, footer or padding
        Returns:
        J9PORT_MEMTAG_NOT_A_TAG if memoryPointer address is not a tag J9PORT_MEMTAG_HEADER_TAG_CORRUPTED if memoryPointer address is valid tag region but header tag is corrupted. J9PORT_MEMTAG_FOOTER_TAG_CORRUPTED if memoryPointer address is valid tag region but footer tag is corrupted. J9PORT_MEMTAG_FOOTER_PADDING_CORRUPTED if memoryPointer address is valid tag region but footer padding is corrupted. J9PORT_MEMTAG_VALID_TAG if memoryPointer address is valid tag and header/footer are not corrupted.
        Throws:
        CorruptDataException - if the tags are corrupted, or the memory is inaccessible. (Option 3)
        J9MemTagHelper.J9MemTagCheckError
      • checkTagSumCheck

        public static void checkTagSumCheck​(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer tag,
                                            long eyeCatcher)
                                     throws CorruptDataException
        Checks that the memory tag is not corrupt.
        Throws:
        CorruptDataException
      • j9mem_get_memory_base

        public static VoidPointer j9mem_get_memory_base​(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerEyeCatcherAddress)
        Given the address of the headerEyecatcher for the memory block, return the memory pointer that was returned by j9mem_allocate_memory() when the block was allocated.
      • j9mem_get_footer_tag

        public static com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer j9mem_get_footer_tag​(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerEyeCatcherAddress)
                                                                                         throws CorruptDataException
        Given the address of the headerEyecatcher for the memory block, return the address of the corresponding footer tag.
        Throws:
        CorruptDataException
      • j9mem_get_header_tag

        public static com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer j9mem_get_header_tag​(VoidPointer memoryPointer)
        Given the address returned by @ref j9mem_allocate_memory(), return address of the header tag for the memory block
      • checkPadding

        public static void checkPadding​(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerTagAddress)
                                 throws CorruptDataException
        Checks that the padding associated with the memory block has not been corrupted
        Throws:
        CorruptDataException
      • j9mem_get_footer_padding

        public static VoidPointer j9mem_get_footer_padding​(com.ibm.j9ddr.vm29.pointer.generated.J9MemTagPointer headerEyeCatcherAddress)
                                                    throws CorruptDataException
        Given the address of the headerEyecatcher for the memory block, return the address of the footer padding. Note that there not be any padding, in which case this returns the same as @ref j9mem_get_footer_tag(), the address of the footer tag.
        Throws:
        CorruptDataException
      • ROUNDED_FOOTER_OFFSET

        public static UDATA ROUNDED_FOOTER_OFFSET​(UDATA number)