--- old/src/java.base/share/classes/java/lang/invoke/MethodHandle.java 2015-01-21 19:20:02.000000000 +0300 +++ new/src/java.base/share/classes/java/lang/invoke/MethodHandle.java 2015-01-21 19:20:02.000000000 +0300 @@ -434,6 +434,8 @@ // form is not private so that invokers can easily fetch it /*private*/ MethodHandle asTypeCache; // asTypeCache is not private so that invokers can easily fetch it + /*non-public*/ byte customizationCount; + // customizationCount should be accessible from invokers /** * Reports the type of this method handle. @@ -1431,6 +1433,17 @@ UNSAFE.fullFence(); } + /** Craft a LambdaForm customized for this particular MethodHandle */ + /*non-public*/ + void customize() { + if (form.customized == null) { + LambdaForm newForm = new LambdaForm(form.debugName, form.arity, form.names, form.result, form.forceInline, this); + updateForm(newForm); + } else { + assert(form.customized == this); + } + } + private static final long FORM_OFFSET; static { try {