soot.shimple.internal
Class SPatchingChain

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by soot.PatchingChain<Unit>
          extended by soot.shimple.internal.SPatchingChain
All Implemented Interfaces:
Serializable, Iterable<Unit>, Collection<Unit>, Chain<Unit>

public class SPatchingChain
extends PatchingChain<Unit>

Internal Shimple extension of PatchingChain.

Author:
Navindra Umanee
See Also:
PatchingChain, Serialized Form

Nested Class Summary
protected  class SPatchingChain.SPatchingIterator
           
 
Nested classes/interfaces inherited from class soot.PatchingChain
PatchingChain.PatchingIterator
 
Field Summary
protected  Map<SUnitBox,Boolean> boxToNeedsPatching
          Flag that indicates whether control flow falls through from the box to the Phi node.
protected  Map<UnitBox,Unit> boxToPhiNode
          Map from UnitBox to the Phi node owning it.
 
Fields inherited from class soot.PatchingChain
innerChain
 
Constructor Summary
SPatchingChain(Body aBody, Chain aChain)
           
 
Method Summary
 boolean add(Unit o)
          Adds the given object to this Chain.
 void addFirst(Unit u)
          Adds the given object at the beginning of the Chain.
 void addLast(Unit u)
          Adds the given object at the end of the Chain.
protected  void computeNeedsPatching()
          NOTE: This will *miss* all the Phi nodes outside a chain.
protected  SUnitBox getSBox(UnitBox box)
           
 void insertAfter(List<Unit> toInsert, Unit point)
          Inserts toInsert in the Chain after point.
 void insertAfter(Unit toInsert, Unit point)
          Inserts toInsert in the Chain after point.
 void insertBefore(List<Unit> toInsert, Unit point)
          Inserts toInsert in the Chain before point.
 void insertBefore(Unit toInsert, Unit point)
          Inserts toInsert in the Chain before point.
 Iterator iterator()
          Returns an iterator over this Chain.
 Iterator iterator(Unit u)
          Returns an iterator over this Chain, starting at the given object.
 Iterator iterator(Unit head, Unit tail)
          Returns an iterator over this Chain, starting at head and reaching tail (inclusive).
protected  void processPhiNode(Unit o)
           
 boolean remove(Unit obj)
           
protected  void reprocessPhiNodes()
           
 void swapWith(Unit out, Unit in)
          Replaces out in the Chain by in.
 
Methods inherited from class soot.PatchingChain
contains, follows, getFirst, getLast, getNonPatchingChain, getPredOf, getSuccOf, insertAfter, insertBefore, insertBeforeNoRedirect, remove, 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, removeAll, retainAll, toArray, toArray
 

Field Detail

boxToPhiNode

protected Map<UnitBox,Unit> boxToPhiNode
Map from UnitBox to the Phi node owning it.


boxToNeedsPatching

protected Map<SUnitBox,Boolean> boxToNeedsPatching
Flag that indicates whether control flow falls through from the box to the Phi node. null indicates we probably need a call to computeInternal().

Constructor Detail

SPatchingChain

public SPatchingChain(Body aBody,
                      Chain aChain)
Method Detail

add

public boolean add(Unit o)
Description copied from class: PatchingChain
Adds the given object to this Chain.

Specified by:
add in interface Collection<Unit>
Overrides:
add in class PatchingChain<Unit>

swapWith

public void swapWith(Unit out,
                     Unit in)
Description copied from class: PatchingChain
Replaces out in the Chain by in.

Specified by:
swapWith in interface Chain<Unit>
Overrides:
swapWith in class PatchingChain<Unit>

insertAfter

public void insertAfter(Unit toInsert,
                        Unit point)
Description copied from class: PatchingChain
Inserts toInsert in the Chain after point.

Specified by:
insertAfter in interface Chain<Unit>
Overrides:
insertAfter in class PatchingChain<Unit>

insertAfter

public void insertAfter(List<Unit> toInsert,
                        Unit point)
Description copied from class: PatchingChain
Inserts toInsert in the Chain after point.

Specified by:
insertAfter in interface Chain<Unit>
Overrides:
insertAfter in class PatchingChain<Unit>

insertBefore

public void insertBefore(List<Unit> toInsert,
                         Unit point)
Description copied from class: PatchingChain
Inserts toInsert in the Chain before point.

Specified by:
insertBefore in interface Chain<Unit>
Overrides:
insertBefore in class PatchingChain<Unit>

insertBefore

public void insertBefore(Unit toInsert,
                         Unit point)
Description copied from class: PatchingChain
Inserts toInsert in the Chain before point.

Specified by:
insertBefore in interface Chain<Unit>
Overrides:
insertBefore in class PatchingChain<Unit>

addFirst

public void addFirst(Unit u)
Description copied from class: PatchingChain
Adds the given object at the beginning of the Chain.

Specified by:
addFirst in interface Chain<Unit>
Overrides:
addFirst in class PatchingChain<Unit>

addLast

public void addLast(Unit u)
Description copied from class: PatchingChain
Adds the given object at the end of the Chain.

Specified by:
addLast in interface Chain<Unit>
Overrides:
addLast in class PatchingChain<Unit>

remove

public boolean remove(Unit obj)

processPhiNode

protected void processPhiNode(Unit o)

reprocessPhiNodes

protected void reprocessPhiNodes()

computeNeedsPatching

protected void computeNeedsPatching()
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.


getSBox

protected SUnitBox getSBox(UnitBox box)

iterator

public Iterator iterator()
Description copied from class: PatchingChain
Returns an iterator over this Chain.

Specified by:
iterator in interface Iterable<Unit>
Specified by:
iterator in interface Collection<Unit>
Specified by:
iterator in interface Chain<Unit>
Overrides:
iterator in class PatchingChain<Unit>

iterator

public Iterator iterator(Unit u)
Description copied from class: PatchingChain
Returns an iterator over this Chain, starting at the given object.

Specified by:
iterator in interface Chain<Unit>
Overrides:
iterator in class PatchingChain<Unit>

iterator

public Iterator iterator(Unit head,
                         Unit tail)
Description copied from class: PatchingChain
Returns an iterator over this Chain, starting at head and reaching tail (inclusive).

Specified by:
iterator in interface Chain<Unit>
Overrides:
iterator in class PatchingChain<Unit>