Be able to invoke a MethodHandle directly
Rémi Forax
forax at univ-mlv.fr
Sat Oct 25 07:56:11 PDT 2008
Charles Oliver Nutter a écrit :
> � wrote:
>
>> I know that invokedynamic spec should not be changed because
>> it will improve the backport speed, but is there a use case for that
>> feature ?
>>
>
> The obvious case I know of is simplifying the bootstrap logic; so rather
> than having to create and install a MethodHandle AND invoke a method
> directly yourself, you can just proceed to invoke the MethodHandle. In
> the JRuby invokedynamic code this would be a bit simpler, since I could
> just pass the incoming args straight through, rather than having to pull
> them apart and call direct.
>
Ok, i see.
In your invokedynamic linkage code, you get your method handle, call
setTarget
on the call site and then call it directly to get the return value.
I see problem because the method handle invoke method is
specific (i.e use primtive, typed object, etc.) and you need to call it
with an array
on objects, but I suppose this can be done using convert and collect
adapters.
> - Charlie
>
Ok, so i will implement direct calls in the backport.
Rémi
More information about the mlvm-dev
mailing list