-
Enhancement
-
Resolution: Unresolved
-
P4
-
9
-
None
Consider implementing special invoker for MH.invokeWithArguments().
Right now, new invoker is created on every invocation.
src/java.base/share/classes/java/lang/invoke/MethodHandle.java:
public Object invokeWithArguments(Object... arguments) throws Throwable {
MethodType invocationType = MethodType.genericMethodType(arguments == null ? 0 : arguments.length);
return invocationType.invokers().spreadInvoker(0).invokeExact(asType(invocationType), arguments);
}
It's still fast (only 5x slower than a direct call) because LambdaForm caching saves lots of work in spreadInvoker(0) case.
Right now, new invoker is created on every invocation.
src/java.base/share/classes/java/lang/invoke/MethodHandle.java:
public Object invokeWithArguments(Object... arguments) throws Throwable {
MethodType invocationType = MethodType.genericMethodType(arguments == null ? 0 : arguments.length);
return invocationType.invokers().spreadInvoker(0).invokeExact(asType(invocationType), arguments);
}
It's still fast (only 5x slower than a direct call) because LambdaForm caching saves lots of work in spreadInvoker(0) case.
- relates to
-
JDK-8067250 [mlvm] vm/mlvm/mixed/stress/regression/b6969574 fails and perf regression
-
- Resolved
-