String mname = getNewRescueName();
SkinnyMethodAdapter mv = new SkinnyMethodAdapter(script.getClassVisitor().visitMethod(ACC_PUBLIC | ACC_SYNTHETIC, mname, sig(ret, new Class[]{ThreadContext.class, IRubyObject.class, Block.class}), null, null));
SkinnyMethodAdapter old_method = null;
SkinnyMethodAdapter var_old_method = null;
SkinnyMethodAdapter inv_old_method = null;
Label afterMethodBody = new Label();
Label catchRetry = new Label();
Label catchRaised = new Label();
Label catchJumps = new Label();
Label exitRescue = new Label();
boolean oldWithinProtection = inNestedMethod;
inNestedMethod = true;
Label[] oldLoopLabels = currentLoopLabels;
currentLoopLabels = null;
int oldArgCount = argParamCount;
argParamCount = 0; // synthetic methods always have zero arg parameters
try {
old_method = this.method;
var_old_method = getVariableCompiler().getMethodAdapter();
inv_old_method = getInvocationCompiler().getMethodAdapter();
this.method = mv;
getVariableCompiler().setMethodAdapter(mv);
getInvocationCompiler().setMethodAdapter(mv);
mv.start();
// set up a local IRuby variable
mv.aload(StandardASMCompiler.THREADCONTEXT_INDEX);
mv.dup();
mv.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class));
mv.dup();
mv.astore(getRuntimeIndex());
// store previous exception for restoration if we rescue something
loadRuntime();
invokeUtilityMethod("getErrorInfo", sig(IRubyObject.class, Ruby.class));
mv.astore(getPreviousExceptionIndex());
// grab nil for local variables
mv.invokevirtual(p(Ruby.class), "getNil", sig(IRubyObject.class));
mv.astore(getNilIndex());
mv.invokevirtual(p(ThreadContext.class), "getCurrentScope", sig(DynamicScope.class));
mv.dup();
mv.astore(getDynamicScopeIndex());
mv.invokevirtual(p(DynamicScope.class), "getValues", sig(IRubyObject[].class));
mv.astore(getVarsArrayIndex());
Label beforeBody = new Label();
Label afterBody = new Label();
Label catchBlock = new Label();
mv.trycatch(beforeBody, afterBody, catchBlock, p(exception));
mv.label(beforeBody);
regularCode.branch(this);