RFR: JDK-8314777: GenShen: Alias young and old marking bits to legacy Shenandoah marking bit in gc state [v4]

Kelvin Nilsen kdnilsen at openjdk.org
Wed Aug 23 20:54:02 UTC 2023


On Wed, 23 Aug 2023 19:34:35 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> Would this be more succinct and easier to read?
>> 
>> 
>>   if (mode()->is_generational() && is_concurrent_old_mark_in_progress()) {
>>      assert(_gc_state.is_set(MARKING), "Marking flag should be set");
>>      mask = YOUNG_MARKING;
>>   } else {
>>      assert(_gc_state.is_clear(MARKING|OLD_MARKING|YOUNG_MARKING), "All marking flags should be clear");
>>      mask = MARKING | YOUNG_MARKING;
>>   }
>>   set_gc_state_mask(mask, in_progress);
>> 
>> 
>> where `is_set()` and `is_clear()` check if all flag bits in argument are either all set or all clear (which is different from their current sense). See comment below.
>
> pursuing this, but not adding redundant call to is_generational() along the non-ASSERT control path.

Actually, this is too strong.  The suggested assert fails because we may already be doing OLD_MARKING when we start to do the YOUNG_MARKING.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/309#discussion_r1303528339


More information about the shenandoah-dev mailing list