> 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

Roman Kennke has updated the pull request with a new target base due to a merge 
or a rebase. The incremental webrev excludes the unrelated changes brought in 
by the merge/rebase. The pull request contains two additional commits since the 
last revision:

 - Merge branch 'master' into JDK-8256106
 - 8256106: Bypass intrinsic/barrier when calling Reference.get() from Finalizer

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/1140/files
  - new: https://git.openjdk.java.net/jdk/pull/1140/files/52820f98..61878147

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1140&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1140&range=00-01

  Stats: 5646 lines in 150 files changed: 3822 ins; 862 del; 962 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1140.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1140/head:pull/1140

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

Reply via email to