Integrated: 8256106: Bypass intrinsic/barrier when calling Reference.get() from Finalizer

Roman Kennke rkennke at openjdk.java.net
Wed Nov 11 18:09:55 UTC 2020


On Tue, 10 Nov 2020 09:37:29 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> Finalizer calls Reference.get() from the Finalizer to acquire the finalizee. Concurrent reference processing GCs like Shenandoah and ZGC would return NULL for unreachable referents, and thus would not call finalize() on them.
> 
> ZGC works around this by fixing the referent before enqueuing, so that the barrier would take the fast-path, but Shenandoah cannot do this.
> 
> It is ok to bypass the barrier altogether in this place, because the FinalReference is inactive and marking and reference-discovery treat inactive FinalReferences like strong references.
> 
> Testing:
>  - [x] hotspot_gc_shenandoah
>  - [x] tier1 +UseShenandoahGC +ShenandoahVerify
>  - [x] tier2 +UseShenandoahGC +ShenandoahVerify
>  - [x] tier1
>  - [x] tier2

This pull request has now been integrated.

Changeset: 96e02610
Author:    Roman Kennke <rkennke at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/96e02610
Stats:     15 lines in 2 files changed: 14 ins; 0 del; 1 mod

8256106: Bypass intrinsic/barrier when calling Reference.get() from Finalizer

Reviewed-by: eosterlund

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

PR: https://git.openjdk.java.net/jdk/pull/1140


More information about the core-libs-dev mailing list