private void setupLexicalContainment() { if (manager.isDryRun() || RubyInstanceConfig.IR_WRITING || RubyInstanceConfig.RECORD_LEXICAL_HIERARCHY) { lexicalChildren = new ArrayList<>(1); if (lexicalParent != null) lexicalParent.addChildScope(this); } }
private void setupLexicalContainment() { if (manager.isDryRun() || RubyInstanceConfig.IR_WRITING || RubyInstanceConfig.RECORD_LEXICAL_HIERARCHY) { lexicalChildren = new ArrayList<>(1); if (lexicalParent != null) lexicalParent.addChildScope(this); } }
private final void setupLexicalContainment() { if (manager.isDryRun()) { lexicalChildren = new ArrayList<IRScope>(); if (lexicalParent != null) lexicalParent.addChildScope(this); } }
private final void setupLexicalContainment() { if (manager.isDryRun()) { lexicalChildren = new ArrayList<IRScope>(); if (lexicalParent != null) lexicalParent.addChildScope(this); } }
public IRModuleBody(IRManager manager, IRScope lexicalParent, RubySymbol name, int lineNumber, StaticScope staticScope) { super(manager, lexicalParent, name, lineNumber, staticScope); if (!getManager().isDryRun()) { if (staticScope != null) staticScope.setIRScope(this); } }
public IRModuleBody(IRManager manager, IRScope lexicalParent, RubySymbol name, int lineNumber, StaticScope staticScope) { super(manager, lexicalParent, name, lineNumber, staticScope); if (!getManager().isDryRun()) { if (staticScope != null) 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 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 IRScriptBody(IRManager manager, RubySymbol sourceName, StaticScope staticScope) { super(manager, null, sourceName, 0, staticScope); this.toplevelScope = null; this.fileName = sourceName; if (!getManager().isDryRun() && staticScope != null) { staticScope.setIRScope(this); } }
public IRScriptBody(IRManager manager, RubySymbol sourceName, StaticScope staticScope) { super(manager, null, sourceName, 0, staticScope); this.toplevelScope = null; this.fileName = sourceName; if (!getManager().isDryRun() && staticScope != null) { 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, DefNode defn, RubySymbol name, boolean isInstanceMethod, int lineNumber, StaticScope staticScope, boolean needsCodeCoverage) { super(manager, lexicalParent, name, lineNumber, staticScope); this.defn = defn; this.isInstanceMethod = isInstanceMethod; if (needsCodeCoverage) getFlags().add(IRFlags.CODE_COVERAGE); if (!getManager().isDryRun() && staticScope != null) { staticScope.setIRScope(this); } }
public IRMethod(IRManager manager, IRScope lexicalParent, DefNode defn, RubySymbol name, boolean isInstanceMethod, int lineNumber, StaticScope staticScope, boolean needsCodeCoverage) { super(manager, lexicalParent, name, lineNumber, staticScope); this.defn = defn; this.isInstanceMethod = isInstanceMethod; if (needsCodeCoverage) getFlags().add(IRFlags.CODE_COVERAGE); if (!getManager().isDryRun() && staticScope != null) { 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 IREvalScript(IRManager manager, IRScope lexicalParent, String fileName, int lineNumber, StaticScope staticScope, EvalType evalType) { super(manager, lexicalParent, lineNumber, staticScope, EVAL_); this.evalType = evalType; this.fileName = fileName; if (!getManager().isDryRun() && staticScope != null) { // SSS FIXME: This is awkward! if (evalType == EvalType.MODULE_EVAL) { staticScope.setScopeType(getScopeType()); } else { IRScope s = lexicalParent; while (s instanceof IREvalScript) { s = s.getLexicalParent(); } staticScope.setScopeType(s.getScopeType()); } } }
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, boolean isBeginEndBlock, boolean needsCoverage) { this(manager, lexicalParent, lineNumber, staticScope, prefix); this.signature = signature; lexicalParent.addClosure(this); if (getManager().isDryRun()) { this.body = null; } else { boolean shouldJit = manager.getInstanceConfig().getCompileMode().shouldJIT(); this.body = shouldJit ? new MixedModeIRBlockBody(this, signature) : new InterpretedIRBlockBody(this, signature); if (staticScope != null && !isBeginEndBlock) { staticScope.setIRScope(this); staticScope.setScopeType(this.getScopeType()); } } if (needsCoverage) getFlags().add(IRFlags.CODE_COVERAGE); }
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, boolean isBeginEndBlock, boolean needsCoverage) { this(manager, lexicalParent, lineNumber, staticScope, prefix); this.signature = signature; lexicalParent.addClosure(this); if (getManager().isDryRun()) { this.body = null; } else { boolean shouldJit = manager.getInstanceConfig().getCompileMode().shouldJIT(); this.body = shouldJit ? new MixedModeIRBlockBody(this, signature) : new InterpretedIRBlockBody(this, signature); if (staticScope != null && !isBeginEndBlock) { staticScope.setIRScope(this); staticScope.setScopeType(this.getScopeType()); } } if (needsCoverage) getFlags().add(IRFlags.CODE_COVERAGE); }
/** Used by cloning code */ /* Inlining generates a new name and id and basic cloning will reuse the originals name */ protected IRClosure(IRClosure c, IRScope lexicalParent, int closureId, RubySymbol fullName) { super(c, lexicalParent); this.closureId = closureId; super.setName(fullName); this.startLabel = getNewLabel(getId() + "_START"); this.endLabel = getNewLabel(getId() + "_END"); if (getManager().isDryRun()) { this.body = null; } else { boolean shouldJit = getManager().getInstanceConfig().getCompileMode().shouldJIT(); this.body = shouldJit ? new MixedModeIRBlockBody(c, c.getSignature()) : new InterpretedIRBlockBody(c, c.getSignature()); } this.signature = c.signature; }