/** * backing bootstrap method with all parameters */ private static CallSite realBootstrap(Lookup caller, String name, int callID, MethodType type, boolean safe, boolean thisCall, boolean spreadCall) { // since indy does not give us the runtime types // we produce first a dummy call site, which then changes the target to one, // that does the method selection including the the direct call to the // real method. MutableCallSite mc = new MutableCallSite(type); MethodHandle mh = makeFallBack(mc,caller.lookupClass(),name,callID,type,safe,thisCall,spreadCall); mc.setTarget(mh); return mc; }
public CallSite bootstrap(Lookup lookup, String name, MethodType type) throws Throwable { MutableCallSite callSite = new MutableCallSite(type); LinkPlan plan = new LinkPlan(this, callSite, lookup, name, type, null); return plan.callSite(); }
public static CallSite checkpointBootstrap(Lookup lookup, String name, MethodType type) throws Throwable { MutableCallSite site = new MutableCallSite(type); MethodHandle handle = lookup.findStatic(Bootstrap.class, "checkpointFallback", methodType(void.class, MutableCallSite.class, ThreadContext.class)); handle = handle.bindTo(site); site.setTarget(handle); return site; }
public static CallSite checkpointBootstrap(Lookup lookup, String name, MethodType type) throws Throwable { MutableCallSite site = new MutableCallSite(type); MethodHandle handle = lookup.findStatic(InvokeDynamicSupport.class, "checkpointFallback", methodType(void.class, MutableCallSite.class, ThreadContext.class)); handle = handle.bindTo(site); site.setTarget(handle); return site; }
public static CallSite checkpointBootstrap(Lookup lookup, String name, MethodType type) throws Throwable { MutableCallSite site = new MutableCallSite(type); MethodHandle handle = lookup.findStatic(Bootstrap.class, "checkpointFallback", methodType(void.class, MutableCallSite.class, ThreadContext.class)); handle = handle.bindTo(site); site.setTarget(handle); return site; }
public static CallSite searchConst(Lookup lookup, String name, MethodType type) { MutableCallSite site = new MutableCallSite(type); String[] bits = name.split(":"); String constName = bits[1]; MethodHandle handle = Binder .from(type) .insert(0, site, constName) .invokeStaticQuiet(MethodHandles.lookup(), Bootstrap.class, "searchConst"); site.setTarget(handle); return site; }
public static CallSite searchConst(Lookup lookup, String name, MethodType type) { MutableCallSite site = new MutableCallSite(type); String[] bits = name.split(":"); String constName = bits[1]; MethodHandle handle = Binder .from(type) .insert(0, site, constName) .invokeStaticQuiet(MethodHandles.lookup(), Bootstrap.class, "searchConst"); site.setTarget(handle); return site; }
public static CallSite symbol(Lookup lookup, String name, MethodType type, String sym) { MutableCallSite site = new MutableCallSite(type); MethodHandle handle = Binder .from(IRubyObject.class, ThreadContext.class) .insert(0, site, sym) .invokeStaticQuiet(MethodHandles.lookup(), Bootstrap.class, "symbol"); site.setTarget(handle); return site; }
public static CallSite flote(Lookup lookup, String name, MethodType type, double value) { MutableCallSite site = new MutableCallSite(type); MethodHandle handle = Binder .from(IRubyObject.class, ThreadContext.class) .insert(0, site, value) .cast(IRubyObject.class, MutableCallSite.class, double.class, ThreadContext.class) .invokeStaticQuiet(MethodHandles.lookup(), Bootstrap.class, "flote"); site.setTarget(handle); return site; }
public static CallSite contextValueString(Lookup lookup, String name, MethodType type, String str) { MutableCallSite site = new MutableCallSite(type); site.setTarget(Binder.from(type).append(site, str).invokeStaticQuiet(lookup, Bootstrap.class, name)); return site; }
public static CallSite contextValueString(Lookup lookup, String name, MethodType type, String str) { MutableCallSite site = new MutableCallSite(type); site.setTarget(Binder.from(type).append(site, str).invokeStaticQuiet(lookup, Bootstrap.class, name)); return site; }
private static MutableCallSite createRuntimeCallSite(String name, MethodType type) { MutableCallSite callsite = new MutableCallSite(type); MethodHandle target = MethodHandles.insertArguments(nativeCallSetupMH, 0, callsite, name); callsite.setTarget(MethodHandles.foldArguments(MethodHandles.exactInvoker(type), target)); return callsite; }
public static CallSite contextValue(Lookup lookup, String name, MethodType type) { MutableCallSite site = new MutableCallSite(type); site.setTarget(Binder.from(type).append(site).invokeStaticQuiet(lookup, Bootstrap.class, name)); return site; }
public static CallSite contextValue(Lookup lookup, String name, MethodType type) { MutableCallSite site = new MutableCallSite(type); site.setTarget(Binder.from(type).append(site).invokeStaticQuiet(lookup, Bootstrap.class, name)); return site; }
public CallSite bootstrap(Lookup lookup, String name, MethodType type, String file, int line, int column) throws Throwable { MutableCallSite callSite = new MutableCallSite(type); LinkPlan plan = new LinkPlan(this, callSite, lookup, name, type, new Location(file, line, column)); return plan.callSite(); }
public static CallSite contextFieldBootstrap(Lookup lookup, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { MutableCallSite site = new MutableCallSite(type); if (name.equals("nil")) { site.setTarget(Binder.from(type).insert(0, site).invokeStatic(lookup, InvokeDynamicSupport.class, "loadNil")); } else if (name.equals("runtime")) { site.setTarget(Binder.from(type).insert(0, site).invokeStatic(lookup, InvokeDynamicSupport.class, "loadRuntime")); } return site; }
public static CallSite string(Lookup lookup, String name, MethodType type, String value, String encodingName, int cr) { MutableCallSite site = new MutableCallSite(type); Binder binder = Binder .from(RubyString.class, ThreadContext.class) .insert(0, arrayOf(MutableCallSite.class, ByteList.class, int.class), site, bytelist(value, encodingName), cr); site.setTarget(binder.invokeStaticQuiet(lookup, Bootstrap.class, "string")); return site; }
public static CallSite fstring(Lookup lookup, String name, MethodType type, String value, String encodingName, int cr, String file, int line) { MutableCallSite site = new MutableCallSite(type); Binder binder = Binder .from(RubyString.class, ThreadContext.class) .insert(0, arrayOf(MutableCallSite.class, ByteList.class, int.class, String.class, int.class), site, bytelist(value, encodingName), cr, file, line); site.setTarget(binder.invokeStaticQuiet(lookup, Bootstrap.class, "frozenString")); return site; }
public static CallSite string(Lookup lookup, String name, MethodType type, String value, String encodingName, int cr) { MutableCallSite site = new MutableCallSite(type); Binder binder = Binder .from(RubyString.class, ThreadContext.class) .insert(0, arrayOf(MutableCallSite.class, ByteList.class, int.class), site, bytelist(value, encodingName), cr); site.setTarget(binder.invokeStaticQuiet(lookup, Bootstrap.class, "string")); return site; }
public static CallSite fstring(Lookup lookup, String name, MethodType type, String value, String encodingName, int cr, String file, int line) { MutableCallSite site = new MutableCallSite(type); Binder binder = Binder .from(RubyString.class, ThreadContext.class) .insert(0, arrayOf(MutableCallSite.class, ByteList.class, int.class, String.class, int.class), site, bytelist(value, encodingName), cr, file, line); site.setTarget(binder.invokeStaticQuiet(lookup, Bootstrap.class, "frozenString")); return site; }