// calling a method with a fixed name and // argument type on a (possibly) changing object // as fast as possible static Symbol symbol_bla = toSymbol("bla"); sclass CallSiteCache_oneArg { Class targetClass; Class argType; // set to null if target method is not overloaded MethodHandle mh; } static WeakReference callSite1_cache; if (o != null) { var cache == getWeakRef(callSite1_cache); Class c = o.getClass(); Class argType = _getClass(arg); if (cache != null && cache! == c && (cache.argType == null || cache.argType == argType)) {} else { cache = findCachedMethod(x, symbol_bla, arg); callSite1_cache = weakRef(cache); } invoke(cache.mh, arg); }