envgen.analysis.stat
Class StaticAnalysis

java.lang.Object
  |
  +--envgen.analysis.stat.StaticAnalysis
Direct Known Subclasses:
CFGAnalysisMain, PointsToAnalysisMain, ReadWriteAnalysisMain, SideEffectsAnalysisMain

public class StaticAnalysis
extends java.lang.Object

Implements methods shared by points-to and side-effects analyses.


Field Summary
(package private)  EnvCallGraph callGraph
          Needed for interprocedural SE analysis.
(package private)  int chainLength
          Integer field that keeps track of value k in k-limiting.
(package private)  int debug
          Set to print debugging messages.
(package private)  boolean dump
           
(package private)  boolean packageAnalysis
           
(package private)  java.lang.String packageName
           
(package private)  boolean unitAnalysis
           
(package private)  java.util.List unitStaticFields
          List of static fields of the unit.
(package private)  java.util.HashMap unitTable
          Unit classes.
 
Constructor Summary
StaticAnalysis()
           
 
Method Summary
 boolean addField(soot.Type modifiedType)
           
 EnvCallGraph getCallGraph()
          Returns the call graph.
 soot.SootClass getClass(soot.Type type)
           
 SymLocPath getExtendedLoc(SymLoc symLoc, Accessor accessor)
           
 SymLocPath getExtendedLoc(SymLocPath symLoc, Accessor accessor)
          Extends a symbolic location with a field or array access expression.
 MultiSet getMappedArg(SymLoc param, soot.Value arg, DataFlowSet aliasSet)
          Since arg may point to several locations, need to map each of them.
 SymLoc getMappedLocation(SymLoc param, SymLoc arg)
          Plugging an argument into a param placeholder, param = arg (works for this = receiver as this is just another parameter).
 MultiSet getMappedLocs(soot.jimple.Stmt unit, MultiSet values, DataFlowSet aliasSet)
           
 MultiSet getMappedLocs(soot.jimple.Stmt unit, SymLoc param, DataFlowSet aliasSet)
          Given an invoke expr and param, figures out the arg to plug in.
protected  SymLoc getMappedPathParam(SymLocPath param, SymLoc arg)
           
protected  SymLoc getMappedPathParam(SymLocPath param, SymLocPath arg)
          Plugging an arg into a parameter access path
protected  SymLoc getMappedPathParam(SymLocPath param, SymLocTop arg)
           
 MultiSet getMappedReturnLocs(soot.jimple.Stmt unit, MultiSet locations, DataFlowSet aliasSet)
          Maps symLoc of the called method into a location of the caller.
protected  SymLoc getMappedTopParam(SymLoc param, SymLoc arg)
          Plugging an arg into a top access path for param
 MultiSet getMappedVals(soot.jimple.Stmt unit, MultiSet values, DataFlowSet aliasSet)
           
 java.util.List getStaticFields()
          Builds a list of unit static fields (unit globals).
 MultiSet getValues(soot.Value rhs, DataFlowSet aliasSet, soot.Type fieldType)
           
 boolean isSingularLoc(MultiSet locs)
           
 boolean isSubType(soot.SootClass unitClass, soot.SootClass paramTypeClass)
          Finds whether unitClass class is a subtype of paramTypeClass class.
 boolean isUnitSuperType(soot.SootClass paramTypeClass)
          Checks whether paramTypeClass is a supertype of any of the unit classes.
protected  boolean processRefOrScalarType(soot.Type type)
          Used in side-effects analysis.
protected  boolean processRefType(soot.Type type)
          Used in points-to analysis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unitTable

java.util.HashMap unitTable
Unit classes.


callGraph

EnvCallGraph callGraph
Needed for interprocedural SE analysis.


unitStaticFields

java.util.List unitStaticFields
List of static fields of the unit.


chainLength

int chainLength
Integer field that keeps track of value k in k-limiting. The value can be varied by the user. The larger the value, the more precise information will be produced by the analysis.


unitAnalysis

boolean unitAnalysis

packageAnalysis

boolean packageAnalysis

packageName

java.lang.String packageName

debug

int debug
Set to print debugging messages.


dump

boolean dump
Constructor Detail

StaticAnalysis

public StaticAnalysis()
Method Detail

getMappedReturnLocs

public MultiSet getMappedReturnLocs(soot.jimple.Stmt unit,
                                    MultiSet locations,
                                    DataFlowSet aliasSet)
Maps symLoc of the called method into a location of the caller.


getMappedLocs

public MultiSet getMappedLocs(soot.jimple.Stmt unit,
                              SymLoc param,
                              DataFlowSet aliasSet)
Given an invoke expr and param, figures out the arg to plug in.


getMappedArg

public MultiSet getMappedArg(SymLoc param,
                             soot.Value arg,
                             DataFlowSet aliasSet)
Since arg may point to several locations, need to map each of them.


getMappedLocation

public SymLoc getMappedLocation(SymLoc param,
                                SymLoc arg)
Plugging an argument into a param placeholder, param = arg (works for this = receiver as this is just another parameter).


getMappedPathParam

protected SymLoc getMappedPathParam(SymLocPath param,
                                    SymLoc arg)

getMappedPathParam

protected SymLoc getMappedPathParam(SymLocPath param,
                                    SymLocPath arg)
Plugging an arg into a parameter access path


getMappedPathParam

protected SymLoc getMappedPathParam(SymLocPath param,
                                    SymLocTop arg)

getMappedTopParam

protected SymLoc getMappedTopParam(SymLoc param,
                                   SymLoc arg)
Plugging an arg into a top access path for param


getMappedVals

public MultiSet getMappedVals(soot.jimple.Stmt unit,
                              MultiSet values,
                              DataFlowSet aliasSet)

getMappedLocs

public MultiSet getMappedLocs(soot.jimple.Stmt unit,
                              MultiSet values,
                              DataFlowSet aliasSet)

addField

public boolean addField(soot.Type modifiedType)

getValues

public MultiSet getValues(soot.Value rhs,
                          DataFlowSet aliasSet,
                          soot.Type fieldType)

getExtendedLoc

public SymLocPath getExtendedLoc(SymLoc symLoc,
                                 Accessor accessor)

getExtendedLoc

public SymLocPath getExtendedLoc(SymLocPath symLoc,
                                 Accessor accessor)
Extends a symbolic location with a field or array access expression.


getClass

public soot.SootClass getClass(soot.Type type)

getCallGraph

public EnvCallGraph getCallGraph()
Returns the call graph.


getStaticFields

public java.util.List getStaticFields()
Builds a list of unit static fields (unit globals).


processRefType

protected boolean processRefType(soot.Type type)
Used in points-to analysis.


processRefOrScalarType

protected boolean processRefOrScalarType(soot.Type type)
Used in side-effects analysis.


isSubType

public boolean isSubType(soot.SootClass unitClass,
                         soot.SootClass paramTypeClass)
Finds whether unitClass class is a subtype of paramTypeClass class. Used to check whether a unitClass type can flow into a method through paramTypeClass, or whether a unitClass inherits from a class in the env, in which case we need to keep track of side-effects to the fields of paramTypeClass.


isUnitSuperType

public boolean isUnitSuperType(soot.SootClass paramTypeClass)
Checks whether paramTypeClass is a supertype of any of the unit classes.


isSingularLoc

public boolean isSingularLoc(MultiSet locs)