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

Vladimir Ivanov vlivanov at openjdk.org
Fri May 23 23:03:53 UTC 2025


On Tue, 20 May 2025 22:14:42 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/ref/Reference.java line 366:
>> 
>>> 364: 
>>> 365:     /* Implementation of unintrinsified get().  Making get() native may lead
>>> 366:      * C2 to sometimes prefer the native implementation over the intrinsic.
>> 
>> Can you share more details on this?
>
> See review thread slightly above here, specifically https://github.com/openjdk/jdk/pull/24315/files#r2094884157.
> I've looked at the intrinsics for Object.clone() and Object.hashCode(), but only enough to decide I
> understand the approach being taken here better than what's in those.

As I understand, `JDK-8271862` was about migrating to non-virtual intrinsic method.
In case of `Reference::get()`, you already have a virtual public method marked as `@IntrinsicCandidate`. And the patch doesn't change anything there.  So, unless I miss something, I believe the comment is misleading.

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

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


More information about the core-libs-dev mailing list