Unusually high polymorphic dispatch costs?

Rémi Forax forax at univ-mlv.fr
Mon May 2 07:43:25 PDT 2011


On 05/01/2011 11:01 PM, Mark Roos wrote:
> In the Smalltalk I am porting the solution they use is to just drop 
> the entire chain and let it
> reform.  The assumption would be that for any short time period in the 
> life of a program no sites
> are megamorphic.  the metric they use is the total amount of active 
> code.  Since they actually
> drop all compiled code when it hits 1 meg they have an easy way of 
> determining the active
> code amount.

There are some well known API in which this assumption is not true.
GUI API like Swing (think setVisible) or parser AST visitor (think accept).

I don't know if it's still the case but V8 (google javascript engine) 
was using
a similar idea, it flush all callsites when a full GC occurs.

>
> What I was thinking of was just dropping the gwt chain when it reached 
> some depth.  The
> question is what depth.  I think I'll add a counter to the call site 
> just to see what happens.
>
> It would be nice to have a way to walk the chain but I don't see an 
> method to get the original
> mh from a mh adapter.

MethodHandle reflection is one item of the issue list for JSR 292 the 
return.

>
> regards
> mark

cheers,
Rémi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20110502/1d97a6bb/attachment-0001.html 


More information about the mlvm-dev mailing list