public IRScriptBody(IRManager manager, String className, String sourceName, StaticScope staticScope) { super(manager, null, sourceName, sourceName, 0, staticScope); if (!getManager().isDryRun()) { if (staticScope != null) ((IRStaticScope)staticScope).setIRScope(this); } }
public IRScriptBody(IRManager manager, String className, String sourceName, StaticScope staticScope) { super(manager, null, sourceName, sourceName, 0, staticScope); if (!getManager().isDryRun()) { if (staticScope != null) ((IRStaticScope)staticScope).setIRScope(this); } }
public IRMethod(IRManager manager, IRScope lexicalParent, String name, boolean isInstanceMethod, int lineNumber, StaticScope staticScope) { super(manager, lexicalParent, name, lexicalParent.getFileName(), lineNumber, staticScope); this.isInstanceMethod = isInstanceMethod; this.callArgs = new ArrayList<Operand>(); this.argDesc = new ArrayList<String[]>(); if (!getManager().isDryRun()) { if (staticScope != null) ((IRStaticScope)staticScope).setIRScope(this); } }
public IRMethod(IRManager manager, IRScope lexicalParent, String name, boolean isInstanceMethod, int lineNumber, StaticScope staticScope) { super(manager, lexicalParent, name, lexicalParent.getFileName(), lineNumber, staticScope); this.isInstanceMethod = isInstanceMethod; this.callArgs = new ArrayList<Operand>(); this.argDesc = new ArrayList<String[]>(); if (!getManager().isDryRun()) { if (staticScope != null) ((IRStaticScope)staticScope).setIRScope(this); } }
public IRModuleBody(IRManager manager, IRScope lexicalParent, String name, String fileName, int lineNumber, StaticScope scope) { super(manager, lexicalParent, name, fileName, lineNumber, scope); if (!getManager().isDryRun()) { if (scope != null) ((IRStaticScope)scope).setIRScope(this); updateVersion(); } }
public IRModuleBody(IRManager manager, IRScope lexicalParent, String name, String fileName, int lineNumber, StaticScope scope) { super(manager, lexicalParent, name, fileName, lineNumber, scope); if (!getManager().isDryRun()) { if (scope != null) ((IRStaticScope)scope).setIRScope(this); updateVersion(); } }
public IRClosure(IRManager manager, IRScope lexicalParent, boolean isForLoopBody, int lineNumber, StaticScope staticScope, Arity arity, int argumentType, boolean is1_8) { this(manager, lexicalParent, lexicalParent.getFileName(), lineNumber, staticScope, isForLoopBody ? "_FOR_LOOP_" : "_CLOSURE_"); this.isForLoopBody = isForLoopBody; this.blockArgs = new ArrayList<Operand>(); if (getManager().isDryRun()) { this.body = null; } else { this.body = is1_8 ? new InterpretedIRBlockBody(this, arity, argumentType) : new InterpretedIRBlockBody19(this, arity, argumentType); if ((staticScope != null) && !isForLoopBody) ((IRStaticScope)staticScope).setIRScope(this); } // set nesting depth -- after isForLoopBody value is set int n = 0; IRScope s = this; while (s instanceof IRClosure) { if (!s.isForLoopBody()) n++; s = s.getLexicalParent(); } this.nestingDepth = n; }
public IRClosure(IRManager manager, IRScope lexicalParent, boolean isForLoopBody, int lineNumber, StaticScope staticScope, Arity arity, int argumentType, boolean is1_8) { this(manager, lexicalParent, lexicalParent.getFileName(), lineNumber, staticScope, isForLoopBody ? "_FOR_LOOP_" : "_CLOSURE_"); this.isForLoopBody = isForLoopBody; this.blockArgs = new ArrayList<Operand>(); if (getManager().isDryRun()) { this.body = null; } else { this.body = is1_8 ? new InterpretedIRBlockBody(this, arity, argumentType) : new InterpretedIRBlockBody19(this, arity, argumentType); if ((staticScope != null) && !isForLoopBody) ((IRStaticScope)staticScope).setIRScope(this); } // set nesting depth -- after isForLoopBody value is set int n = 0; IRScope s = this; while (s instanceof IRClosure) { if (!s.isForLoopBody()) n++; s = s.getLexicalParent(); } this.nestingDepth = n; }
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, DynamicScope evalScope, Block block, String backtraceName) { if (IRRuntimeHelpers.isDebug()) { LOG.info("CFG:\n" + cfg()); } try { context.pushScope(evalScope); // Since IR introduces additional local vars, we may need to grow the dynamic scope. // To do that, IREvalScript has to tell the dyn-scope how many local vars there are. // Since the same static scope (the scope within which the eval string showed up) // might be shared by multiple eval-scripts, we cannot 'setIRScope(this)' once and // forget about it. We need to set this right before we are ready to grow the // dynamic scope local var space. ((IRStaticScope)getStaticScope()).setIRScope(this); evalScope.growIfNeeded(); // FIXME: Do not push new empty arg array in every time return Interpreter.INTERPRET_EVAL(context, self, this, clazz, new IRubyObject[] {}, backtraceName, block, null); } finally { context.popScope(); } }
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, DynamicScope evalScope, Block block, String backtraceName) { if (IRRuntimeHelpers.isDebug()) { LOG.info("CFG:\n" + cfg()); } try { context.pushScope(evalScope); // Since IR introduces additional local vars, we may need to grow the dynamic scope. // To do that, IREvalScript has to tell the dyn-scope how many local vars there are. // Since the same static scope (the scope within which the eval string showed up) // might be shared by multiple eval-scripts, we cannot 'setIRScope(this)' once and // forget about it. We need to set this right before we are ready to grow the // dynamic scope local var space. ((IRStaticScope)getStaticScope()).setIRScope(this); evalScope.growIfNeeded(); // FIXME: Do not push new empty arg array in every time return Interpreter.INTERPRET_EVAL(context, self, this, clazz, new IRubyObject[] {}, backtraceName, block, null); } finally { context.popScope(); } }