RFR: 8160821: VarHandle accesses are penalized when argument conversion is required [v13]
John R Rose
jrose at openjdk.org
Sat Jan 24 01:16:48 UTC 2026
On Fri, 23 Jan 2026 20:08:58 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:
>
> Wording update, thanks Jorn
src/java.base/share/classes/java/lang/invoke/VarHandle.java line 2014:
> 2012: // Exists for the adaption mechanism of AccessDescriptor
> 2013: // Each VH should report its explicitly (receiver, coordinates) and
> 2014: // implicitly (static declaring class) used class to MethodHandle.isReachableFrom
Perhaps add a comment: "Classes which define this abstract method should themselves be final or locally sealed, to make it possible to ensure that all relevant classes are taken into account."
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28585#discussion_r2723365226
More information about the hotspot-compiler-dev
mailing list