On Nov 2, 2009, at 11:14 AM, Charles Oliver Nutter wrote: > we'll have to hope that JVMs can catch up with > closure-based languages and inline closure calls across intermediate > megamorphic methods.
Yes, this needs work. The pattern is of an algorithm method (like ArrayList.contains) with a crucial megamorphic site that is usually monomorphic with respect to a caller of the algorithm. (If the algorithm is a working with function pointers, we can call it a combinator also.) There ought to be a way to recognize this pattern, customize the algorithm code, and propagate the needed type information from the caller (or its caller or ...) to the megamorphic site. One way to handle this would be to have a mark on such methods @InlineWithProfile directing the JVM to split the inlined method *and* its profile, for each call site. This might be worth an experiment. But the other missing bit would be to have the JVM automatically mark such methods. I have some further ideas about this, and hope some day to post some sketches to the mlvm repo. Another way would be what you may do with JRuby, taking control of bytecode generation and forcing the inlining of the algorithms. - Joh -- 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=.
