RFR: Refactor budgeting to make the logic cleaner [v2]
Y. Srinivas Ramakrishna
ysr at openjdk.org
Sat Jul 2 16:22:09 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
src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 224:
> 222: }
> 223:
> 224: void ShenandoahGeneration::compute_evacuation_budgets(ShenandoahHeap* heap, ShenandoahCollectionSet* collection_set,
The refactoring of the large chunks of code into the smaller methods is definitely a step in the right direction in making the code easier to follow.
Nit: Would it make the code more readable to consolidate the long sections of comments into a block comment at the top of each of the methods and have much shorter comments in the body of the methods?
-------------
PR: https://git.openjdk.org/shenandoah/pull/148
More information about the shenandoah-dev
mailing list