src/share/classes/java/lang/invoke/LambdaForm.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/classes/java/lang/invoke/LambdaForm.java	Fri Jul 11 20:23:02 2014
--- new/src/share/classes/java/lang/invoke/LambdaForm.java	Fri Jul 11 20:23:02 2014

*** 1145,1155 **** --- 1145,1155 ---- int arity = LambdaForm.signatureArity(sig); MethodType srcType = MethodType.genericMethodType(arity); if (LambdaForm.signatureReturn(sig) == V_TYPE) srcType = srcType.changeReturnType(void.class); MethodTypeForm typeForm = srcType.form(); ! typeForm.namedFunctionInvoker = DirectMethodHandle.make(m); ! typeForm.setCachedMethodHandle(MethodTypeForm.MH_NF_INV, DirectMethodHandle.make(m)); } } } // The following are predefined NamedFunction invokers. The system must build
*** 1243,1261 **** --- 1243,1262 ---- static final MethodType INVOKER_METHOD_TYPE = MethodType.methodType(Object.class, MethodHandle.class, Object[].class); private static MethodHandle computeInvoker(MethodTypeForm typeForm) { MethodHandle mh = typeForm.namedFunctionInvoker; + typeForm = typeForm.basicType().form(); // normalize to basic type + MethodHandle mh = typeForm.cachedMethodHandle(MethodTypeForm.MH_NF_INV); if (mh != null) return mh; MemberName invoker = InvokerBytecodeGenerator.generateNamedFunctionInvoker(typeForm); // this could take a while mh = DirectMethodHandle.make(invoker); ! MethodHandle mh2 = typeForm.namedFunctionInvoker; ! MethodHandle mh2 = typeForm.cachedMethodHandle(MethodTypeForm.MH_NF_INV); if (mh2 != null) return mh2; // benign race if (!mh.type().equals(INVOKER_METHOD_TYPE)) throw newInternalError(mh.debugString()); ! return typeForm.namedFunctionInvoker = mh; ! return typeForm.setCachedMethodHandle(MethodTypeForm.MH_NF_INV, mh); } @Hidden Object invokeWithArguments(Object... arguments) throws Throwable { // If we have a cached invoker, call it right away.

src/share/classes/java/lang/invoke/LambdaForm.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File