RFR: Refactor budgeting to make the logic cleaner [v2]

Y. Srinivas Ramakrishna ysr at openjdk.org
Sat Jul 2 16:33:11 UTC 2022


On Tue, 28 Jun 2022 21:16:15 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> This commit consolidates computations related to budgeting of reserves for old-gen evacuation and old-gen promotion within shenandoahGeneration::prepare_regions_and_collection_set().  Previously, these computations had been scattered between several functional units, including shenandoahHeuristics::choose_collection_set() and shenandoahOldHeuristics::prime_collection_set().  A previous pull request brought some of the redundant functionality into prepare_regions_and_collection_set().  This pull request removes the redundant computations from the other locations.
>
> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Isolate the code that reserves evacuation budgets into functions

Left a few minor syntactic/stylistic comments.

src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 114:

> 112:   void prepare_gc(bool do_old_gc_bootstrap);
> 113: 
> 114:   // Compute evacuation budgets prior to choosing collection set.

Do these methods need to be public? They looked more like helper methods in the way they are currently being used.

Another thing to think about is whether the reference parameters in one signature and regular ones in the other are potential sources of confusion or error in the future. I can see why they are like they are in their current use, but might indicate that perhaps a cleaner refactoring of the methods and the state that it uses or modifies, and where that state should reside.

Nothing to do at the moment, but worth thinking about.

-------------

PR: https://git.openjdk.org/shenandoah/pull/148


More information about the shenandoah-dev mailing list