RFR: 8314329: AgeTable: add is_clear() & allocation spec, and relax assert to allow use of 0-index slot [v2]

Y. Srinivas Ramakrishna ysr at openjdk.org
Fri Jan 19 18:33:28 UTC 2024


On Fri, 19 Jan 2024 12:08:29 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Y. Srinivas Ramakrishna has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Code review from earthling-amzn: Early return.
>
> src/hotspot/share/gc/shared/ageTable.hpp line 57:
> 
>> 55:   void clear();
>> 56:   // check whether it's clear
>> 57:   bool is_clear() PRODUCT_RETURN0;
> 
> The name seems a "proper" API; why is it only for non-product? Is it because it's for verification only? What's its (intended) use case?

Thanks for taking a look, Albert.

It was indeed intended just for verification/assertion checks.

The use case(s) can be found here in the GenShen repo:

https://github.com/openjdk/shenandoah/blob/5c6f4171efd250ab47695059814a78d7b672a4bd/src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.cpp#L190

and other spots in the same file. They are all for assertion checks. 

I expect that this will be used only for assertions, whenever it is, hence non-product.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17470#discussion_r1459516146


More information about the hotspot-gc-dev mailing list