@Override
protected ScriptAndCode execute(final Ruby runtime, final IRScriptBody scope, JRubyClassLoader classLoader) {
JVMVisitor visitor;
byte[] bytecode;
Class compiled;
StaticScope _staticScope;
IRubyObject _runtimeTopSelf;
Method _compiledMethod;
try {
visitor = new JVMVisitor();
bytecode = visitor.compileToBytecode(scope);
compiled = visitor.defineFromBytecode(scope, bytecode, classLoader);
_staticScope = scope.getStaticScope();
_runtimeTopSelf = runtime.getTopSelf();
_staticScope.setModule(_runtimeTopSelf.getMetaClass());
_compiledMethod = compiled.getMethod("__script__", ThreadContext.class,
StaticScope.class, IRubyObject.class, IRubyObject[].class, Block.class, RubyModule.class);
} catch (NotCompilableException nce) {
throw nce;
} catch (Throwable t) {
throw new NotCompilableException("failed to compile script " + scope.getName(), t);
}
final Method compiledMethod = _compiledMethod;
final StaticScope staticScope = _staticScope;
final IRubyObject runtimeTopSelf = _runtimeTopSelf;
Script script = new AbstractScript() {
@Override
public IRubyObject __file__(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {