Method references to same instance+method yield different method reference instances

John Rose john.r.rose at
Wed Jan 22 12:30:24 PST 2014

On Jan 20, 2014, at 10:34 AM, Timo Kinnunen <timo.kinnunen at> wrote:

> why the JVM links two identical invokedynamic instructions separately I don’t know
 * In an application which requires dynamic call sites with individually
 * mutable behaviors, their bootstrap methods should produce distinct
 * {@link java.lang.invoke.CallSite CallSite} objects, one for each linkage request.
 * Alternatively, an application can link a single {@code CallSite} object
 * to several {@code invokedynamic} instructions, in which case
 * a change to the target method will become visible at each of
 * the instructions.

It's a user choice, actually.  But that choice doesn't change Remi's observation about caching.

— John

More information about the lambda-dev mailing list