private static MethodHandle getBlockEscape(Signature signature) { Signature voidSignature = signature.changeReturn(void.class); MethodHandle escape = BLOCK_ESCAPES.get(voidSignature); if (escape == null) { escape = SmartBinder.from(voidSignature) .permute("block") .invoke(ESCAPE_BLOCK) .handle(); BLOCK_ESCAPES.put(voidSignature, escape); } return escape; }
.spread("arg", specificArity) .permute("script", "context", "self", "arg*", "block") .invoke(directCall); } else { variableCall = directCall;
.spread("arg", i) .permute("context", "self", "arg*", "block") .invoke(targets[i]).handle();
.spread("arg", i) .permute("context", "self", "arg*", "block") .invoke(targets[i]).handle();
.spread("arg", specificArity) .permute("script", "context", "self", "arg*", "block") .invoke(directCall); } else { variableCall = directCall;
private static MethodHandle getBlockEscape(Signature signature) { Signature voidSignature = signature.changeReturn(void.class); MethodHandle escape = BLOCK_ESCAPES.get(voidSignature); if (escape == null) { escape = SmartBinder.from(voidSignature) .permute("block") .invoke(ESCAPE_BLOCK) .handle(); BLOCK_ESCAPES.put(voidSignature, escape); } return escape; }
.insert(1, "selfJavaType", self.getClass()) .cast(boolean.class, Object.class, Class.class) .invoke(TEST_CLASS);
public static RubyString string(MutableCallSite site, ByteList value, int cr, ThreadContext context) throws Throwable { MethodHandle handle = SmartBinder .from(STRING_SIGNATURE) .invoke(NEW_STRING_SHARED_HANDLE.apply("byteList", value)) .handle(); site.setTarget(handle); return RubyString.newStringShared(context.runtime, value, cr); }
.insert(1, "selfJavaType", self.getClass()) .cast(boolean.class, Object.class, Class.class) .invoke(TEST_CLASS);
public static RubyString string(MutableCallSite site, ByteList value, int cr, ThreadContext context) throws Throwable { MethodHandle handle = SmartBinder .from(STRING_SIGNATURE) .invoke(NEW_STRING_SHARED_HANDLE.apply("byteList", value)) .handle(); site.setTarget(handle); return RubyString.newStringShared(context.runtime, value, cr); }
.append("frameName", String.class, site.name()); mh = binder.invoke(mh).handle();
.append("frameName", String.class, site.name()); mh = binder.invoke(mh).handle();
SmartHandle smartTarget = targetBinder.invoke(method); if (frame) { smartTarget = SmartHandle
SmartHandle smartTarget = targetBinder.invoke(method); if (frame) { smartTarget = SmartHandle