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

Remove unnecessary parameters from G1CollectedHeap::free_region and HeapRegion::hr_clear

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 14
    • 14
    • hotspot
    • gc
    • b27

    Backports

      Description

        The signatures of these two functions can be simplified quite a bit since we always pass in the same values for them.

        void free_region(HeapRegion* hr, FreeRegionList* free_list, bool skip_remset, bool skip_hot_card_cache = false, bool locked = false);

        Here we always pass false for skip_remset and true for locked, so these can be removed. The values are in turn passed into hr_clear() where they are used to determine if we should call clear() or clear_locked() for the remset.

        If we simplify free_region, we can do the same for:
        void hr_clear(bool skip_remset, bool clear_space, bool locked = false);

        There is actually a call to hr_clear where the default value for locked is used, but that is during initialization of the region and at that point we know nobody else can modify the remset so we might as well call clear_locked().

        Attachments

          Issue Links

            Activity

              People

                sjohanss Stefan Johansson
                sjohanss Stefan Johansson
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: