RFR: 8338688: Shenandoah: Avoid calling java_lang_Class accessors in asserts/verifier

Aleksey Shipilev shade at openjdk.org
Wed Aug 21 16:13:11 UTC 2024


On Tue, 20 Aug 2024 16:55:53 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> In GC verification code, we are not always safe to touch the klass directly. This becomes a problem in Lilliput, where loading klass from the from-space is erroneous. Lilliput would replace `obj->klass()` with `obj->forward_safe_klass()` to make it right in GC code. But accessors like `java_lang_Class` would not be fixed: they would instead rely on barriers to always be called on to-space objects.
> 
> So we are better avoiding using these `java_lang_Class` accessors in GC verification code, and use the loaded `klass` directly. 
> 
> Additional tests:
>  - [x] Linux x86_64 server fastdebug, `hotspot_gc_shenandoah`
>  - [x] Linux x86_64 server fastdebug, `all` with `-XX:+UseShenandoahGC`

Thank you!

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

PR Comment: https://git.openjdk.org/jdk/pull/20651#issuecomment-2302462734


More information about the hotspot-gc-dev mailing list