RFR: 8160821: VarHandle accesses are penalized when argument conversion is required [v9]

Vladimir Ivanov vlivanov at openjdk.org
Wed Dec 10 22:16:22 UTC 2025


On Wed, 10 Dec 2025 22:09:21 GMT, Chen Liang <liach at openjdk.org> wrote:

>> make/jdk/src/classes/build/tools/methodhandle/VarHandleGuardMethodGenerator.java line 132:
>> 
>>> 130:     // TestZGCBarrierElision.testAtomicThenAtomicAnotherField fails
>>> 131:     // However, testArrayAtomicThenAtomic, testAtomicThenAtomic, and
>>> 132:     // testArrayAtomicThenAtomicAtUnknownIndices works
>> 
>> It doesn't look right. What is the root cause of the failure? Can it be a test bug?
>
> I think that is when two different VarHandles are both invoked non-exactly in two call sites in one method, the 2nd one fails to be inlined, that the compare-and-exchange from the 2nd one is not present in the final IR. The deoptimization reason is either "unstable-if" or "too many null checks", I think I will try look into it in another effort.

If it's a test problem, then it's better to comment out the problematic test case instead.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28585#discussion_r2608398869


More information about the core-libs-dev mailing list