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

Kim Barrett kbarrett at openjdk.org
Wed Apr 2 18:40:57 UTC 2025


On Wed, 2 Apr 2025 18:33:16 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 three additional commits since the last revision:
> 
>  - remove timeout by using waitForReferenceProcessing
>  - make ill-timed gc in non-concurrent case less likely
>  - fix test package use

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

> 135:             }
> 136:             checkQueue();       // One last check after refproc complete.
> 137:         } catch (InterruptedException e) {

Rather than using Reference.remove with a timeout, I've changed this to use waitForReferenceProcessing.
That removes false passes (from reference processing being slow to deliver) and also removes the delay
until timeout for the passing case.

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

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


More information about the hotspot-dev mailing list