this.staticScopeFactory = new IRStaticScopeFactory(this); } else { this.staticScopeFactory = new StaticScopeFactory(this);
public static IRubyObject interpret(Ruby runtime, Node rootNode, IRubyObject self) { if (runtime.is1_9()) IRBuilder.setRubyVersion("1.9"); IRScriptBody root = (IRScriptBody) IRBuilder.createIRBuilder(runtime, runtime.getIRManager()).buildRoot((RootNode) rootNode); // We get the live object ball rolling here. This give a valid value for the top // of this lexical tree. All new scope can then retrieve and set based on lexical parent. if (root.getStaticScope().getModule() == null) { // If an eval this may already be setup. root.getStaticScope().setModule(runtime.getObject()); } RubyModule currModule = root.getStaticScope().getModule(); // Scope state for root? IRStaticScopeFactory.newIRLocalScope(null).setModule(currModule); ThreadContext context = runtime.getCurrentContext(); try { runBeginEndBlocks(root.getBeginBlocks(), context, self, null); // FIXME: No temp vars yet...not needed? InterpretedIRMethod method = new InterpretedIRMethod(root, currModule); IRubyObject rv = method.call(context, self, currModule, "(root)", IRubyObject.NULL_ARRAY); runBeginEndBlocks(root.getEndBlocks(), context, self, null); // FIXME: No temp vars yet...not needed? if ((IRRuntimeHelpers.isDebug() || IRRuntimeHelpers.inProfileMode()) && interpInstrsCount > 10000) { LOG.info("-- Interpreted instructions: {}", interpInstrsCount); /* for (Operation o: opStats.keySet()) { System.out.println(o + " = " + opStats.get(o).count); } */ } return rv; } catch (IRBreakJump bj) { throw IRException.BREAK_LocalJumpError.getException(context.runtime); } }
public static IRubyObject interpret(Ruby runtime, Node rootNode, IRubyObject self) { if (runtime.is1_9()) IRBuilder.setRubyVersion("1.9"); IRScriptBody root = (IRScriptBody) IRBuilder.createIRBuilder(runtime, runtime.getIRManager()).buildRoot((RootNode) rootNode); // We get the live object ball rolling here. This give a valid value for the top // of this lexical tree. All new scope can then retrieve and set based on lexical parent. if (root.getStaticScope().getModule() == null) { // If an eval this may already be setup. root.getStaticScope().setModule(runtime.getObject()); } RubyModule currModule = root.getStaticScope().getModule(); // Scope state for root? IRStaticScopeFactory.newIRLocalScope(null).setModule(currModule); ThreadContext context = runtime.getCurrentContext(); try { runBeginEndBlocks(root.getBeginBlocks(), context, self, null); // FIXME: No temp vars yet...not needed? InterpretedIRMethod method = new InterpretedIRMethod(root, currModule); IRubyObject rv = method.call(context, self, currModule, "(root)", IRubyObject.NULL_ARRAY); runBeginEndBlocks(root.getEndBlocks(), context, self, null); // FIXME: No temp vars yet...not needed? if ((IRRuntimeHelpers.isDebug() || IRRuntimeHelpers.inProfileMode()) && interpInstrsCount > 10000) { LOG.info("-- Interpreted instructions: {}", interpInstrsCount); /* for (Operation o: opStats.keySet()) { System.out.println(o + " = " + opStats.get(o).count); } */ } return rv; } catch (IRBreakJump bj) { throw IRException.BREAK_LocalJumpError.getException(context.runtime); } }
this.staticScopeFactory = new IRStaticScopeFactory(this); } else { this.staticScopeFactory = new StaticScopeFactory(this);
void reinitialize(boolean reinitCore) { this.is1_9 = config.getCompatVersion().is1_9(); this.is2_0 = config.getCompatVersion().is2_0(); this.doNotReverseLookupEnabled = is1_9; if (config.getCompileMode() == CompileMode.OFFIR || config.getCompileMode() == CompileMode.FORCEIR) { this.staticScopeFactory = new IRStaticScopeFactory(this); } else { this.staticScopeFactory = new StaticScopeFactory(this); } this.in = config.getInput(); this.out = config.getOutput(); this.err = config.getError(); this.objectSpaceEnabled = config.isObjectSpaceEnabled(); this.siphashEnabled = config.isSiphashEnabled(); this.profile = config.getProfile(); this.currentDirectory = config.getCurrentDirectory(); this.kcode = config.getKCode(); if (reinitCore) { RubyGlobal.initARGV(this); } }
void reinitialize(boolean reinitCore) { this.is1_9 = config.getCompatVersion().is1_9(); this.is2_0 = config.getCompatVersion().is2_0(); this.doNotReverseLookupEnabled = is1_9; if (config.getCompileMode() == CompileMode.OFFIR || config.getCompileMode() == CompileMode.FORCEIR) { this.staticScopeFactory = new IRStaticScopeFactory(this); } else { this.staticScopeFactory = new StaticScopeFactory(this); } this.in = config.getInput(); this.out = config.getOutput(); this.err = config.getError(); this.objectSpaceEnabled = config.isObjectSpaceEnabled(); this.siphashEnabled = config.isSiphashEnabled(); this.profile = config.getProfile(); this.currentDirectory = config.getCurrentDirectory(); this.kcode = config.getKCode(); if (reinitCore) { RubyGlobal.initARGV(this); } }