jdk7 b58, VM doesn't smell good

Fredrik Öhrström fredrik.ohrstrom at oracle.com
Wed May 13 08:57:13 PDT 2009


John Rose skrev:
>> About the slow down effect, It can be removed by allowing the two way
>> (John's one and Fredrik's one) to call a method handle:
>>  MethodHandle.invoke() that performs a single pointer check and
>>  MethodHandle.apply() that performs a less restrictive/more expensive
>> check.
>>     
>
> Well, that's what MHs.invoke is for!  See the latest javadoc, which I  
> just posted:
>    http://cr.openjdk.java.net/~jrose/pres/indy-javadoc-b59/
>
> (And, I've taken some pains to make it reasonably fast.)
>   

In the fast path (in the generic case) you have
to do at least a single compare to verify that
the method types are compatible. If they differ, then
(unless you are in a real hurry throwing that
WrongMethodTypeException) you could just as
well try the slow case. :-)

//Fredrik




More information about the mlvm-dev mailing list