public abstract class AbstractInterproceduralAnalysis
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected CallGraph |
cg |
protected java.util.Map |
data |
protected DirectedGraph |
dg |
static boolean |
doCheck |
protected java.util.Map<java.lang.Object,java.lang.Integer> |
order |
protected java.util.Map |
unanalysed |
| Constructor and Description |
|---|
AbstractInterproceduralAnalysis(CallGraph cg,
SootMethodFilter filter,
java.util.Iterator heads,
boolean verbose)
The constructor performs some preprocessing, but you have to call
doAnalysis to preform the real stuff.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
analyseCall(java.lang.Object src,
Stmt callStmt,
java.lang.Object dst)
Analyse the call callStmt in the context src, and put the resul into
dst.
|
protected abstract void |
analyseMethod(SootMethod method,
java.lang.Object dst)
Compute the summary for a method by analysing its body.
|
protected abstract void |
applySummary(java.lang.Object src,
Stmt callStmt,
java.lang.Object summary,
java.lang.Object dst)
Interprocedural analysis will call applySummary repeatidly as a
consequence to analyseCall.
|
protected abstract void |
copy(java.lang.Object sr,
java.lang.Object dst)
Copy src into dst.
|
protected void |
doAnalysis(boolean verbose)
Carry out the analysis.
|
void |
drawAsManyDot(java.lang.String prefix,
boolean drawUnanalysed)
Dump the each summary computed by the interprocedural analysis as
a seperate graph.
|
void |
drawAsOneDot(java.lang.String name)
Dump the interprocedural analysis result as a graph.
|
protected void |
fillDotGraph(java.lang.String prefix,
java.lang.Object o,
DotGraph out)
Called by drawAsOneDot to fill dot subgraph out with the contents
of summary o.
|
java.util.Iterator |
getAnalysedMethods()
Get an iterator over the list of SootMethod with an associated summary.
|
java.lang.Object |
getSummaryFor(SootMethod m)
Query the analysis result.
|
protected abstract void |
merge(java.lang.Object in1,
java.lang.Object in2,
java.lang.Object out)
Merge in1 and in2 into out.
|
protected abstract java.lang.Object |
newInitialSummary()
Initial summary value for analysed funtions.
|
protected abstract java.lang.Object |
summaryOfUnanalysedMethod(SootMethod method)
Whenever the analyse requires the summary of a method you filtered-out,
this function is called instead of analyseMethod.
|
public static final boolean doCheck
protected CallGraph cg
protected DirectedGraph dg
protected java.util.Map data
protected java.util.Map<java.lang.Object,java.lang.Integer> order
protected java.util.Map unanalysed
public AbstractInterproceduralAnalysis(CallGraph cg, SootMethodFilter filter, java.util.Iterator heads, boolean verbose)
protected abstract java.lang.Object newInitialSummary()
protected abstract java.lang.Object summaryOfUnanalysedMethod(SootMethod method)
Note: This function is called at most once per filtered-out method. It is the equivalent of entryInitialFlow!
protected abstract void analyseMethod(SootMethod method, java.lang.Object dst)
method - is the method to be analyseddst - is where to put the computed method summaryprotected abstract void applySummary(java.lang.Object src,
Stmt callStmt,
java.lang.Object summary,
java.lang.Object dst)
src - summary valid before the call statementcallStmt - a statement containing a InvokeStmt or InvokeExprsummary - summary of the possible target of callStmt considered
heredst - where to put the resultanalyseCallprotected abstract void merge(java.lang.Object in1,
java.lang.Object in2,
java.lang.Object out)
Note: in1 or in2 can be aliased to out (e.g., analyseCall).
protected abstract void copy(java.lang.Object sr,
java.lang.Object dst)
protected void fillDotGraph(java.lang.String prefix,
java.lang.Object o,
DotGraph out)
prefix - gives you a unique string to prefix your node names
and avoid name-clashprotected void analyseCall(java.lang.Object src,
Stmt callStmt,
java.lang.Object dst)
summaryOfUnanalysedMethod,
applySummarypublic void drawAsOneDot(java.lang.String name)
Note: this graph does not show filtered-out methods for which a conservative summary was asked via summaryOfUnanalysedMethod.
name - output filenamefillDotGraphpublic void drawAsManyDot(java.lang.String prefix,
boolean drawUnanalysed)
prefix - is prepended before method name in output filenamedrawUnanalysed - do you also want info for the unanalysed methods
required by the analysis via summaryOfUnanalysedMethod ?fillDotGraphpublic java.lang.Object getSummaryFor(SootMethod m)
public java.util.Iterator getAnalysedMethods()
protected void doAnalysis(boolean verbose)
Copyright © 2012-2019 RoboVM AB. All Rights Reserved.