Request for reviews (M): 6939134: JSR 292 adjustments to method handle invocation

John Rose john.r.rose at
Wed Mar 31 19:21:28 PDT 2010

On Mar 31, 2010, at 6:57 PM, Weijun Wang wrote:

> Can this function be made available through embedded JVM instructions inside a Java source? say --
>    void go() {
>       jvm {
>          invokedynamic a b c
>       }
>    }

If we had an asm feature, yes, it could be used to emit invokedynamic instructions and calls to method handles.

The details are not nearly as simple as your sketch suggests.  A real asm feature would have to manage the import and export of Java values from the part of the stack affected by the assembly code.  I think it would also have to translate between Java-level types and JVM-level type signatures.  But even a well-designed asm feature would be much harder to use than a special language hook.

-- John

More information about the compiler-dev mailing list