/** * Clone the instruction (present in a closure) so it can be inlined into another scope. * This requires renaming variables and labels to eliminate naming conflicts. * * @param inlinerInfo This object manages renaming of variables and labels, handles * args and return values. * @return a new instruction that can be used in the target scope. */ public Instr cloneForInlinedClosure(InlinerInfo ii) { return cloneForInlinedScope(ii); }
/** * Clone the instruction (present in a closure) so it can be inlined into another scope. * This requires renaming variables and labels to eliminate naming conflicts. * * @param inlinerInfo This object manages renaming of variables and labels, handles * args and return values. * @return a new instruction that can be used in the target scope. */ public Instr cloneForInlinedClosure(InlinerInfo ii) { return cloneForInlinedScope(ii); }
public BasicBlock cloneForInlinedMethod(InlinerInfo ii) { IRScope hostScope = ii.getInlineHostScope(); BasicBlock clonedBB = ii.getOrCreateRenamedBB(this); for (Instr i: getInstrs()) { Instr clonedInstr = i.cloneForInlinedScope(ii); if (clonedInstr != null) { clonedBB.addInstr(clonedInstr); if (clonedInstr instanceof YieldInstr) ii.recordYieldSite(clonedBB, (YieldInstr)clonedInstr); if (clonedInstr instanceof CallBase) { CallBase call = (CallBase)clonedInstr; Operand block = call.getClosureArg(null); if (block instanceof WrappedIRClosure) hostScope.addClosure(((WrappedIRClosure)block).getClosure()); } } } return clonedBB; }
public BasicBlock cloneForInlinedMethod(InlinerInfo ii) { IRScope hostScope = ii.getInlineHostScope(); BasicBlock clonedBB = ii.getOrCreateRenamedBB(this); for (Instr i: getInstrs()) { Instr clonedInstr = i.cloneForInlinedScope(ii); if (clonedInstr != null) { clonedBB.addInstr(clonedInstr); if (clonedInstr instanceof YieldInstr) ii.recordYieldSite(clonedBB, (YieldInstr)clonedInstr); if (clonedInstr instanceof CallBase) { CallBase call = (CallBase)clonedInstr; Operand block = call.getClosureArg(null); if (block instanceof WrappedIRClosure) hostScope.addClosure(((WrappedIRClosure)block).getClosure()); } } } return clonedBB; }