Package soot.shimple.internal
Class SPatchingChain
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- soot.PatchingChain<Unit>
-
- soot.UnitPatchingChain
-
- soot.shimple.internal.SPatchingChain
-
- All Implemented Interfaces:
Serializable,Iterable<Unit>,Collection<Unit>,Chain<Unit>
public class SPatchingChain extends UnitPatchingChain
Internal Shimple extension of PatchingChain.- Author:
- Navindra Umanee
- See Also:
PatchingChain, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classSPatchingChain.SPatchingIterator-
Nested classes/interfaces inherited from class soot.PatchingChain
PatchingChain.PatchingIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected BodybodyNeeded to find non-trapped Units of the body.protected Map<SUnitBox,Boolean>boxToNeedsPatchingFlag that indicates whether control flow falls through from the unit referenced in the SUnitBox to the Phi node that owns the SUnitBox.protected Map<UnitBox,Unit>boxToPhiNodeMap from UnitBox to the Phi node owning it.protected booleandebugprotected Set<Unit>phiNodeSetSet of the values of boxToPhiNode.-
Fields inherited from class soot.PatchingChain
innerChain
-
-
Constructor Summary
Constructors Constructor Description SPatchingChain(Body aBody, Chain<Unit> aChain)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Unit o)Adds the given object to this Chain.voidaddFirst(Unit u)Adds the given object at the beginning of the Chain.voidaddLast(Unit u)Adds the given object at the end of the Chain.protected voidcomputeNeedsPatching()ComputesboxToNeedsPatchingwhich maps each UnitBox from a PhiExpr to true if the referenced Unit falls-through to the statement containing the PhiExpr, false otherwise.protected SUnitBoxgetSBox(UnitBox box)voidinsertAfter(Collection<? extends Unit> toInsert, Unit point)InsertstoInsertin the Chain afterpoint.voidinsertAfter(List<Unit> toInsert, Unit point)InsertstoInsertin the Chain afterpoint.voidinsertAfter(Unit toInsert, Unit point)InsertstoInsertin the Chain afterpoint.voidinsertAfter(Chain<Unit> toInsert, Unit point)InsertstoInsertin the Chain afterpoint.voidinsertBefore(Collection<? extends Unit> toInsert, Unit point)InsertstoInsertin the Chain beforepoint.voidinsertBefore(List<Unit> toInsert, Unit point)InsertstoInsertin the Chain beforepoint.voidinsertBefore(Unit toInsert, Unit point)InsertstoInsertin the Chain beforepoint.voidinsertBefore(Chain<Unit> toInsert, Unit point)InsertstoInsertin the Chain beforepoint.Iterator<Unit>iterator()Returns an iterator over this Chain.Iterator<Unit>iterator(Unit u)Returns an iterator over this Chain, starting at the given object.Iterator<Unit>iterator(Unit head, Unit tail)Returns an iterator over this Chain, starting at head and reaching tail (inclusive).protected static voidpatchAfterRemoval(Unit removing)protected voidprocessPhiNode(Unit phiNode)booleanremove(Object obj)Removes the given object from this Chain.booleanremove(Unit u)protected voidreprocessPhiNodes()voidswapWith(Unit out, Unit in)Replacesoutin the Chain byin.-
Methods inherited from class soot.UnitPatchingChain
insertOnEdge, insertOnEdge, insertOnEdge, insertOnEdge
-
Methods inherited from class soot.PatchingChain
contains, follows, getElementsUnsorted, getFirst, getLast, getModificationCount, getNonPatchingChain, getPredOf, getSuccOf, insertBeforeNoRedirect, insertBeforeNoRedirect, patchBeforeRemoval, removeFirst, removeLast, size, snapshotIterator
-
Methods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
-
-
-
Method Detail
-
add
public boolean add(Unit o)
Description copied from class:PatchingChainAdds the given object to this Chain.- Specified by:
addin interfaceCollection<Unit>- Overrides:
addin classPatchingChain<Unit>
-
swapWith
public void swapWith(Unit out, Unit in)
Description copied from class:PatchingChainReplacesoutin the Chain byin.
-
insertAfter
public void insertAfter(Unit toInsert, Unit point)
Description copied from class:PatchingChainInsertstoInsertin the Chain afterpoint.- Specified by:
insertAfterin interfaceChain<Unit>- Overrides:
insertAfterin classPatchingChain<Unit>
-
insertAfter
public void insertAfter(List<Unit> toInsert, Unit point)
Description copied from class:PatchingChainInsertstoInsertin the Chain afterpoint.- Specified by:
insertAfterin interfaceChain<Unit>- Overrides:
insertAfterin classPatchingChain<Unit>
-
insertAfter
public void insertAfter(Chain<Unit> toInsert, Unit point)
Description copied from interface:ChainInsertstoInsertin the Chain afterpoint.- Specified by:
insertAfterin interfaceChain<Unit>- Overrides:
insertAfterin classPatchingChain<Unit>
-
insertAfter
public void insertAfter(Collection<? extends Unit> toInsert, Unit point)
Description copied from interface:ChainInsertstoInsertin the Chain afterpoint.- Specified by:
insertAfterin interfaceChain<Unit>- Overrides:
insertAfterin classPatchingChain<Unit>
-
insertBefore
public void insertBefore(Unit toInsert, Unit point)
Description copied from class:PatchingChainInsertstoInsertin the Chain beforepoint.- Specified by:
insertBeforein interfaceChain<Unit>- Overrides:
insertBeforein classPatchingChain<Unit>
-
insertBefore
public void insertBefore(List<Unit> toInsert, Unit point)
Description copied from class:PatchingChainInsertstoInsertin the Chain beforepoint.- Specified by:
insertBeforein interfaceChain<Unit>- Overrides:
insertBeforein classPatchingChain<Unit>
-
insertBefore
public void insertBefore(Chain<Unit> toInsert, Unit point)
Description copied from class:PatchingChainInsertstoInsertin the Chain beforepoint.- Specified by:
insertBeforein interfaceChain<Unit>- Overrides:
insertBeforein classPatchingChain<Unit>
-
insertBefore
public void insertBefore(Collection<? extends Unit> toInsert, Unit point)
Description copied from interface:ChainInsertstoInsertin the Chain beforepoint.- Specified by:
insertBeforein interfaceChain<Unit>- Overrides:
insertBeforein classPatchingChain<Unit>
-
addFirst
public void addFirst(Unit u)
Description copied from class:PatchingChainAdds the given object at the beginning of the Chain.
-
addLast
public void addLast(Unit u)
Description copied from class:PatchingChainAdds the given object at the end of the Chain.
-
remove
public boolean remove(Unit u)
-
remove
public boolean remove(Object obj)
Description copied from class:PatchingChainRemoves the given object from this Chain.- Specified by:
removein interfaceChain<Unit>- Specified by:
removein interfaceCollection<Unit>- Overrides:
removein classPatchingChain<Unit>
-
patchAfterRemoval
protected static void patchAfterRemoval(Unit removing)
-
processPhiNode
protected void processPhiNode(Unit phiNode)
-
reprocessPhiNodes
protected void reprocessPhiNodes()
-
computeNeedsPatching
protected void computeNeedsPatching()
ComputesboxToNeedsPatchingwhich maps each UnitBox from a PhiExpr to true if the referenced Unit falls-through to the statement containing the PhiExpr, false otherwise. NOTE: This will *miss* all the Phi nodes outside a chain. So make sure you know what you are doing if you remove a Phi node from a chain and don't put it back or call clearUnitBoxes() on it.
-
iterator
public Iterator<Unit> iterator()
Description copied from class:PatchingChainReturns an iterator over this Chain.
-
iterator
public Iterator<Unit> iterator(Unit u)
Description copied from class:PatchingChainReturns an iterator over this Chain, starting at the given object.
-
-