Here it says:
Since 2.1 :
[..]
added the invokedynamic instruction
Thus I suppose that it is possible to write instruction code containing invokedynamics with jasmin. However I could not find any documentation on the jasmin syntax and I just figured out how to use invokedynamic to get VerifyErrors with Jasmin, but not how to create a working example.
How is this instruction correctly used in Jasmin?
Each
invokedynamic
bytecode should refer to a corresponding call site specifier (JVMS 6.5) which is actually a constant pool entry ofCONSTANT_InvokeDynamic
type (JVMS 4.4.10).Jasmin (http://jasmin.sourceforge.net) does not support
CONSTANT_InvokeDynamic
, but Sable/jasmin does. Though usinginvokedynamic
in hand-written assembly is ungrateful job.Here is an example of dynamic method that returns a reference to
System.out
: