invoke* on a MethodHandle

John Rose John.Rose at Sun.COM
Wed Feb 4 23:29:29 PST 2009


On Feb 2, 2009, at 6:35 AM, Rémi Forax wrote:

> Currently, the mth patch allow to call directly a MethoHandle
> using invokevirtual but also invokeinterface, invokespecial or  
> invokestatic.
>
> I wonder why invokeinterface, invokespecial and invokestatic are  
> allowed
> knowing that MethodHandle is a class ?

That's not intentional.  MethodHandle.invoke is usable only with an  
invokevirtual instruction.

The MHs.find* calls create handles which reify all kinds of callable  
methods (virtual, static, interface, even special when legal).

For convenient browsing and review, I have posted the javadoc  
extracted from the current sources here:

http://webrev.invokedynamic.info/jrose/6655638.meth.jdoc/

This API is not yet official.  Comments would be welcome!

-- John



More information about the mlvm-dev mailing list