abc.weaving.weaver
Class AbstractReweavingAnalysis

java.lang.Object
  extended by abc.weaving.weaver.AbstractReweavingAnalysis
All Implemented Interfaces:
ReweavingAnalysis
Direct Known Subclasses:
ITDAnalysis, OptFlowInsensitiveAnalysis, OptIntraProcedural, OptQuickCheck

public abstract class AbstractReweavingAnalysis
extends java.lang.Object
implements ReweavingAnalysis

A default (template) implementation of ReweavingAnalysis with empty bodies.

Author:
Eric Bodden

Constructor Summary
AbstractReweavingAnalysis()
           
 
Method Summary
abstract  boolean analyze()
          Perform the actual analysis.
 void cleanup()
          This method is invoked after the last reweaving step.
 void defaultSootArgs(java.util.List sootArgs)
          Allows you to add default arguments to Soot, which can be overriden by the user on the commandline.
 void enforceSootArgs(java.util.List sootArgs)
          Allows you to override arguments to Soot, which were by the user on the commandline.
 void setupWeaving()
          This method is invoked immediately before reweaving takes place.
 void tearDownWeaving()
          This method is invoked immediately after reweaving takes place.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractReweavingAnalysis

public AbstractReweavingAnalysis()
Method Detail

analyze

public abstract boolean analyze()
Perform the actual analysis. This usually analyzes the woven program looking for optimization potential. When such potential is found, the residues are changed accordingly. abc automatically detects when a ResidueBox is set and then optimizes the residues before the next analysis or weaving step is run.

Specified by:
analyze in interface ReweavingAnalysis
Returns:
true if the code needs to be rewoven immediately, i.e. before conducting the next analysis; the code is rewoven again once in the end in any case

defaultSootArgs

public void defaultSootArgs(java.util.List sootArgs)
Allows you to add default arguments to Soot, which can be overriden by the user on the commandline.

Specified by:
defaultSootArgs in interface ReweavingAnalysis
Parameters:
sootArgs - the current list of default arguments; add argument strings as needed

enforceSootArgs

public void enforceSootArgs(java.util.List sootArgs)
Allows you to override arguments to Soot, which were by the user on the commandline.

Specified by:
enforceSootArgs in interface ReweavingAnalysis
Parameters:
sootArgs - the current list of default arguments; remove, replace or just add arguments as needed

setupWeaving

public void setupWeaving()
This method is invoked immediately before reweaving takes place. It allows you to perform additional work right before reweaving. It is only invoked if ReweavingAnalysis.analyze() returns true.

Specified by:
setupWeaving in interface ReweavingAnalysis

tearDownWeaving

public void tearDownWeaving()
This method is invoked immediately after reweaving takes place. It allows you to perform additional work right after reweaving. It is only invoked if ReweavingAnalysis.analyze() returns true.

Specified by:
tearDownWeaving in interface ReweavingAnalysis

cleanup

public void cleanup()
This method is invoked after the last reweaving step. This allows the analysis to perform cleanuo operations, e.g. free memory etc.

Specified by:
cleanup in interface ReweavingAnalysis