< prev index next >

src/java.base/share/classes/java/lang/invoke/Invokers.java

Print this page
rev 49207 : 8199471: Enable generation of callSiteForms at link time
Reviewed-by: TBD

@@ -521,11 +521,11 @@
         LambdaForm lform = callSiteForm(mtype, true);
         return lform.vmentry;
     }
 
     // skipCallSite is true if we are optimizing a ConstantCallSite
-    private static LambdaForm callSiteForm(MethodType mtype, boolean skipCallSite) {
+    static LambdaForm callSiteForm(MethodType mtype, boolean skipCallSite) {
         mtype = mtype.basicType();  // normalize Z to I, String to Object, etc.
         final int which = (skipCallSite ? MethodTypeForm.LF_MH_LINKER : MethodTypeForm.LF_CS_LINKER);
         LambdaForm lform = mtype.form().cachedLambdaForm(which);
         if (lform != null)  return lform;
         // exactInvokerForm (Object,Object)Object

@@ -654,12 +654,16 @@
 
     static {
         // The Holder class will contain pre-generated Invokers resolved
         // speculatively using MemberName.getFactory().resolveOrNull. However, that
         // doesn't initialize the class, which subtly breaks inlining etc. By forcing
-        // initialization of the Holder class we avoid these issues.
+        // initialization of the Holder classes we avoid these issues.
         UNSAFE.ensureClassInitialized(Holder.class);
+        UNSAFE.ensureClassInitialized(CSHolder.class);
     }
 
     /* Placeholder class for Invokers generated ahead of time */
     final class Holder {}
+
+    /* Placeholder class for callSiteForms generated ahead of time */
+    final class CSHolder {}
 }
< prev index next >