RFR: 8328626: GenShen: Combine old generation surplus/deficit fields into a single balance field [v2]

William Kemper wkemper at openjdk.org
Mon Mar 25 17:19:45 UTC 2024


On Sat, 23 Mar 2024 02:23:05 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> William Kemper has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fix zero build
>>  - Fix comments
>
> src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp line 136:
> 
>> 134: 
>> 135:   if (old_region_balance < 0) {
>> 136:     const auto old_region_deficit = checked_cast<size_t>(-old_region_balance);
> 
> Like I remarked elsewhere, the code in the if > 0 and if < 0 branches (or if you will, the if and else branches) are largely isomorphic, and can probably be folded together by calling a generic `transfer_from_old(ssize_t num_regions)` on ShenandoahGenerationSizer. The latter new method would be a folding together of the old methods `transfer_to_young()` and `transfer_to_old()`, and would return the `TransferResult` that this method `balance_generations` returns to its caller.

By way of consolation, I was able to consolidate some related code in `ShenandoahGenerationSizer` and move additional generational specific code out of `ShenandoahHeap`.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/410#discussion_r1537946356


More information about the shenandoah-dev mailing list