Few questions about invokeDynamic

Christian Thalinger christian.thalinger at oracle.com
Tue Jan 11 02:32:07 PST 2011


On Jan 10, 2011, at 2:32 PM, Rémi Forax wrote:
>> I just got back to this bug and now that InvokeDynamic is gone how can I rewrite that code to work again (without John's Indify magic)?
>> 
>> -- Christian
>> 
> 
> Good question.
> 
> First, I don't know if this bug is specific to invokedynamic or if the 
> conversion code is shared
> between MetodHandle and invokedynamic. If the code is shared, you can 
> rewrite it using MethodHandle
> because invokedynamic can be rewritten to 
> bootstrap().getTarget().invokeExact(...)
> 
> The other solution is to use this small class:
> http://weblogs.java.net/blog/forax/archive/2011/01/07/call-invokedynamic-java

I tried that but it does not work.  I get an error on invokeExact (and I think I can't use invokeGeneric):

Exception in thread "main" java.dyn.WrongMethodTypeException: ()V cannot be called as ()Z

for:

  assertEquals(false, (boolean) mh.invokeExact());  // void -> boolean

> The last solution is to send enough mails to Brian asking him (he 
> currently own the Java language token)
> to re-introduce a Java syntax for invokedynamic.

Yeah, that would help me a lot :-)

-- Christian


More information about the mlvm-dev mailing list