The execution path through generic method handle invocation (MH.invoke not MH.invokeExact) involves complicate type tests which do not optimize well.
A generic call through a constant MH should fold up all argument adaptations into the call site as inlined operations.
A generic call through a non-constant but monomorphic MH should optimistically use inlined operations. (See JDK-6919064 and JDK-8016581.)
A generic call through an arbitrary MH will be megamorphic, but should quickly locate and run through a well-optimized adapter stub before jumping into the MH.form.vmentry code.
A generic call through a constant MH should fold up all argument adaptations into the call site as inlined operations.
A generic call through a non-constant but monomorphic MH should optimistically use inlined operations. (See JDK-6919064 and JDK-8016581.)
A generic call through an arbitrary MH will be megamorphic, but should quickly locate and run through a well-optimized adapter stub before jumping into the MH.form.vmentry code.
- relates to
-
JDK-7016276 JSR292 MethodHandle invokeExact needs to be fast
- Closed
-
JDK-8024761 JSR 292 improve performance of generic invocation
- Closed