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

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

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 14
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      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

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: