8287442: Reduce list to array conversions in java.lang.invoke.MethodHandles

Reviewed-by: jvernee
This commit is contained in:
Claes Redestad 2022-06-08 07:18:29 +00:00
parent 5c39a36641
commit ecf00785f2
3 changed files with 43 additions and 40 deletions

View file

@ -973,7 +973,7 @@ abstract class MethodHandleImpl {
int arity = type.parameterCount();
if (arity > 1) {
MethodHandle mh = throwException(type.dropParameterTypes(1, arity));
mh = MethodHandles.dropArguments(mh, 1, Arrays.copyOfRange(type.parameterArray(), 1, arity));
mh = MethodHandles.dropArgumentsTrusted(mh, 1, Arrays.copyOfRange(type.ptypes(), 1, arity));
return mh;
}
return makePairwiseConvert(getFunction(NF_throwException).resolvedHandle(), type, false, true);
@ -1941,7 +1941,7 @@ abstract class MethodHandleImpl {
*
* @return a handle on the constructed {@code try-finally} block.
*/
static MethodHandle makeTryFinally(MethodHandle target, MethodHandle cleanup, Class<?> rtype, List<Class<?>> argTypes) {
static MethodHandle makeTryFinally(MethodHandle target, MethodHandle cleanup, Class<?> rtype, Class<?>[] argTypes) {
MethodType type = MethodType.methodType(rtype, argTypes);
LambdaForm form = makeTryFinallyForm(type.basicType());