On Mar 6, 2010, at 5:21 PM, Larry Chester wrote:
> Then to invoke on an Object x:
>
> lookup.get(x.getClass()).invokeGeneric(x);
>
> This is quite slow though (although I believe the bottleneck is in the
> invokeGeneric call).
I can certainly believe that: invokeGeneric is not fully implemented yet.
Try this instead:
lookup.put(String.class, func.asType(func.type().generic()));
Then you can call any handler with a fast exact call:
lookup.get(x.getClass()).invoke(x); // x must be an Object
-- John
P.S. The name MH.invoke will be changing to MH.invokeExact, to emphasize the
difference from invokeGeneric.
_______________________________________________
mlvm-dev mailing list
[email protected]
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev