RFR: 8315247: GenShen: Condition calls to post-write barrier code generation by a flag

Y. Srinivas Ramakrishna ysr at openjdk.org
Tue Aug 29 18:48:23 UTC 2023


On Mon, 28 Aug 2023 20:00:23 GMT, William Kemper <wkemper at openjdk.org> wrote:

> Minor nit - can we have a consistent, more helpful message for the assertions?
> 
> ```
>   assert(ShenandoahHeap::heap()->mode()->is_generational(), "Not needed");
> ```
> 
> Maybe:
> 
> ```
>   assert(ShenandoahHeap::heap()->mode()->is_generational(), "Expected generational mode here");
> ```

Following Kelvin's suggestion, I removed any reference to generational mode in the barrier/generayion code itself, and instead just assert that the `ShenandoahCardBarrier` flag should be set. I am going to look for a suitable place during initialization of non-generational mode to assert that it isn't set. We do check and bail at generational mode initialization if the flag isn't set.

I used the message `Did you mean to enable ShenandoahCardBarrier?` if it isn't enabled, but I could replace it with `Expecting ShenandoahCardBarrier set here` in case that reads better in the error message, or `ShenandoahCardBarrier should be set`.

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

PR Comment: https://git.openjdk.org/shenandoah/pull/313#issuecomment-1696599490


More information about the shenandoah-dev mailing list