RFR: 8256999: Add C2 intrinsic for Reference.refersTo and PhantomReference::refersTo

Vladimir Ivanov vlivanov at openjdk.java.net
Wed Nov 25 08:21:57 UTC 2020


On Wed, 25 Nov 2020 07:58:42 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> JDK-8188055 added the function Reference.refersTo. For performance, the supporting native methods Reference.refersTo0 and PhantomReference.refersTo0 should be intrinsified by C2.
>> 
>> Initial patch was prepared by @fisk.
>> 
>> Tested hs-tier1-4. Added new compiler tests to test intrinsics.
>> 
>> Ran new test with Shenandoah. Found only one issue. As result I disable  PhantomReference::refersTo intrinsic for COOP+ Shenandoah combination. Someone from Shenandoah team have to test changes if that is enough.
>
> src/hotspot/share/opto/c2compiler.cpp line 476:
> 
>> 474:     if (UseCompressedOops && UseShenandoahGC) return false;
>> 475: #endif
>> 476:     break;
> 
> Is this intended to disable the intrinsic on all non-64-bit platforms? Is that only for Shenandoah 64-bit? I wonder if it should just be:
> 
>   case vmIntrinsics::_PhantomReference_refersTo0:
>     if (UseCompressedOops && UseShenandoahGC) return false;
>     break;

Considering `UseCompressedOops` doesn't make much sense in 32-bit mode and is set to `false`, it seems `#ifdef` can be just dropped.

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

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


More information about the hotspot-dev mailing list