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; }
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 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 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); }
protected IRClosure cloneForInlining(CloneInfo ii, IRClosure clone) { // SSS FIXME: This is fragile. Untangle this state. // Why is this being copied over to InterpretedIRBlockBody? clone.isBeginEndBlock = this.isBeginEndBlock; SimpleCloneInfo clonedII = ii.cloneForCloningClosure(clone); // if (getCFG() != null) { // clone.setCFG(getCFG().clone(clonedII, clone)); // } else { List<Instr> newInstrs = new ArrayList<>(interpreterContext.getInstructions().length); for (Instr i: interpreterContext.getInstructions()) { newInstrs.add(i.clone(clonedII)); } clone.allocateInterpreterContext(newInstrs); // } return clone; }
protected IRClosure cloneForInlining(CloneInfo ii, IRClosure clone) { // SSS FIXME: This is fragile. Untangle this state. // Why is this being copied over to InterpretedIRBlockBody? clone.isBeginEndBlock = this.isBeginEndBlock; SimpleCloneInfo clonedII = ii.cloneForCloningClosure(clone); // if (getCFG() != null) { // clone.setCFG(getCFG().clone(clonedII, clone)); // } else { List<Instr> newInstrs = new ArrayList<>(interpreterContext.getInstructions().length); for (Instr i: interpreterContext.getInstructions()) { newInstrs.add(i.clone(clonedII)); } clone.allocateInterpreterContext(newInstrs); // } return clone; }
public BasicBlock clone(CloneInfo info, CFG newCFG) { BasicBlock newBB = new BasicBlock(newCFG, info.getRenamedLabel(label)); boolean isClosureClone = info instanceof InlineCloneInfo && ((InlineCloneInfo) info).isClosure(); for (Instr instr: instrs) { Instr newInstr = instr.clone(info); // Inlining clones the original CFG/BBs and we want to maintain ipc since it is how // we find which instr we want (we clone original instr and ipc is our identity). //if (info instanceof SimpleCloneInfo && ((SimpleCloneInfo) info).shouldCloneIPC()) { // newInstr.setIPC(instr.getIPC()); // newInstr.setRPC(instr.getRPC()); //} // All call-derived types do not clone this field. Inliner clones original instrs // and we need this preserved to make sure we do not endless inline the same call. if (instr instanceof CallBase && ((CallBase) instr).inliningBlocked()) { ((CallBase) newInstr).blockInlining(); } if (newInstr != null) { // inliner may kill off unneeded instr newBB.addInstr(newInstr); if (isClosureClone && newInstr instanceof YieldInstr) { ((InlineCloneInfo) info).recordYieldSite(newBB, (YieldInstr) newInstr); } } } return newBB; }
public BasicBlock clone(CloneInfo info, CFG newCFG) { BasicBlock newBB = new BasicBlock(newCFG, info.getRenamedLabel(label)); boolean isClosureClone = info instanceof InlineCloneInfo && ((InlineCloneInfo) info).isClosure(); for (Instr instr: instrs) { Instr newInstr = instr.clone(info); // Inlining clones the original CFG/BBs and we want to maintain ipc since it is how // we find which instr we want (we clone original instr and ipc is our identity). //if (info instanceof SimpleCloneInfo && ((SimpleCloneInfo) info).shouldCloneIPC()) { // newInstr.setIPC(instr.getIPC()); // newInstr.setRPC(instr.getRPC()); //} // All call-derived types do not clone this field. Inliner clones original instrs // and we need this preserved to make sure we do not endless inline the same call. if (instr instanceof CallBase && ((CallBase) instr).inliningBlocked()) { ((CallBase) newInstr).blockInlining(); } if (newInstr != null) { // inliner may kill off unneeded instr newBB.addInstr(newInstr); if (isClosureClone && newInstr instanceof YieldInstr) { ((InlineCloneInfo) info).recordYieldSite(newBB, (YieldInstr) newInstr); } } } return newBB; }
public BasicBlock cloneForInlining(InlineCloneInfo ii) { BasicBlock clonedBB = ii.getOrCreateRenamedBB(this); for (Instr i: getInstrs()) { Instr clonedInstr = i.clone(ii); if (clonedInstr != null) { clonedBB.addInstr(clonedInstr); if (clonedInstr instanceof YieldInstr) { ii.recordYieldSite(clonedBB, (YieldInstr)clonedInstr); } else if (i instanceof NonlocalReturnInstr && clonedInstr instanceof CopyInstr) { // non-local returns assign to method return variable but must jump to proper exit point clonedBB.addInstr(new JumpInstr(ii.getHostScope().getCFG().getExitBB().getLabel())); // FIXME: enebo...I see no guarantee that this copy will be part of a return? This behavior is // masked in any case I can see with optimization to not use a copy but convert non-local to local return. } } } return clonedBB; }
public BasicBlock cloneForInlining(InlineCloneInfo ii) { BasicBlock clonedBB = ii.getOrCreateRenamedBB(this); for (Instr i: getInstrs()) { Instr clonedInstr = i.clone(ii); if (clonedInstr != null) { clonedBB.addInstr(clonedInstr); if (clonedInstr instanceof YieldInstr) { ii.recordYieldSite(clonedBB, (YieldInstr)clonedInstr); } else if (i instanceof NonlocalReturnInstr && clonedInstr instanceof CopyInstr) { // non-local returns assign to method return variable but must jump to proper exit point clonedBB.addInstr(new JumpInstr(ii.getHostScope().getCFG().getExitBB().getLabel())); // FIXME: enebo...I see no guarantee that this copy will be part of a return? This behavior is // masked in any case I can see with optimization to not use a copy but convert non-local to local return. } } } return clonedBB; }
builder.addInstr(new ExceptionRegionStartMarkerInstr(bodyRescuer)); for (Instr instr: instrs) { Instr clonedInstr = instr.clone(ii); if (clonedInstr instanceof CallBase) { CallBase call = (CallBase)clonedInstr;
builder.addInstr(new ExceptionRegionStartMarkerInstr(bodyRescuer)); for (Instr instr: instrs) { Instr clonedInstr = instr.clone(ii); if (clonedInstr instanceof CallBase) { CallBase call = (CallBase)clonedInstr;