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

Jorn Vernee jvernee at openjdk.org
Fri Dec 5 11:10:27 UTC 2025


On Thu, 4 Dec 2025 01:48:31 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Since access descriptor is created for each VH operation site, we can optimistically cache the adapted method handle in a site if the site operates on a constant VH.  Used a C2 IR test to verify such a setup through an inexact VarHandle invocation can be constant folded through (previously, it was blocked by `asType`)
>
> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert void special case removal due to C2 shortage causing TestZGCBarrierElision::testAtomicThenAtomicAnotherField failure

Latest version looks much better to me (as mentioned offline). What was the issue with the failing test around the removal of the _V guard template?

Also, looks like the new IR test is failing in GHA

test/hotspot/jtreg/compiler/c2/irTests/constantFold/VarHandleMismatchedTypeFold.java line 48:

> 46:     public static void main(String[] args) {
> 47:         TestFramework.runWithFlags(
> 48:             "-XX:+UnlockExperimentalVMOptions"

Why is this flag needed?

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

PR Review: https://git.openjdk.org/jdk/pull/28585#pullrequestreview-3544230655
PR Review Comment: https://git.openjdk.org/jdk/pull/28585#discussion_r2592287594


More information about the hotspot-dev mailing list