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

Kelvin Nilsen kdnilsen at openjdk.org
Wed Aug 23 19:54:52 UTC 2023


On Tue, 22 Aug 2023 21:58:57 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> and adding this
>
> This could also be simplified along the lines of my previous suggestion above.
> 
> Also the "if and only if" for state at the beginning here can be simplified to (but continue reading below):
> 
> 
>    assert(has_forwarded_objects() == (_gc_state.is_set(UPDATEREFS | EVACUATION), "Error");
> 
> 
> provided `is_set()` and `is_unset()` (or ideally called `is_clear()`)  methods are defined symmetrically to test all of the bits passed in the mask argument; i.e. `is_set()` answers true iff they are _all_ set, and `is_unset()` returns true iff they are _all_ unset. This will simplify many of the asserts that need to test the state of multiple bits at once.
> 
> That change might want to go in separately as it would affect a bunch of existing code/tests. And, yes, it is possible that that extent of change would be considered unacceptable upstream (but I am guessing it should be fine if made on tip now as a clean-up/refactor).

I'm making this refinement also.

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

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


More information about the shenandoah-dev mailing list