throw context.runtime.newLocalJumpError(RubyLocalJumpError.Reason.REDO, context.runtime.getNil(), "unexpected redo");
}
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);
switch (callConfig) {
case FrameFullScopeFull:
// before logic
return binder
.permute("context", "self", "block")
.insert(1, arrayOf("selfClass", "name"), arrayOf(RubyModule.class, String.class), implClass, name)
.insert(5, arrayOf("scope"), arrayOf(StaticScope.class), scope)
.invokeVirtualQuiet(lookup(), "preMethodFrameAndScope")
.handle();
case FrameFullScopeDummy:
// before logic
return binder
.permute("context", "self", "block")
.insert(1, arrayOf("selfClass", "name"), arrayOf(RubyModule.class, String.class), implClass, name)
.insert(5, arrayOf("scope"), arrayOf(StaticScope.class), scope)
.invokeVirtualQuiet(lookup(), "preMethodFrameAndDummyScope")
.handle();
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();
case FrameNoneScopeFull:
// before logic
return binder
.permute("context")
.insert(1, arrayOf("selfClass", "scope"), arrayOf(RubyModule.class, StaticScope.class), implClass, scope)
.invokeVirtualQuiet(lookup(), "preMethodScopeOnly")
.handle();
case FrameNoneScopeDummy:
// before logic
return binder
.permute("context")
.insert(1, arrayOf("selfClass", "scope"), arrayOf(RubyModule.class, StaticScope.class), implClass, scope)
.invokeVirtualQuiet(lookup(), "preMethodNoFrameAndDummyScope")
.handle();