/** * Replaces the last insn in this block. The provided insn must have * some branchingness. * * @param insn {@code non-null;} rop-form insn to add, which must branch. */ public void replaceLastInsn(Insn insn) { if (insn.getOpcode().getBranchingness() == Rop.BRANCH_NONE) { throw new IllegalArgumentException("last insn must branch"); } SsaInsn oldInsn = insns.get(insns.size() - 1); SsaInsn newInsn = SsaInsn.makeFromRop(insn, this); insns.set(insns.size() - 1, newInsn); parent.onInsnRemoved(oldInsn); parent.onInsnAdded(newInsn); }
/** * Replaces the last insn in this block. The provided insn must have * some branchingness. * * @param insn {@code non-null;} rop-form insn to add, which must branch. */ public void replaceLastInsn(Insn insn) { if (insn.getOpcode().getBranchingness() == Rop.BRANCH_NONE) { throw new IllegalArgumentException("last insn must branch"); } SsaInsn oldInsn = insns.get(insns.size() - 1); SsaInsn newInsn = SsaInsn.makeFromRop(insn, this); insns.set(insns.size() - 1, newInsn); parent.onInsnRemoved(oldInsn); parent.onInsnAdded(newInsn); }
/** * Replaces the last insn in this block. The provided insn must have * some branchingness. * * @param insn {@code non-null;} rop-form insn to add, which must branch. */ public void replaceLastInsn(Insn insn) { if (insn.getOpcode().getBranchingness() == Rop.BRANCH_NONE) { throw new IllegalArgumentException("last insn must branch"); } SsaInsn oldInsn = insns.get(insns.size() - 1); SsaInsn newInsn = SsaInsn.makeFromRop(insn, this); insns.set(insns.size() - 1, newInsn); parent.onInsnRemoved(oldInsn); parent.onInsnAdded(newInsn); }
/** * Replaces the last insn in this block. The provided insn must have * some branchingness. * * @param insn {@code non-null;} rop-form insn to add, which must branch. */ public void replaceLastInsn(Insn insn) { if (insn.getOpcode().getBranchingness() == Rop.BRANCH_NONE) { throw new IllegalArgumentException("last insn must branch"); } SsaInsn oldInsn = insns.get(insns.size() - 1); SsaInsn newInsn = SsaInsn.makeFromRop(insn, this); insns.set(insns.size() - 1, newInsn); parent.onInsnRemoved(oldInsn); parent.onInsnAdded(newInsn); }
/** * Replaces the last insn in this block. The provided insn must have * some branchingness. * * @param insn {@code non-null;} rop-form insn to add, which must branch. */ public void replaceLastInsn(Insn insn) { if (insn.getOpcode().getBranchingness() == Rop.BRANCH_NONE) { throw new IllegalArgumentException("last insn must branch"); } SsaInsn oldInsn = insns.get(insns.size() - 1); SsaInsn newInsn = SsaInsn.makeFromRop(insn, this); insns.set(insns.size() - 1, newInsn); parent.onInsnRemoved(oldInsn); parent.onInsnAdded(newInsn); }
/** * Replaces the last insn in this block. The provided insn must have * some branchingness. * * @param insn {@code non-null;} rop-form insn to add, which must branch. */ public void replaceLastInsn(Insn insn) { if (insn.getOpcode().getBranchingness() == Rop.BRANCH_NONE) { throw new IllegalArgumentException("last insn must branch"); } SsaInsn oldInsn = insns.get(insns.size() - 1); SsaInsn newInsn = SsaInsn.makeFromRop(insn, this); insns.set(insns.size() - 1, newInsn); parent.onInsnRemoved(oldInsn); parent.onInsnAdded(newInsn); }
/** * Replaces the last insn in this block. The provided insn must have * some branchingness. * * @param insn {@code non-null;} rop-form insn to add, which must branch. */ public void replaceLastInsn(Insn insn) { if (insn.getOpcode().getBranchingness() == Rop.BRANCH_NONE) { throw new IllegalArgumentException("last insn must branch"); } SsaInsn oldInsn = insns.get(insns.size() - 1); SsaInsn newInsn = SsaInsn.makeFromRop(insn, this); insns.set(insns.size() - 1, newInsn); parent.onInsnRemoved(oldInsn); parent.onInsnAdded(newInsn); }
/** * Replaces the last insn in this block. The provided insn must have * some branchingness. * * @param insn {@code non-null;} rop-form insn to add, which must branch. */ public void replaceLastInsn(Insn insn) { if (insn.getOpcode().getBranchingness() == Rop.BRANCH_NONE) { throw new IllegalArgumentException("last insn must branch"); } SsaInsn oldInsn = insns.get(insns.size() - 1); SsaInsn newInsn = SsaInsn.makeFromRop(insn, this); insns.set(insns.size() - 1, newInsn); parent.onInsnRemoved(oldInsn); parent.onInsnAdded(newInsn); }
/** * Deletes all insns in the set from this method. * * @param deletedInsns {@code non-null;} insns to delete */ public void deleteInsns(Set<SsaInsn> deletedInsns) { for (SsaBasicBlock block : getBlocks()) { ArrayList<SsaInsn> insns = block.getInsns(); for (int i = insns.size() - 1; i >= 0; i--) { SsaInsn insn = insns.get(i); if (deletedInsns.contains(insn)) { onInsnRemoved(insn); insns.remove(i); } } // Check to see if we need to add a GOTO int insnsSz = insns.size(); SsaInsn lastInsn = (insnsSz == 0) ? null : insns.get(insnsSz - 1); if (block != getExitBlock() && (insnsSz == 0 || lastInsn.getOriginalRopInsn() == null || lastInsn.getOriginalRopInsn().getOpcode() .getBranchingness() == Rop.BRANCH_NONE)) { // We managed to eat a throwable insn Insn gotoInsn = new PlainInsn(Rops.GOTO, SourcePosition.NO_INFO, null, RegisterSpecList.EMPTY); insns.add(SsaInsn.makeFromRop(gotoInsn, block)); } } }
onInsnRemoved(insn); insns.remove(i);
onInsnRemoved(insn); insns.remove(i);
onInsnRemoved(insn); insns.remove(i);
/** * Replaces an SsaInsn containing a PlainInsn with a new PlainInsn. The * new PlainInsn is contructed with a new RegOp and new sources. * * TODO move this somewhere else. * * @param insn {@code non-null;} an SsaInsn containing a PlainInsn * @param newSources {@code non-null;} new sources list for new insn * @param newOpcode A RegOp from {@link RegOps} */ private void replacePlainInsn(NormalSsaInsn insn, RegisterSpecList newSources, int newOpcode) { Insn originalRopInsn = insn.getOriginalRopInsn(); Rop newRop = Rops.ropFor(newOpcode, insn.getResult(), newSources, null); Insn newRopInsn = new PlainInsn(newRop, originalRopInsn.getPosition(), insn.getResult(), newSources); NormalSsaInsn newInsn = new NormalSsaInsn(newRopInsn, insn.getBlock()); List<SsaInsn> insns = insn.getBlock().getInsns(); ssaMeth.onInsnRemoved(insn); insns.set(insns.lastIndexOf(insn), newInsn); ssaMeth.onInsnAdded(newInsn); } }
ssaMeth.onInsnRemoved(insn); insns.set(insns.lastIndexOf(insn), newInsn); ssaMeth.onInsnAdded(newInsn);
ssaMeth.onInsnRemoved(insn); insns.set(insns.lastIndexOf(insn), newInsn); ssaMeth.onInsnAdded(newInsn);
ssaMeth.onInsnRemoved(insn); insns.set(insns.lastIndexOf(insn), newInsn); ssaMeth.onInsnAdded(newInsn);
ssaMeth.onInsnRemoved(insn); insns.set(insns.lastIndexOf(insn), newInsn); ssaMeth.onInsnAdded(newInsn);
ssaMeth.onInsnRemoved(insn); insns.set(insns.lastIndexOf(insn), newInsn); ssaMeth.onInsnAdded(newInsn);
ssaMeth.onInsnRemoved(insn); insns.set(insns.lastIndexOf(insn), newInsn); ssaMeth.onInsnAdded(newInsn);
ssaMeth.onInsnRemoved(insn); insns.set(insns.lastIndexOf(insn), newInsn); ssaMeth.onInsnAdded(newInsn);