On Jan 20, 2011, at 10:08 AM, Rémi Forax wrote:

> You know the type of the parameter and you remember the type if there is a 
> store.

(If there are several reaching stores of differing types, it gets a little 
ugly; there is a single-inheritance LCA.  Little known fact:  Interface types 
on variables are rewritten to Object, and are reasserted on every 
invokeinterface instruction.  So there's no problem with multiple inheritance.)

> invokedynamic is not magic (almost :), it's a way to avoid to do the lookup 
> at each call by
> storing (caching) the target method by protecting it with one or several 
> guards depending on
> the assumptions you have done to find the target method.

The magic overload resolution should go into the next layer up.  Attila wrote a 
version of this.  Sadly, he found that it was difficult to deal with overloads. 
 A key problem is that even if C.m is not overloaded, D.m might be, where D is 
a subclass of C.  This means that inline caches on C.m have to do exact 
receiver typing (this.class == C.class => invoke C.m, to exclude this.class == 
D.class).

-- John

-- 
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.

Reply via email to