/** * Terminate this binder by looking up the named virtual method on the * first argument's type. Perform the actual method lookup using the given * Lookup object. If the lookup fails, a RuntimeException will be raised, * containing the actual reason. This method is for convenience in (for * example) field declarations, where checked exceptions noise up code * that can't recover anyway. * * Use this in situations where you would not expect your library to be * usable if the target method can't be acquired. * * @param lookup the Lookup to use for handle lookups * @param name the name of the target virtual method * @return a SmartHandle with this binder's starting signature, bound * to the target method */ public SmartHandle invokeVirtualQuiet(Lookup lookup, String name) { return new SmartHandle(start, binder.invokeVirtualQuiet(lookup, name)); }
private MethodHandle bindToFail() { MethodHandle target; setTarget(target = prepareBinder(false).invokeVirtualQuiet(LOOKUP, "fail")); return target; }
private MethodHandle bindToFail() { MethodHandle target; setTarget(target = prepareBinder(false).invokeVirtualQuiet(LOOKUP, "fail")); return target; }
public CallSite bootstrap(MethodHandles.Lookup lookup) { MethodHandle handle = prepareBinder() .insert(0, this) .invokeVirtualQuiet(lookup, "construct"); setTarget(handle); return this; }
private MethodHandle SMFC() { if (_SMFC != null) return _SMFC; return _SMFC = Binder.from(type()) .insert(0, this) .invokeVirtualQuiet(Bootstrap.LOOKUP, "searchModuleForConst"); }
private MethodHandle ISC() { if (_ISC != null) return _ISC; return _ISC = Binder.from(type()) .insert(0, this) .invokeVirtualQuiet(Bootstrap.LOOKUP, "inheritanceSearchConst"); }
private MethodHandle noCacheISC() { if (_noCacheISC != null) return _noCacheISC; return _noCacheISC = Binder.from(type()) .insert(0, this) .invokeVirtualQuiet(Bootstrap.LOOKUP, "noCacheInheritanceSearchConst"); } }
private MethodHandle noCacheSMFC() { if (_noCacheSMFC != null) return _noCacheSMFC; return _noCacheSMFC = Binder.from(type()) .insert(0, this) .invokeVirtualQuiet(Bootstrap.LOOKUP, "noCacheSearchModuleForConst"); }
/** * Process the incoming arguments by calling the given method on the first * argument, inserting the result as the first argument. * * @param lookup the java.lang.invoke.MethodHandles.Lookup to use * @param method the method to invoke on the first argument * @return a new Binder */ public Binder foldVirtual(MethodHandles.Lookup lookup, String method) { return fold(Binder.from(type()).invokeVirtualQuiet(lookup, method)); }
private MethodHandle noCacheSMFC() { if (_noCacheSMFC != null) return _noCacheSMFC; return _noCacheSMFC = Binder.from(type()) .insert(0, this) .invokeVirtualQuiet(Bootstrap.LOOKUP, "noCacheSearchModuleForConst"); }
private MethodHandle noCacheISC() { if (_noCacheISC != null) return _noCacheISC; return _noCacheISC = Binder.from(type()) .insert(0, this) .invokeVirtualQuiet(Bootstrap.LOOKUP, "noCacheInheritanceSearchConst"); } }
private MethodHandle ISC() { if (_ISC != null) return _ISC; return _ISC = Binder.from(type()) .insert(0, this) .invokeVirtualQuiet(Bootstrap.LOOKUP, "inheritanceSearchConst"); }
private MethodHandle SMFC() { if (_SMFC != null) return _SMFC; return _SMFC = Binder.from(type()) .insert(0, this) .invokeVirtualQuiet(Bootstrap.LOOKUP, "searchModuleForConst"); }
public CallSite bootstrap(MethodHandles.Lookup lookup) { MethodHandle handle = prepareBinder() .insert(0, this) .invokeVirtualQuiet(lookup, "construct"); setTarget(handle); return this; }
public IsTrueSite() { super(TYPE); setTarget(Binder.from(TYPE.insertParameterTypes(0, IsTrueSite.class)).invokeVirtualQuiet(LOOKUP, "init").bindTo(this)); }
public static CallSite constLookup(MethodHandles.Lookup lookup, String searchType, MethodType type, String constName, int publicOnly, int callConstMissing) { ConstantLookupSite site = new ConstantLookupSite(type, constName, publicOnly == 0 ? false : true, callConstMissing == 0 ? false : true); MethodHandle handle = Binder .from(lookup, type) .insert(0, site) .invokeVirtualQuiet(lookup, searchType); site.setTarget(handle); return site; }
public static CallSite constLookup(MethodHandles.Lookup lookup, String searchType, MethodType type, String constName, int publicOnly, int callConstMissing) { ConstantLookupSite site = new ConstantLookupSite(type, constName, publicOnly == 0 ? false : true, callConstMissing == 0 ? false : true); MethodHandle handle = Binder .from(lookup, type) .insert(0, site) .invokeVirtualQuiet(lookup, searchType); site.setTarget(handle); return site; }
public IsNilSite() { super(TYPE); setTarget(Binder.from(TYPE.insertParameterTypes(0, IsNilSite.class)).invokeVirtualQuiet(LOOKUP, "init").bindTo(this)); }
public IsTrueSite() { super(TYPE); setTarget(Binder.from(TYPE.insertParameterTypes(0, IsTrueSite.class)).invokeVirtualQuiet(LOOKUP, "init").bindTo(this)); }
public IsNilSite() { super(TYPE); setTarget(Binder.from(TYPE.insertParameterTypes(0, IsNilSite.class)).invokeVirtualQuiet(LOOKUP, "init").bindTo(this)); }