RFR: 8198755: Reduce cost of InvokerBytecodeGenerator::isStaticallyInvocable/-Nameable

Paul Sandoz paul.sandoz at oracle.com
Tue Feb 27 16:42:16 UTC 2018



> On Feb 27, 2018, at 7:42 AM, Claes Redestad <claes.redestad at oracle.com> wrote:
> 
> Hi,
> 
> when generating LF classes with InvokerBytecodeGenerator, almost 5% of executed code is concerned with determining if members and parameters are statically invocable and/or nameable, which we can assert is always true for MethodHandle arguments.
> 

IIRC this is for the case where we can reliably crack open the method handle (from it’s member name) and invoke it directly?


> Since MethodHandle targets and parameters are common, it's a profitable startup optimization to add a fast-path test for this.
> 
> Webrev: http://cr.openjdk.java.net/~redestad/8198755/jdk.00/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8198755
> 


 957         for (int i = 0; i < mtype.parameterCount(); i++)
 958             if (!isStaticallyNameable(mtype.parameterType(i)))

Revert back to: 

         for (Class<?> ptype : mtype.parameterArray())
              if (!isStaticallyNameable(ptype))

?

Paul.


More information about the core-libs-dev mailing list