Be able to invoke a MethodHandle directly
Rémi Forax
forax at univ-mlv.fr
Fri Oct 24 03:13:39 PDT 2008
Hi John,
During the JVM Summit, you say that BGGA closure is the major use case
for allowing to call a MethodHandle directly using its method "invoke".
I don't think it's a good example since BGGA closures are
covariant/contravariant,
so the MethodHandle behind a closure can't be called directly because it
need to be adapted.
So I don't see a 'real' use case for calling a MethodHandle directly.
For the backport, emulate this call is a performance problem because
unlike invokedynamic that requires to use Linkage.registerBootstrapMethod()
on classes that contains at least one invokedynamic call site
there is no such requirement for MethodHandle.invoke()
a MethodHandle.invoke can be done anywhere
so I have to inspect all loaded classes.
I know that invokedynamic spec should not be changed because
it will improve the backport speed, but is there a use case for that
feature ?
Rémi
More information about the mlvm-dev
mailing list