RFR: 8350118: Simplify the layout access VarHandle [v2]
Chen Liang
liach at openjdk.org
Fri Feb 21 22:15:54 UTC 2025
On Fri, 21 Feb 2025 22:11:01 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Review remarks, dates, some more simplifications
>
> src/java.base/share/classes/jdk/internal/foreign/Utils.java line 120:
>
>> 118: * with a {@link ValueLayout#varHandle()} call is cached inside a stable field of the value layout implementation.
>> 119: * This optimizes common code idioms like {@code JAVA_INT.varHandle().getInt(...)}. A second layer of caching
>> 120: * is then provided by this method, so different value layouts with same effects can reuse var handle instances.
>
> I believe this comment is now out of sync? (It talks about two levels of caching --- but there's only one now)
The first level is right, it is the instance field AbstractValueLayout.handle. The static final CHM over there was not mentioned and is now removed
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23720#discussion_r1966265626
More information about the build-dev
mailing list