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

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

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • CPU:
      generic
    • OS:
      generic

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: