RFR: 8265079: Implement VarHandle invoker caching [v2]

Paul Sandoz psandoz at openjdk.java.net
Tue Apr 13 15:26:59 UTC 2021


On Tue, 13 Apr 2021 12:25:20 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> This patch implements 2 leftover TODOs for implementing var handle invoker MH caching (lambda forms for those were already shared/cached).
>> 
>> This piggybacks on the existing mechanism for method handle invoker caching.
>> 
>> Testing: Local testing `java/lang/invoke` tests. Tier 1-3
>> 
>> Thanks,
>> Jorn
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comments:
>   - Use boolean instead of index for var handle cache

test/jdk/java/lang/invoke/TestVHInvokerCaching.java line 88:

> 86:         MethodHandles.Lookup lookup = lookup();
> 87: 
> 88:         for (Class<?> type : TEST_TYPES) {

A simpler approach would be to iterate over the fields of `Holder` and use `unreflectVarHandle`, then you can remove `TEST_TYPES`.

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

PR: https://git.openjdk.java.net/jdk/pull/3439


More information about the core-libs-dev mailing list