Inlining
Raffaello Giulietti
raffaello.giulietti at gmail.com
Wed Aug 19 09:27:41 PDT 2009
>
> Ugh. I never saw that assert. Maybe John Rose knows more about that one.
>
> -- Christian
> _______________________________________________
> mlvm-dev mailing list
> mlvm-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
I extensively cleaned up and refactored my code, so the error doesn't
happen anymore. This shows that the cause was certainly some bug in my
previous code, which was rather contrived.
The code now depends on direct method handles. The performance factor
with respect to similar Java code dropped from 150-200 with the bound
MHs solution to about 20-30 with direct MHs.
invokedynamic's target is a handle that points to a method in a stub
class. The method dispatches over the receiver's type. The dispatcher
method invokes the ultimate method via a method handle kept in the stub.
This scheme thus implements a simple inline caching solution.
A test program iterates a few million times, invoking the same method on
the same instance, so the method handle kept in the stub is looked up
via the slow path only once.
Is there any other implementor that has implemented a similar scheme for
his/her preferred dynamic language? Do you observe similar costs of
about 1 order of magnitude with respect to Java?
Thanks you all
Raffaello
More information about the mlvm-dev
mailing list