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

G1: Unnecessary NULL check in G1KeepAliveClosure

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • None
    • 9
    • hotspot
    • gc
    • b33

    Backports

      Description

        The null check in the following code is not necessary:

        class G1KeepAliveClosure: public OopClosure {
          ...
          void do_oop(oop* p) {
            oop obj = *p;

            G1CollectedHeap::in_cset_state_t cset_state = _g1->in_cset_state(obj);
            if (obj == NULL || cset_state == G1CollectedHeap::InNeither) {
              return;
            }

        As Thomas pointed out, G1KeepAliveClosure is only called from JNIHandleBlock::weak_oops_do which already filters out NULL values.

        Attachments

          Issue Links

            Activity

              People

                tonyp Tony Printezis
                tonyp Tony Printezis
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: