/** Returns the object immediately following <code>point</code>. */ @Override public E getSuccOf(E point) { return innerChain.getSuccOf(point); }
/** * Returns the Unit occurring immediately after some other Unit in the block. * * @param aItem * The Unit from which we wish to get it's successor. * @return The successor or null if <code>aItem</code> is the tail for this Block. * */ public Unit getSuccOf(Unit aItem) { Chain<Unit> methodBody = mBody.getUnits(); if (aItem != mTail) { return methodBody.getSuccOf(aItem); } else { return null; } }
/** * "calculates" the length of the given block in Units. * * @param block * @return the size of <code>block</code>. */ private int getSize(Block block) { int size = 0; Chain<Unit> unitChain = body.getUnits(); for (Unit unit = block.getHead(); unit != block.getTail(); unit = unitChain.getSuccOf(unit)) { size++; } size++; // add 1 for the tail we did not take into account. return size; }
/** * Removes a Unit occurring before some other Unit in the Block. * * @param item * A Unit to be remove from the Block's Unit Chain. * @return True if the item could be found and removed. * */ public boolean remove(Unit item) { Chain<Unit> methodBody = mBody.getUnits(); if (item == mHead) { mHead = methodBody.getSuccOf(item); } else if (item == mTail) { mTail = methodBody.getPredOf(item); } return methodBody.remove(item); }
curstmt = (Stmt) units.getSuccOf(curstmt); if (curstmt == null) { return -1;
Unit succ = (Unit) units.getSuccOf(remove); if (debug) { logger.warn("Falling back to immediate chain successor: " + succ + ".");
nextUnit = (Stmt) units.getSuccOf(nextUnit); } while (nextUnit instanceof JNopStmt); if (nextUnit instanceof ReturnStmt || nextUnit instanceof ReturnVoidStmt || nextUnit instanceof ExitMonitorStmt) { CriticalSection newTn = new CriticalSection(false, method, nestLevel + 1); newTn.entermonitor = stmt; newTn.beginning = (Stmt) units.getSuccOf(stmt); if (stmt instanceof EnterMonitorStmt) { newTn.origLock = ((EnterMonitorStmt) stmt).getOp();
stmt = (Stmt) units.getSuccOf(stmt);
Unit lastTrappedUnit = unitChain.getPredOf(firstUntrappedUnit); Unit lastTrappedThrower = null; for (Unit u = firstTrappedUnit; u != null && u != firstUntrappedUnit; u = unitChain.getSuccOf(u)) { if (mightThrowTo(graph, u, trap)) { firstTrappedThrower = u; trap.setEndUnit(unitChain.getSuccOf(lastTrappedThrower));
public static void updateTraps(Unit oldu, Unit newu, Chain<Trap> traps) { int size = traps.size(); if (size == 0) { return; } Trap t = traps.getFirst(); do { if (t.getBeginUnit() == oldu) { t.setBeginUnit(newu); } if (t.getEndUnit() == oldu) { t.setEndUnit(newu); } if (t.getHandlerUnit() == oldu) { t.setHandlerUnit(newu); } } while ((--size > 0) && (t = traps.getSuccOf(t)) != null); }
if (units.getSuccOf(stmt) == target) { stmtIt.remove(); updateCounters(6, true);
Stmt newGoto = Jimple.v().newGotoStmt((Stmt) units.getSuccOf(exitMon)); units.insertAfter(newGoto, exitMon); units.insertAfter(l, newGoto); Trap newTrap = Jimple.v().newTrap(Scene.v().getSootClass("java.lang.Throwable"), stmt, (Stmt) units.getSuccOf(stmt), handlerStmt); b.getTraps().addFirst(newTrap);
Stmt newRet = Jimple.v().newGotoStmt((Stmt) containerUnits.getSuccOf(invokeStmt)); containerUnits.insertBefore(newRet, invokeStmt); System.out.println("adding to stmt map: " + inlineeStmt + " and " + newRet);
Stmt exitPoint = (Stmt) containerUnits.getSuccOf(toInline); Iterator<Unit> it = containerUnits.iterator(containerUnits.getSuccOf(toInline), containerUnits.getPredOf(exitPoint)); Iterator<Unit> it = containerUnits.iterator(containerUnits.getSuccOf(toInline), containerUnits.getPredOf(exitPoint)); ArrayList<Unit> cuCopy = new ArrayList<Unit>(); = containerUnits.iterator(containerUnits.getSuccOf(toInline), containerUnits.getPredOf(exitPoint)); i.hasNext();) { newStmts.add(i.next());
for (s = (Stmt) units.getFirst(); s != null; s = (Stmt) units.getSuccOf(s)) { if (!(s instanceof IfStmt)) { continue;