Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8278548

G1: Remove unnecessary check in forward_to_block_containing_addr

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 19
    • hotspot
    • gc
    • b03

      `G1BlockOffsetTablePart::forward_to_block_containing_addr` contains the following loop:

      ```
        while (n <= addr) {
          ...
          if (obj->klass_or_null_acquire() == NULL) {
            return q;
          }
          ...
        }
      ```

      The intention of the early-return is to stop parsing the heap if the the current obj has an invaliad klass pointer.

      However, this should never occur because this method is called only for objs in old-gen, and the loop entered only for non-humongous objs.

      Note: humongous objs can have null-klass and it's taken care of in `eapRegion::do_oops_on_memregion_in_humongous`.

            ayang Albert Yang
            ayang Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: