@Override public int getNextClosureId() { return getLexicalParent().getNextClosureId(); }
@Override public int getNextClosureId() { return getLexicalParent().getNextClosureId(); }
@Override public int getNextClosureId() { return getLexicalParent().getNextClosureId(); }
@Override public int getNextClosureId() { return getLexicalParent().getNextClosureId(); }
protected IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix) { super(manager, lexicalParent, null, lineNumber, staticScope); this.startLabel = getNewLabel(prefix + "START"); this.endLabel = getNewLabel(prefix + "END"); this.closureId = lexicalParent.getNextClosureId(); ByteList name = prefix.dup(); name.append(Integer.toString(closureId).getBytes()); setName(manager.getRuntime().newSymbol(name)); this.body = null; }
protected IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix) { super(manager, lexicalParent, null, lineNumber, staticScope); this.startLabel = getNewLabel(prefix + "START"); this.endLabel = getNewLabel(prefix + "END"); this.closureId = lexicalParent.getNextClosureId(); ByteList name = prefix.dup(); name.append(Integer.toString(closureId).getBytes()); setName(manager.getRuntime().newSymbol(name)); this.body = null; }
protected IRClosure(IRManager manager, IRScope lexicalParent, String fileName, int lineNumber, StaticScope staticScope, String prefix) { super(manager, lexicalParent, null, fileName, lineNumber, staticScope); this.isForLoopBody = false; this.startLabel = getNewLabel(prefix + "START"); this.endLabel = getNewLabel(prefix + "END"); this.closureId = lexicalParent.getNextClosureId(); setName(prefix + closureId); this.body = null; this.parameterList = new String[] {}; // set nesting depth int n = 0; IRScope s = this; while (s instanceof IRClosure) { if (!s.isForLoopBody()) n++; s = s.getLexicalParent(); } this.nestingDepth = n; }
protected IRClosure(IRManager manager, IRScope lexicalParent, String fileName, int lineNumber, StaticScope staticScope, String prefix) { super(manager, lexicalParent, null, fileName, lineNumber, staticScope); this.isForLoopBody = false; this.startLabel = getNewLabel(prefix + "START"); this.endLabel = getNewLabel(prefix + "END"); this.closureId = lexicalParent.getNextClosureId(); setName(prefix + closureId); this.body = null; this.parameterList = new String[] {}; // set nesting depth int n = 0; IRScope s = this; while (s instanceof IRClosure) { if (!s.isForLoopBody()) n++; s = s.getLexicalParent(); } this.nestingDepth = n; }
public IRClosure cloneForInlining(CloneInfo ii) { IRClosure clonedClosure; IRScope lexicalParent = ii.getScope(); if (ii instanceof SimpleCloneInfo && !((SimpleCloneInfo)ii).isEnsureBlockCloneMode()) { clonedClosure = new IRClosure(this, lexicalParent, closureId, getName()); } else { int id = lexicalParent.getNextClosureId(); ByteList fullName = lexicalParent.getName().getBytes().dup(); fullName.append(CLOSURE_CLONE); fullName.append(new Integer(id).toString().getBytes()); clonedClosure = new IRClosure(this, lexicalParent, id, getManager().runtime.newSymbol(fullName)); } // WrappedIRClosure should always have a single unique IRClosure in them so we should // not end up adding n copies of the same closure as distinct clones... lexicalParent.addClosure(clonedClosure); return cloneForInlining(ii, clonedClosure); }
public IRClosure cloneForInlining(CloneInfo ii) { IRClosure clonedClosure; IRScope lexicalParent = ii.getScope(); if (ii instanceof SimpleCloneInfo && !((SimpleCloneInfo)ii).isEnsureBlockCloneMode()) { clonedClosure = new IRClosure(this, lexicalParent, closureId, getName()); } else { int id = lexicalParent.getNextClosureId(); ByteList fullName = lexicalParent.getName().getBytes().dup(); fullName.append(CLOSURE_CLONE); fullName.append(new Integer(id).toString().getBytes()); clonedClosure = new IRClosure(this, lexicalParent, id, getManager().runtime.newSymbol(fullName)); } // WrappedIRClosure should always have a single unique IRClosure in them so we should // not end up adding n copies of the same closure as distinct clones... lexicalParent.addClosure(clonedClosure); return cloneForInlining(ii, clonedClosure); }
@Override public IRClosure cloneForInlining(CloneInfo ii) { IRClosure clonedClosure; IRScope lexicalParent = ii.getScope(); if (ii instanceof SimpleCloneInfo) { clonedClosure = new IRFor(this, lexicalParent, closureId, getName()); } else { int id = lexicalParent.getNextClosureId(); ByteList fullName = lexicalParent.getName().getBytes().dup(); fullName.append(FOR_LOOP_CLONE); fullName.append(Integer.toString(id).getBytes()); clonedClosure = new IRFor(this, lexicalParent, id, getManager().getRuntime().newSymbol(fullName)); } return cloneForInlining(ii, clonedClosure); } }
@Override public IRClosure cloneForInlining(CloneInfo ii) { IRClosure clonedClosure; IRScope lexicalParent = ii.getScope(); if (ii instanceof SimpleCloneInfo) { clonedClosure = new IRFor(this, lexicalParent, closureId, getName()); } else { int id = lexicalParent.getNextClosureId(); ByteList fullName = lexicalParent.getName().getBytes().dup(); fullName.append(FOR_LOOP_CLONE); fullName.append(Integer.toString(id).getBytes()); clonedClosure = new IRFor(this, lexicalParent, id, getManager().getRuntime().newSymbol(fullName)); } return cloneForInlining(ii, clonedClosure); } }
/** Used by cloning code */ private IRClosure(IRClosure c, IRScope lexicalParent) { super(c, lexicalParent); this.closureId = lexicalParent.getNextClosureId(); setName("_CLOSURE_CLONE_" + closureId); this.startLabel = getNewLabel(getName() + "_START"); this.endLabel = getNewLabel(getName() + "_END"); this.body = (c.body instanceof InterpretedIRBlockBody19) ? new InterpretedIRBlockBody19(this, c.body.arity(), c.body.getArgumentType()) : new InterpretedIRBlockBody(this, c.body.arity(), c.body.getArgumentType()); this.addedGEBForUncaughtBreaks = false; }
/** Used by cloning code */ private IRClosure(IRClosure c, IRScope lexicalParent) { super(c, lexicalParent); this.closureId = lexicalParent.getNextClosureId(); setName("_CLOSURE_CLONE_" + closureId); this.startLabel = getNewLabel(getName() + "_START"); this.endLabel = getNewLabel(getName() + "_END"); this.body = (c.body instanceof InterpretedIRBlockBody19) ? new InterpretedIRBlockBody19(this, c.body.arity(), c.body.getArgumentType()) : new InterpretedIRBlockBody(this, c.body.arity(), c.body.getArgumentType()); this.addedGEBForUncaughtBreaks = false; }