@Override public DynamicMethod dup() { return new InterpretedIRMethod(method, visibility, implementationClass); }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block) { if (IRRuntimeHelpers.isDebug()) doDebug(); if (callCount >= 0) promoteToFullBuild(context); return INTERPRET_METHOD(context, ensureInstrsReady(), getImplementationClass().getMethodLocation(), self, name, block); }
@Override public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block block) { InterpretedIRMethod bodyMethod = (InterpretedIRMethod)moduleBody.retrieve(context, self, currDynScope, temp); RubyModule implClass = bodyMethod.getImplementationClass(); // SSS FIXME: Rather than pass the block implicitly, should we add %block as another operand to ProcessModuleBody, DefineModule instrs? return bodyMethod.call(context, implClass, implClass, "", new IRubyObject[]{}, block); }
private IRubyObject INTERPRET_METHOD(ThreadContext context, InterpreterContext ic, RubyModule implClass, IRubyObject self, String name, IRubyObject[] args, Block block) { try { ThreadContext.pushBacktrace(context, name, ic.getFileName(), context.getLine()); if (ic.hasExplicitCallProtocol()) { return ic.getEngine().interpret(context, null, self, ic, implClass, name, args, block); } else { try { pre(ic, context, self, name, block, implClass); return ic.getEngine().interpret(context, null, self, ic, implClass, name, args, block); } finally { post(ic, context); } } } finally { ThreadContext.popBacktrace(context); } }
public static IRubyObject INTERPRET_METHOD(ThreadContext context, InterpretedIRMethod irMethod, IRubyObject self, String name, IRubyObject[] args, Block block, Block.Type blockType, boolean isTraceable) { Ruby runtime = context.runtime; IRScope scope = irMethod.getIRMethod(); RubyModule implClass = irMethod.getImplementationClass(); Visibility viz = irMethod.getVisibility(); boolean syntheticMethod = name == null || name.equals(""); try { if (!syntheticMethod) ThreadContext.pushBacktrace(context, name, scope.getFileName(), context.getLine()); if (isTraceable) methodPreTrace(runtime, context, name, implClass); return interpret(context, self, scope, viz, implClass, args, block, blockType); } finally { if (isTraceable) { try {methodPostTrace(runtime, context, name, implClass);} finally { if (!syntheticMethod) ThreadContext.popBacktrace(context);} } else { if (!syntheticMethod) ThreadContext.popBacktrace(context); } } }
try { context.preMethodFrameAndScope(getImplementationClass(), name, self, block, method.getStaticScope()); context.setCurrentVisibility(getVisibility()); return Interpreter.INTERPRET_METHOD(context, this, self, name, args, block, null, false); } finally {
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); } }
hs = isHotClosure ? hs.getLexicalParent() : hs; IRScope tgtMethod = ircs.tgtM.getIRMethod(); RubyModule implClass = ircs.tgtM.getImplementationClass(); int classToken = implClass.getGeneration(); String n = tgtMethod.getName();
public InterpretedIRMethod(IRScope method, Visibility visibility, RubyModule implementationClass) { super(method, visibility, implementationClass); // -1 jit.threshold is way of having interpreter not promote full builds. if (Options.JIT_THRESHOLD.load() == -1) callCount = -1; // If we are printing, do the build right at creation time so we can see it if (IRRuntimeHelpers.shouldPrintIR(implementationClass.getRuntime())) { ensureInstrsReady(); } // This is so profiled callsite can access the sites original method (callsites has IRScope in it). method.compilable = this; }
public InterpretedIRMethod(IRScope method, Visibility visibility, RubyModule implementationClass) { super(implementationClass, visibility, CallConfiguration.FrameNoneScopeNone); this.method = method; this.method.getStaticScope().determineModule(); this.arity = calculateArity(); }
private IRubyObject INTERPRET_METHOD(ThreadContext context, InterpreterContext ic, RubyModule implClass, IRubyObject self, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block) { try { ThreadContext.pushBacktrace(context, name, ic.getFileName(), context.getLine()); if (ic.hasExplicitCallProtocol()) { return ic.getEngine().interpret(context, null, self, ic, implClass, name, arg1, arg2, arg3, block); } else { try { pre(ic, context, self, name, block, implClass); return ic.getEngine().interpret(context, null, self, ic, implClass, name, arg1, arg2, arg3, block); } finally { post(ic, context); } } } finally { ThreadContext.popBacktrace(context); } }
public static IRubyObject INTERPRET_METHOD(ThreadContext context, InterpretedIRMethod irMethod, IRubyObject self, String name, IRubyObject[] args, Block block, Block.Type blockType, boolean isTraceable) { Ruby runtime = context.runtime; IRScope scope = irMethod.getIRMethod(); RubyModule implClass = irMethod.getImplementationClass(); Visibility viz = irMethod.getVisibility(); boolean syntheticMethod = name == null || name.equals(""); try { if (!syntheticMethod) ThreadContext.pushBacktrace(context, name, scope.getFileName(), context.getLine()); if (isTraceable) methodPreTrace(runtime, context, name, implClass); return interpret(context, self, scope, viz, implClass, args, block, blockType); } finally { if (isTraceable) { try {methodPostTrace(runtime, context, name, implClass);} finally { if (!syntheticMethod) ThreadContext.popBacktrace(context);} } else { if (!syntheticMethod) ThreadContext.popBacktrace(context); } } }
try { context.preMethodFrameAndScope(getImplementationClass(), name, self, block, method.getStaticScope()); context.setCurrentVisibility(getVisibility()); return Interpreter.INTERPRET_METHOD(context, this, self, name, args, block, null, false); } finally {
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); } }
hs = isHotClosure ? hs.getLexicalParent() : hs; IRScope tgtMethod = ircs.tgtM.getIRMethod(); RubyModule implClass = ircs.tgtM.getImplementationClass(); int classToken = implClass.getGeneration(); String n = tgtMethod.getName();
public InterpretedIRMethod(IRScope method, Visibility visibility, RubyModule implementationClass) { super(method, visibility, implementationClass); // -1 jit.threshold is way of having interpreter not promote full builds. if (Options.JIT_THRESHOLD.load() == -1) callCount = -1; // If we are printing, do the build right at creation time so we can see it if (IRRuntimeHelpers.shouldPrintIR(implementationClass.getRuntime())) { ensureInstrsReady(); } // This is so profiled callsite can access the sites original method (callsites has IRScope in it). method.compilable = this; }
public InterpretedIRMethod(IRScope method, Visibility visibility, RubyModule implementationClass) { super(implementationClass, visibility, CallConfiguration.FrameNoneScopeNone); this.method = method; this.method.getStaticScope().determineModule(); this.arity = calculateArity(); }
@Override public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) { if (IRRuntimeHelpers.isDebug()) doDebug(); if (callCount >= 0) promoteToFullBuild(context); return INTERPRET_METHOD(context, ensureInstrsReady(), getImplementationClass().getMethodLocation(), self, name, arg0, arg1, arg2, block); }
@Override public DynamicMethod dup() { return new InterpretedIRMethod(method, visibility, implementationClass); }
private IRubyObject INTERPRET_METHOD(ThreadContext context, InterpreterContext ic, RubyModule implClass, IRubyObject self, String name, IRubyObject arg1, Block block) { try { ThreadContext.pushBacktrace(context, name, ic.getFileName(), context.getLine()); if (ic.hasExplicitCallProtocol()) { return ic.getEngine().interpret(context, null, self, ic, implClass, name, arg1, block); } else { try { pre(ic, context, self, name, block, implClass); return ic.getEngine().interpret(context, null, self, ic, implClass, name, arg1, block); } finally { post(ic, context); } } } finally { ThreadContext.popBacktrace(context); } }