RFR: 8287442: Reduce list to array conversions in java.lang.invoke.MethodHandles [v2]

Claes Redestad redestad at openjdk.java.net
Fri Jun 3 16:47:37 UTC 2022


On Fri, 3 Jun 2022 15:06:48 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review comments, eagerly convert sooner in tryFinally
>
> src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 5269:
> 
>> 5267:     }
>> 5268: 
>> 5269:     static MethodHandle dropArguments(MethodHandle target, int pos, Class<?>[] valueTypes, boolean trusted) {
> 
> Having a boolean that flips the behaviour makes it harder to know what that `true` or `false` literal at the call site does. I'd suggest splitting this into `dropArgumentsTrusted`, which doesn't clone the array, and `dropArguments` which always makes a copy (and the latter calls former). WDYT?

Yeah, that sounds better.

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

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


More information about the core-libs-dev mailing list