abc.weaving.residues
Class OrResidue

java.lang.Object
  extended by abc.weaving.residues.Residue
      extended by abc.weaving.residues.OrResidue

public class OrResidue
extends Residue

Disjunction of two residues

Author:
Ganesh Sittampalam, Ondrej Lhotak

Nested Class Summary
 
Nested classes/interfaces inherited from class abc.weaving.residues.Residue
Residue.Bindings
 
Method Summary
 Stmt codeGen(SootMethod method, LocalGeneratorEx localgen, Chain units, Stmt begin, Stmt fail, boolean sense, WeavingContext wc)
          Generate the code for this dynamic residue.
static Residue construct(Residue left, Residue right)
          Smart constructor; some short-circuiting may need to be removed to mimic ajc behaviour
 void getAdviceFormalBindings(Residue.Bindings bindings, AndResidue andRoot)
          Fills the Bindings object with information of possible advice-formal bindings.
 Residue getLeftOp()
          Get the left operand
 ResidueBox getLeftOpBox()
          Get the left box
 java.util.List getResidueBoxes()
           
 Residue getRightOp()
          Get the right operand
 ResidueBox getRightOpBox()
          Get the right box
 Residue inline(ConstructorInliningMap cim)
          Make a copy of the residue applying to an inlined version of the code.
 Residue optimize()
          Optimize the residue by rebuilding it, invoking the smart constructors along the way.
 Residue resetForReweaving()
           
 Residue restructureToCreateBindingsMask(soot.Local bindingsMaskLocal, Residue.Bindings bindings)
          Returns residue that replaces the old residue.
 java.lang.String toString()
          Must provide a toString method
 
Methods inherited from class abc.weaving.residues.Residue
succeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

optimize

public Residue optimize()
Description copied from class: Residue
Optimize the residue by rebuilding it, invoking the smart constructors along the way.

Specified by:
optimize in class Residue

inline

public Residue inline(ConstructorInliningMap cim)
Description copied from class: Residue
Make a copy of the residue applying to an inlined version of the code.

Specified by:
inline in class Residue

getLeftOp

public Residue getLeftOp()
Get the left operand


getRightOp

public Residue getRightOp()
Get the right operand


getLeftOpBox

public ResidueBox getLeftOpBox()
Get the left box


getRightOpBox

public ResidueBox getRightOpBox()
Get the right box


toString

public java.lang.String toString()
Description copied from class: Residue
Must provide a toString method

Specified by:
toString in class Residue

resetForReweaving

public Residue resetForReweaving()
Overrides:
resetForReweaving in class Residue

construct

public static Residue construct(Residue left,
                                Residue right)
Smart constructor; some short-circuiting may need to be removed to mimic ajc behaviour


codeGen

public Stmt codeGen(SootMethod method,
                    LocalGeneratorEx localgen,
                    Chain units,
                    Stmt begin,
                    Stmt fail,
                    boolean sense,
                    WeavingContext wc)
Description copied from class: Residue
Generate the code for this dynamic residue.

Specified by:
codeGen in class Residue
Parameters:
method - The method the code is being inserted into
localgen - A local generator for the method
units - The chain the code is being inserted into
begin - Code will be inserted just after this statement
fail - If the residue "fails", the inserted code will jump to this point; otherwise it will fall through
sense - If this is false, inverts the meaning of failure and success for the residue
wc - The weaving context
Returns:
The last statement that was inserted into the chain (or begin if nothing was).

getAdviceFormalBindings

public void getAdviceFormalBindings(Residue.Bindings bindings,
                                    AndResidue andRoot)
Description copied from class: Residue
Fills the Bindings object with information of possible advice-formal bindings. Has to be overwritten by all Residue classes that have children. andRoot is the outermost directly enclosing AndResidue (or null). (see implementation in AndResidue)

Overrides:
getAdviceFormalBindings in class Residue

restructureToCreateBindingsMask

public Residue restructureToCreateBindingsMask(soot.Local bindingsMaskLocal,
                                               Residue.Bindings bindings)
Description copied from class: Residue
Returns residue that replaces the old residue. This way, BindMaskResidue is inserted throughout the tree in the appropriate places. Has to be overridden by all Residue classes that have children.

Overrides:
restructureToCreateBindingsMask in class Residue

getResidueBoxes

public java.util.List getResidueBoxes()
Overrides:
getResidueBoxes in class Residue