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

William Kemper wkemper at openjdk.org
Fri Jan 19 00:03:30 UTC 2024


On Wed, 17 Jan 2024 21:56:44 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

> I'd like to propose the following changes to the AgeTable (motivated by the uses in generational shenandoah):

Consider a minor optimization for `is_clear` test.

src/hotspot/share/gc/shared/ageTable.cpp line 77:

> 75: bool AgeTable::is_clear() {
> 76:   size_t total = 0;
> 77:   for (size_t* p = sizes; p < sizes + table_size; ++p) {

Minor optimization: return `false` from the loop as soon as it sees a non-zero `*p`? fall through returns `true`.

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

Marked as reviewed by wkemper (Author).

PR Review: https://git.openjdk.org/jdk/pull/17470#pullrequestreview-1830770260
PR Review Comment: https://git.openjdk.org/jdk/pull/17470#discussion_r1458109656


More information about the hotspot-gc-dev mailing list