review for 7050554: JSR 292 - need optimization for selectAlternative

Vladimir Kozlov vladimir.kozlov at
Wed Jun 1 16:38:29 PDT 2011

What about when only one call site could be inlined in bimorhphic case?


Tom Rodriguez wrote:
> 130 lines changed: 74 ins; 20 del; 36 mod; 4493 unchg
> 7050554: JSR 292 - need optimization for selectAlternative
> Reviewed-by:
> JSR 292 provides a GuardWithTest idiom is allow selection between two
> different method handles based on a boolean test.  In earlier versions
> of the JDK code this was done with a bunch of little wrapper methods
> for different arities.  This resulted in a call site for a each call
> which allowed existing constant folding code to statically bind the
> call sites.  Because this didn't scale it was replaced with a new
> idiom that looks more like (test ? a : b).invoke() which only have a
> single call site.  This interferes with inlining making the code
> perform terribly.  We need a new bimorhphic inline for invokedynamic
> callsites to deal with this.  Without it performance of invokedynamic
> for things like jruby is pretty terrible.  Tested with regression
> tests and jruby tests.
> I also fixed a problem in the shared print compilation code where
> attempting to print zombie for an unloaded nmethod causes a segv
> because the method is NULL.

More information about the hotspot-compiler-dev mailing list