public SimpleCloneInfo cloneForCloningClosure(IRClosure clonedClosure) { // If cloning for ensure block cloning we want to propagate that to child closure clones boolean ensureClone = this instanceof SimpleCloneInfo && ((SimpleCloneInfo) this).isEnsureBlockCloneMode(); SimpleCloneInfo clone = new SimpleCloneInfo(clonedClosure, ensureClone); clone.variableRenameMap.putAll(variableRenameMap); return clone; }
public SimpleCloneInfo cloneForCloningClosure(IRClosure clonedClosure) { // If cloning for ensure block cloning we want to propagate that to child closure clones boolean ensureClone = this instanceof SimpleCloneInfo && ((SimpleCloneInfo) this).isEnsureBlockCloneMode(); SimpleCloneInfo clone = new SimpleCloneInfo(clonedClosure, ensureClone); clone.variableRenameMap.putAll(variableRenameMap); return clone; }
@Override public Operand cloneForInlining(CloneInfo info) { // Making interp instrs so that if JIT hits IRClosure we will not concurrently modify the same IRScope. if (info instanceof SimpleCloneInfo && !((SimpleCloneInfo) info).isEnsureBlockCloneMode()) { // FIXME: It really bothers me we do not clone closure here but cloning like main clone case loses interpContext + other things. return new WrappedIRClosure(info.getRenamedVariable(self), closure); } return new WrappedIRClosure(info.getRenamedVariable(self), closure.cloneForInlining(info)); }
@Override public Operand cloneForInlining(CloneInfo info) { // Making interp instrs so that if JIT hits IRClosure we will not concurrently modify the same IRScope. if (info instanceof SimpleCloneInfo && !((SimpleCloneInfo) info).isEnsureBlockCloneMode()) { // FIXME: It really bothers me we do not clone closure here but cloning like main clone case loses interpContext + other things. return new WrappedIRClosure(info.getRenamedVariable(self), closure); } return new WrappedIRClosure(info.getRenamedVariable(self), closure.cloneForInlining(info)); }
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); }