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 void cloneInstrs(SimpleCloneInfo ii) { if (!isEmpty()) { List<Instr> oldInstrs = instrs; initInstrs(); for (Instr i: oldInstrs) { instrs.add(i.clone(ii)); } } // Rename the label as well! this.label = ii.getRenamedLabel(this.label); }
public void renameLabel(Label l) { labelRenameMap.put(l, getScope().getNewLabel()); } }
SimpleCloneInfo ii = new SimpleCloneInfo(builder.scope, true); ii.renameLabel(start); for (Instr i: instrs) { if (i instanceof LabelInstr) ii.renameLabel(((LabelInstr)i).getLabel()); builder.addInstr(new LabelInstr(ii.getRenamedLabel(start))); builder.addInstr(new ExceptionRegionStartMarkerInstr(bodyRescuer)); for (Instr instr: instrs) {
private SimpleCloneInfo cloneHostInstrs() { SimpleCloneInfo ii = new SimpleCloneInfo(hostScope, false); for (BasicBlock b : cfg.getBasicBlocks()) { b.cloneInstrs(ii); } return ii; }
@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)); }
SimpleCloneInfo ii = new SimpleCloneInfo(builder.scope, true); ii.renameLabel(start); for (Instr i: instrs) { if (i instanceof LabelInstr) ii.renameLabel(((LabelInstr)i).getLabel()); builder.addInstr(new LabelInstr(ii.getRenamedLabel(start))); builder.addInstr(new ExceptionRegionStartMarkerInstr(bodyRescuer)); for (Instr instr: instrs) {
private SimpleCloneInfo cloneHostInstrs() { SimpleCloneInfo ii = new SimpleCloneInfo(hostScope, false); for (BasicBlock b : cfg.getBasicBlocks()) { b.cloneInstrs(ii); } return ii; }
@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 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; }
private Instr[] cloneInstrs() { SimpleCloneInfo cloneInfo = new SimpleCloneInfo(this, false); Instr[] instructions = interpreterContext.getInstructions(); int length = instructions.length; Instr[] newInstructions = new Instr[length]; for (int i = 0; i < length; i++) { newInstructions[i] = instructions[i].clone(cloneInfo); } return newInstructions; }
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 void cloneInstrs(SimpleCloneInfo ii) { if (!isEmpty()) { List<Instr> oldInstrs = instrs; initInstrs(); for (Instr i: oldInstrs) { instrs.add(i.clone(ii)); } } // Rename the label as well! this.label = ii.getRenamedLabel(this.label); }
public void renameLabel(Label l) { labelRenameMap.put(l, getScope().getNewLabel()); } }
private Instr[] cloneInstrs() { SimpleCloneInfo cloneInfo = new SimpleCloneInfo(this, false); Instr[] instructions = interpreterContext.getInstructions(); int length = instructions.length; Instr[] newInstructions = new Instr[length]; for (int i = 0; i < length; i++) { newInstructions[i] = instructions[i].clone(cloneInfo); } return newInstructions; }
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); }
failurePathBB.addInstr(new JumpInstr(hostCloneInfo == null ? splitBBLabel : hostCloneInfo.getRenamedLabel(splitBBLabel))); call.blockInlining();
public FullInterpreterContext duplicate() { try { CFG newCFG = cfg.clone(new SimpleCloneInfo(getScope(), false, true), getScope()); BasicBlock[] newLinearizedBBList = new BasicBlock[linearizedBBList.length]; for (int i = 0; i < linearizedBBList.length; i++) { newLinearizedBBList[i] = newCFG.getBBForLabel(linearizedBBList[i].getLabel()); } return new FullInterpreterContext(getScope(), newCFG, newLinearizedBBList); } catch (Throwable t) { t.printStackTrace(); return null; } }
failurePathBB.addInstr(new JumpInstr(hostCloneInfo == null ? splitBBLabel : hostCloneInfo.getRenamedLabel(splitBBLabel))); call.blockInlining();
public FullInterpreterContext duplicate() { try { CFG newCFG = cfg.clone(new SimpleCloneInfo(getScope(), false, true), getScope()); BasicBlock[] newLinearizedBBList = new BasicBlock[linearizedBBList.length]; for (int i = 0; i < linearizedBBList.length; i++) { newLinearizedBBList[i] = newCFG.getBBForLabel(linearizedBBList[i].getLabel()); } return new FullInterpreterContext(getScope(), newCFG, newLinearizedBBList); } catch (Throwable t) { t.printStackTrace(); return null; } }