@@ -214,7 +214,6 @@ private static LambdaForm preparedLambdaForm(MemberName m, boolean adaptToSpecia
214214 which = LF_INVSPECIAL_IFC ;
215215 }
216216 LambdaForm lform = preparedLambdaForm (mtype , which );
217- maybeCompile (lform , m );
218217 assert (lform .methodType ().dropParameterTypes (0 , 1 )
219218 .equals (m .getInvocationType ().basicType ()))
220219 : Arrays .asList (m , m .getInvocationType ().basicType (), lform , lform .methodType ());
@@ -320,12 +319,6 @@ static LambdaForm makePreparedLambdaForm(MethodType mtype, int which) {
320319 return null ;
321320 }
322321
323- private static void maybeCompile (LambdaForm lform , MemberName m ) {
324- if (lform .vmentry == null && VerifyAccess .isSamePackage (m .getDeclaringClass (), MethodHandle .class ))
325- // Help along bootstrapping...
326- lform .compileToBytecode ();
327- }
328-
329322 /** Static wrapper for DirectMethodHandle.internalMemberName. */
330323 @ ForceInline
331324 /*non-public*/
@@ -666,7 +659,6 @@ private static LambdaForm preparedFieldLambdaForm(MemberName m) {
666659 formOp += (AF_GETSTATIC_INIT - AF_GETSTATIC );
667660 }
668661 LambdaForm lform = preparedFieldLambdaForm (formOp , isVolatile , ftype );
669- maybeCompile (lform , m );
670662 assert (lform .methodType ().dropParameterTypes (0 , 1 )
671663 .equals (m .getInvocationType ().basicType ()))
672664 : Arrays .asList (m , m .getInvocationType ().basicType (), lform , lform .methodType ());
@@ -843,6 +835,9 @@ static LambdaForm makePreparedFieldLambdaForm(byte formOp, boolean isVolatile, i
843835 }
844836 LambdaForm .associateWithDebugName (form , nameBuilder .toString ());
845837 }
838+
839+ // NF_UNSAFE uses field form, avoid circular dependency in interpreter
840+ form .compileToBytecode ();
846841 return form ;
847842 }
848843
0 commit comments