RFR: 8256999: Add C2 intrinsic for Reference.refersTo and PhantomReference::refersTo
Aleksey Shipilev
shade at openjdk.java.net
Wed Nov 25 19:54:58 UTC 2020
On Wed, 25 Nov 2020 19:48:40 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>>> I just pulled the fresh master, applied this patch on top, enabled `_PhantomReference_refersTo0` in `c2compiler.cpp`, and ran `CONF=linux-x86_64-server-fastdebug make images run-test TEST=tier1 TEST_VM_OPTS="-XX:+UseShenandoahGC"` without problems.
>>>
>>> @vnkozlov, what Shenandoah failure did you see? Attention @rkennke.
>>
>> @shipilev 2 new tests added by JDK-8188055 does not trigger C2 compilation.
>> You need to run my new test to trigger problem I see:
>>
>> java -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+UseShenandoahGC TestReferenceRefersTo.java
>>
>> # Internal Error (/open/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp:999), pid=2498681, tid=2498694
>> # assert(!is_narrow) failed: phantom access cannot be narrow
>> #
>> # JRE version: Java(TM) SE Runtime Environment (16.0) (fastdebug build 16-internal+0-2020-11-24)
>> # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 16-internal+0-2020-11-24, mixed mode, sharing, compressed oops, shenandoah gc, linux-amd64)
>> # Problematic frame:
>> # V [libjvm.so+0x1862090] ShenandoahBarrierC2Support::call_lrb_stub(Node*&, Node*&, Node*, Node*&, Node*, unsigned long, PhaseIdealLoop*)+0x7e0
>
>> @shipilev 2 new tests added by JDK-8188055 does not trigger C2 compilation.
>
> That sounds like a testbug to me! Since this PR adds C2 intrinsics, I thought it is expected that new tests trigger it in default test configs...
>
>> You need to run my new test to trigger problem I see:
>>
>> ```
>> java -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+UseShenandoahGC TestReferenceRefersTo.java
>>
>> # Internal Error (/open/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp:999), pid=2498681, tid=2498694
>> # assert(!is_narrow) failed: phantom access cannot be narrow
>> #
>
> Right. So new intrinsic introduces the "phantom" access from C2 intrinsic code, and it can be narrow. Shenandoah did not handle that path, because no existing code shapes were exercising it, and it was considered dead. Since it is not dead now, we can simply implement that part like this: http://cr.openjdk.java.net/~shade/shenandoah/8256999-shenandoah-fix.patch.
Your PR have also been bitten by #1427, merge from master to get it fixed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1425
More information about the hotspot-dev
mailing list