On May 15, 2013, at 10:27 AM, Mark Roos <mr...@roos.com> wrote:

> Just for my learning,  what is the use model for this form of method handle 
> inspection? 

What Remi said...

> Is there some cool technique that this facilitates? 

Yes.  A bootstrap method receives 3 required arguments, a Lookup, String, and 
MethodType.  If you pass it additional optional arguments, they can be 
CONSTANT_MethodHandles.  All such constants are fully local to the Lookup 
object, and can therefore be cracked down to their symbolic reference 
components.

Basically, it means you can use direct method handles (in the context of a 
matching Lookup) for double duty:  As access paths to method invocation (and 
other member usage) and also as well-formed symbolic descriptors.  JSR 335 
implementations use the latter.  The calls look like BSM(lookup, name, mtype, 
[methodhandle]*).

An alternative would be to pass symbolic reference components as 4-tuples of 
BSM arguments:  BSM(lookup, name, mtype, [refkind, refclass, name, type, ]*).  
This has a larger class file footprint, and also does not verify the 
linkability of the symbolic reference.

— John
_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to