RFR: 8352565: Add native method implementation of Reference.get() [v2]

Brent Christian bchristi at openjdk.org
Tue Apr 1 22:04:09 UTC 2025


On Tue, 1 Apr 2025 09:43:28 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Please review this change which adds a native method providing the
>> implementation of Reference::get.  Referece::get is an intrinsic candidate, so
>> this native method implementation is only used when the intrinsic is not.
>> 
>> Currently there is intrinsic support by the interpreter, C1, C2, and graal,
>> which are always used.  With this change we can later remove all the
>> per-platform interpreter intrinsic implementations, and might also remove the
>> C1 intrinsic implementation.
>> 
>> Testing:
>> (1) mach5 tier1-6 normal (so using all the existing intrinsics).
>> (2) mach5 tier1-6 with interpreter and C1 Reference::get intrinsics disabled.
>
> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
> 
>   parameterized return type of native get0

test/hotspot/jtreg/gc/TestNativeReferenceGet.java line 162:

> 160:         System.out.println("Testing nonconcurrent GC");
> 161:         clearReferents();
> 162:         strengthenReferents();

Might the GC clear refs between `clearReferents()` and `strengthenReferents()`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24315#discussion_r2023735808


More information about the core-libs-dev mailing list