public static MethodHandle getFrameOnlyPre(Signature signature, CallConfiguration callConfig, RubyModule implClass, String name) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound); switch (callConfig) { case FrameFullScopeNone: // before logic return binder .permute("context", "self", "block") .insert(1, arrayOf("selfClass", "name"), arrayOf(RubyModule.class, String.class), implClass, name) .invokeVirtualQuiet(lookup(), "preMethodFrameOnly") .handle(); default: throw new RuntimeException("invalid input: " + callConfig); } }
public static MethodHandle getFrameOnlyPre(Signature signature, CallConfiguration callConfig, RubyModule implClass, String name) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound); switch (callConfig) { case FrameFullScopeNone: // before logic return binder .permute("context", "self", "block") .insert(1, arrayOf("selfClass", "name"), arrayOf(RubyModule.class, String.class), implClass, name) .invokeVirtualQuiet(lookup(), "preMethodFrameOnly") .handle(); default: throw new RuntimeException("invalid input: " + callConfig); } }
private static MethodHandle dynamicCallTarget(Signature from, Signature to) { return SmartBinder .from(from) .fold("selfClass", from.asFold(RubyClass.class).permuteWith(PGC, "context", "self")) .permute(to) .cast(to) .invokeVirtualQuiet(lookup(), "call") .handle(); }
private static MethodHandle dynamicCallTarget(Signature from, Signature to) { return SmartBinder .from(from) .fold("selfClass", from.asFold(RubyClass.class).permuteWith(PGC, "context", "self")) .permute(to) .cast(to) .invokeVirtualQuiet(lookup(), "call") .handle(); }
public static MethodHandle getFramePost(Signature signature, CallConfiguration callConfig) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound)
public static MethodHandle getFramePost(Signature signature, CallConfiguration callConfig) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound)
public static MethodHandle getFramePost(Signature signature, CallConfiguration callConfig) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound)
public static MethodHandle getFramePost(Signature signature, CallConfiguration callConfig) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound)
/** * Pass all arguments to the given function and drop any result. * * @param function a function which will receive all arguments and have its * return value inserted into the call chain * @return a new SmartBinder with the fold applied */ public SmartBinder foldVoid(SmartHandle function) { if (Arrays.equals(signature().argNames(), function.signature().argNames())) { return foldVoid(function.handle()); } else { return foldVoid(signature().asFold(void.class).permuteWith(function).handle()); } }
public static MethodHandle getFramePre(Signature signature, CallConfiguration callConfig, RubyModule implClass, String name, StaticScope scope) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound);
public static MethodHandle getFramePre(Signature signature, CallConfiguration callConfig, RubyModule implClass, String name, StaticScope scope) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound);
public static MethodHandle getFramePre(Signature signature, CallConfiguration callConfig, RubyModule implClass, String name, StaticScope scope) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound);
public static MethodHandle getFramePre(Signature signature, CallConfiguration callConfig, RubyModule implClass, String name, StaticScope scope) { Signature inbound = signature.asFold(void.class); SmartBinder binder = SmartBinder .from(inbound);
.from(signature.asFold(boolean.class)) .permute("self") .insert(1, "selfJavaType", self.getClass())
.from(signature.asFold(boolean.class)) .permute("self") .insert(1, "selfJavaType", self.getClass())
.from(site.signature().asFold(boolean.class)) .permute("self");
.from(site.signature().asFold(boolean.class)) .permute("self");