RFR(XS): 8072844: Use more efficient LambdaForm type representation

Claes Redestad claes.redestad at oracle.com
Thu Dec 3 10:40:44 UTC 2015


Looks good!

There seem to be quite a bit more that could be fixed to avoid going 
through the signature string, either here or as follow-ups, e.g.:

     LambdaForm prep = getPreparedForm(basicTypeSignature());

     private static LambdaForm getPreparedForm(String sig) {
         MethodType mtype = signatureType(sig);
         LambdaForm prep = 
mtype.form().cachedLambdaForm(MethodTypeForm.LF_INTERPRET);
         if (prep != null)  return prep;
         assert(isValidSignature(sig));
         prep = new LambdaForm(sig);
         prep.vmentry = 
InvokerBytecodeGenerator.generateLambdaFormInterpreterEntryPoint(sig);
         return 
mtype.form().setCachedLambdaForm(MethodTypeForm.LF_INTERPRET, prep);
     }

... could be inlined into prepare() (the only caller) as:

     MethodType mtype = methodType();
     LambdaForm prep = 
mtype.form().cachedLambdaForm(MethodTypeForm.LF_INTERPRET);
     if (prep == null) {
         String sig = basicTypeSignature();
         assert(isValidSignature(sig));
         prep = new LambdaForm(sig);
         prep.vmentry = 
InvokerBytecodeGenerator.generateLambdaFormInterpreterEntryPoint(sig);
         prep = 
mtype.form().setCachedLambdaForm(MethodTypeForm.LF_INTERPRET, prep);
     }
     this.vmEntry = prep;

All-in-all quite small micro-optimizations, but since there are 
startup-sensitive use-cases lining up this seems worthwhile to untangle.

/Claes

On 2015-12-03 11:05, Michael Haupt wrote:
> Dear all,
>
> please review this change.
> RFE: https://bugs.openjdk.java.net/browse/JDK-8072844
> Webrev: http://cr.openjdk.java.net/~mhaupt/8072844/webrev.00
>
> Thanks,
>
> Michael
>




More information about the core-libs-dev mailing list