RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2]

William Kemper wkemper at openjdk.org
Wed Oct 22 21:17:58 UTC 2025


On Fri, 17 Oct 2025 23:40:24 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits:
>> 
>>  - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage
>>  - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage
>>  - Remove _gc_generation from ShenandoahHeap
>>  - Little cleanup, remove one active generation usage
>>  - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage
>>  - Finish removing usages of gc_generation, start on reducing usages of active_generation
>>  - Fix build
>>  - Use existing _generation field instead of Heap::_gc_generation where possible
>>  - Only shenandoah vm operations participate in active/gc generation scheme
>
> src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp line 174:
> 
>> 172: // contained herein.
>> 173: void ShenandoahGenerationalEvacuationTask::promote_in_place(ShenandoahHeapRegion* region) {
>> 174:   assert(!_generation->is_old(), "Sanity check");
> 
> Would `assert(_generation->is_young()...` be too strong at line 174 for some reason? e.g. could `_generation` be `is_global()` here?
> 
> You could then confidently replace the `_heap->young_generation()` indirection at line 175 below with just `_generation`, also simplifying comprehension complexity & code maintainability.

Right, `_generation` could be global here. Global collections are allowed to promote in place.

> src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp line 55:
> 
>> 53:   explicit VM_ShenandoahOperation(ShenandoahGeneration* generation)
>> 54:   : _gc_id(GCId::current())
>> 55:   , _generation(generation) {
> 
> style question: shouldn't the comma go at the end of the previous line?

Yes (old habits).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2453370865
PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2453372543


More information about the shenandoah-dev mailing list