RFR: 8299072: java_lang_ref_Reference::clear_referent should be GC agnostic
Erik Österlund
eosterlund at openjdk.org
Tue Dec 20 08:24:48 UTC 2022
On Tue, 20 Dec 2022 08:12:41 GMT, David Holmes <dholmes at openjdk.org> wrote:
> So `clear_referent` is made GC agnostic, but then all the existing GC's are changed to use the original raw version? Why do they not use the GC agnostic version - performance?
The usual reasoning we have is that a GC implementation itself is allowed to use "raw" accesses. Because it knows exactly what it needs to do and when. But the shared runtime code should not do that, because it does not know every GC implementation nor should it have to. Therefore, only the shared runtime part is changed to be GC agnostic. The GC implementation code (in this case reference processors) should continue to use raw accesses.
-------------
PR: https://git.openjdk.org/jdk/pull/11736
More information about the hotspot-dev
mailing list