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

G1CollectedHeap::collection_set_iterate_from() has unused code and can be simplified

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • gc
    • generic
    • generic

      G1CollectedHeap::collection_set_iterate_from() has an unnecessary "if" statement
      in which the "then" part can never be executed.

          if (cl->doHeapRegion(cur) && false) {
            cl->incomplete();
            return;
          }

      This can be simplified to

        guarantee(!cl->doHeapRegion(cur), err_msg("doHeapRegion returned true"));

      Also, G1CollectedHeap::collection_set_iterate() can be simplified because none of the callers
      pass a closure where doHeapRegion() returns true.

            Unassigned Unassigned
            jprovino Joseph Provino (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: