Class PurityIntraproceduralAnalysis
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowAnalysis<N,A>
-
- soot.toolkits.scalar.FlowAnalysis<N,A>
-
- soot.toolkits.scalar.ForwardFlowAnalysis<Unit,PurityGraphBox>
-
- soot.jimple.toolkits.annotation.purity.PurityIntraproceduralAnalysis
-
public class PurityIntraproceduralAnalysis extends ForwardFlowAnalysis<Unit,PurityGraphBox>
Intra-procedural purity-graph analysis. You must pass anAbstractInterproceduralAnalysisobject so that the intraprocedural part can resolve the effect of method calls.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class soot.toolkits.scalar.FlowAnalysis
FlowAnalysis.Flow
-
-
Field Summary
-
Fields inherited from class soot.toolkits.scalar.FlowAnalysis
filterUnitToAfterFlow, unitToAfterFlow
-
Fields inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
filterUnitToBeforeFlow, graph, unitToBeforeFlow
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopy(PurityGraphBox source, PurityGraphBox dest)Creates a copy of thesourceflow object indest.voidcopyResult(PurityGraphBox dst)Put into dst the purity graph obtained by merging all purity graphs at the method return.voiddrawAsOneDot(String prefix, String name)Draw the result of the intra-procedural analysis as one big dot file, named className.methodName.dot, containing one purity graph for each statement in the method.protected PurityGraphBoxentryInitialFlow()Returns the initial flow value for entry/exit graph nodes.protected voidflowThrough(PurityGraphBox inValue, Unit unit, PurityGraphBox outValue)Given the merge of theoutsets, compute theinset fors(or in to out, depending on direction).protected voidmerge(PurityGraphBox in1, PurityGraphBox in2, PurityGraphBox out)Compute the merge of thein1andin2sets, putting the result intoout.protected PurityGraphBoxnewInitialFlow()Returns the flow object corresponding to the initial values for each graph node.-
Methods inherited from class soot.toolkits.scalar.ForwardFlowAnalysis
doAnalysis, isForward
-
Methods inherited from class soot.toolkits.scalar.FlowAnalysis
copyFreshToExisting, getFlow, getFlowAfter, getFlowBefore, omissible
-
Methods inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
merge, mergeInto, treatTrapHandlersAsEntries
-
-
-
-
Method Detail
-
newInitialFlow
protected PurityGraphBox newInitialFlow()
Description copied from class:AbstractFlowAnalysisReturns the flow object corresponding to the initial values for each graph node.- Specified by:
newInitialFlowin classAbstractFlowAnalysis<Unit,PurityGraphBox>
-
entryInitialFlow
protected PurityGraphBox entryInitialFlow()
Description copied from class:AbstractFlowAnalysisReturns the initial flow value for entry/exit graph nodes. This is equal toAbstractFlowAnalysis.newInitialFlow()- Overrides:
entryInitialFlowin classAbstractFlowAnalysis<Unit,PurityGraphBox>
-
merge
protected void merge(PurityGraphBox in1, PurityGraphBox in2, PurityGraphBox out)
Description copied from class:AbstractFlowAnalysisCompute the merge of thein1andin2sets, putting the result intoout. The behavior of this function depends on the implementation ( it may be necessary to check whetherin1andin2are equal or aliased ). Used by the doAnalysis method.- Specified by:
mergein classAbstractFlowAnalysis<Unit,PurityGraphBox>
-
copy
protected void copy(PurityGraphBox source, PurityGraphBox dest)
Description copied from class:AbstractFlowAnalysisCreates a copy of thesourceflow object indest.- Specified by:
copyin classAbstractFlowAnalysis<Unit,PurityGraphBox>
-
flowThrough
protected void flowThrough(PurityGraphBox inValue, Unit unit, PurityGraphBox outValue)
Description copied from class:FlowAnalysisGiven the merge of theoutsets, compute theinset fors(or in to out, depending on direction). This function often causes confusion, because the same interface is used for both forward and backward flow analyses. The first parameter is always the argument to the flow function (i.e. it is the "in" set in a forward analysis and the "out" set in a backward analysis), and the third parameter is always the result of the flow function (i.e. it is the "out" set in a forward analysis and the "in" set in a backward analysis).- Specified by:
flowThroughin classFlowAnalysis<Unit,PurityGraphBox>- Parameters:
inValue- the input flowunit- the current nodeoutValue- the returned flow
-
drawAsOneDot
public void drawAsOneDot(String prefix, String name)
Draw the result of the intra-procedural analysis as one big dot file, named className.methodName.dot, containing one purity graph for each statement in the method.- Parameters:
prefix-name-
-
copyResult
public void copyResult(PurityGraphBox dst)
Put into dst the purity graph obtained by merging all purity graphs at the method return. It is a valid summary that can be used in methodCall if you do interprocedural analysis.- Parameters:
dst-
-
-