again on megamorphic problems

Jochen Theodorou blackdrag at gmx.org
Thu Dec 20 05:10:09 PST 2012


Hi,

let us assume the following example... I have a method foo

public Object foo(Object arg){return bar(arg)}

nothing fancy, quite simple... and let us assume foo is called from 
dozens of places with differing argument types.

If I understood right, then the call site in foo will become 
megamorphic, making it impossible to inline bar into the place from 
where foo is called. foo becomes like a inlining barrier so to say.

The question is now more or less, if I can avoid that problem with 
MethodHandles. I mean the pattern should occur with lamdas more than 
once and I am wondering if there is anything planed to do against this 
or if there has been already done something, or well, if I can bypass 
the problem in indy.

bye Jochen


More information about the mlvm-dev mailing list