@Override public String toString() { return "Script: file: " + getFileName() + super.toString(); }
@Override public String toString() { return "Script: file: " + getFileName() + super.toString(); }
@Override public String toString() { return "Script: file: " + getFileName() + super.toString(); }
@Override public String toString() { return "Script: file: " + getFileName() + super.toString(); }
public void emit(IRScriptBody script) { String clsName = jvm.scriptToClass(script.getName()); jvm.pushscript(clsName, script.getFileName()); emitScope(script, "__script__", 0); jvm.cls().visitEnd(); jvm.popclass(); }
public void emit(IRScriptBody script) { String clsName = jvm.scriptToClass(script.getName()); jvm.pushscript(clsName, script.getFileName()); emitScope(script, "__script__", 0); jvm.cls().visitEnd(); jvm.popclass(); }
public R execute(Ruby runtime, ParseResult result, S specificObject) { IRScriptBody scope = null; if (result instanceof IRScriptBody) { // Already have it (likely from read from persistent store). scope = (IRScriptBody) result; } else if (result instanceof RootNode) { // Need to perform create IR from AST // FIXME: In terms of writing and reading we should emit enough to rebuild IC + minimal IRScope state InterpreterContext ic = IRBuilder.buildRoot(runtime.getIRManager(), (RootNode) result); scope = (IRScriptBody) ic.getScope(); scope.setScriptDynamicScope(((RootNode) result).getScope()); if (RubyInstanceConfig.IR_WRITING) { try { IRWriter.persist(new IRWriterStream(IRFileExpert.getIRPersistedFile(scope.getFileName())), scope); } catch (IOException ex) { ex.printStackTrace(); // FIXME: Handle errors better return null; } } } return execute(runtime, scope, specificObject); }
public R execute(Ruby runtime, ParseResult result, S specificObject) { IRScriptBody scope = null; if (result instanceof IRScriptBody) { // Already have it (likely from read from persistent store). scope = (IRScriptBody) result; } else if (result instanceof RootNode) { // Need to perform create IR from AST // FIXME: In terms of writing and reading we should emit enough to rebuild IC + minimal IRScope state InterpreterContext ic = IRBuilder.buildRoot(runtime.getIRManager(), (RootNode) result); scope = (IRScriptBody) ic.getScope(); scope.setScriptDynamicScope(((RootNode) result).getScope()); if (RubyInstanceConfig.IR_WRITING) { try { IRWriter.persist(new IRWriterStream(IRFileExpert.getIRPersistedFile(scope.getFileName())), scope); } catch (IOException ex) { ex.printStackTrace(); // FIXME: Handle errors better return null; } } } return execute(runtime, scope, specificObject); }