public abstract class AbstractCallGraphAlgorithm extends Object implements CallGraphAlgorithm
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCallGraphAlgorithm(View view) |
| Modifier and Type | Method and Description |
|---|---|
CallGraph |
addClass(CallGraph oldCallGraph,
JavaClassType classType)
Adds a class to the call graph.
|
protected void |
addImplicitEdgesOfEntryPoints(List<MethodSignature> entryPoints,
MutableCallGraph cg,
Deque<MethodSignature> workList)
This method adds implicit edges of the entry points of the call graph algorithm.
|
static Optional<SootMethod> |
findConcreteMethod(View view,
MethodSignature sig)
searches the method object in the given hierarchy
|
MethodSignature |
findMainMethod()
The method iterates over all classes present in view, and finds method with name main and
SourceType - Library.
|
protected MutableCallGraph |
initializeCallGraph()
This method creates the mutable call graph which is used in the call graph algorithm.
|
protected abstract void |
postProcessingMethod(View view,
MethodSignature sourceMethod,
Deque<MethodSignature> workList,
MutableCallGraph cg)
This method enables optional post-processing of a method in the call graph algorithm
|
protected abstract void |
preProcessingMethod(View view,
MethodSignature sourceMethod,
Deque<MethodSignature> workList,
MutableCallGraph cg)
This method enables optional pre-processing of a method in the call graph algorithm
|
protected Stream<MethodSignature> |
resolveAllImplicitCallsFromSourceMethod(View view,
SootMethod sourceMethod)
It resolves all implicit calls caused by the given source method
|
protected Stream<MethodSignature> |
resolveAllStaticInitializerCallsFromSourceMethod(View view,
SootMethod sourceMethod)
It resolves all static initializer calls caused by the given source method
|
protected abstract Stream<MethodSignature> |
resolveCall(SootMethod method,
AbstractInvokeExpr invokeExpr)
This method resolves the possible targets of a given invoke expression.
|
static Optional<MethodSignature> |
resolveConcreteDispatch(View view,
MethodSignature m)
Searches for the signature of the method that is the concrete implementation of
m. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, initializeprotected MutableCallGraph initializeCallGraph()
protected void addImplicitEdgesOfEntryPoints(List<MethodSignature> entryPoints, MutableCallGraph cg, Deque<MethodSignature> workList)
entryPoints - the entry points of the call graph algorithmcg - the call graph which will save the added implicit edges.workList - the implicit targets will be added to the work list to process in the call
graph algorithm@Nonnull protected Stream<MethodSignature> resolveAllImplicitCallsFromSourceMethod(View view, SootMethod sourceMethod)
view - it contains the class datasourceMethod - the inspected source method@Nonnull protected Stream<MethodSignature> resolveAllStaticInitializerCallsFromSourceMethod(View view, SootMethod sourceMethod)
view - it contains the class datasourceMethod - the inspected source methodprotected abstract void preProcessingMethod(View view, MethodSignature sourceMethod, @Nonnull Deque<MethodSignature> workList, @Nonnull MutableCallGraph cg)
view - viewsourceMethod - the processed methodworkList - the current work list that might be extendedcg - the current cg that might be extendedprotected abstract void postProcessingMethod(View view, MethodSignature sourceMethod, @Nonnull Deque<MethodSignature> workList, @Nonnull MutableCallGraph cg)
view - it contains classes and the type hierarchy.sourceMethod - the processed methodworkList - the current work list that might be extendedcg - the current cg that might be extended@Nonnull public CallGraph addClass(@Nonnull CallGraph oldCallGraph, @Nonnull JavaClassType classType)
CallGraphAlgorithmaddClass in interface CallGraphAlgorithmoldCallGraph - the call graph which will be modified.classType - the type of the calls.public MethodSignature findMainMethod()
The method throws an exception if there is no main method in any of the classes or if there are more than one main method.
@Nonnull protected abstract Stream<MethodSignature> resolveCall(SootMethod method, AbstractInvokeExpr invokeExpr)
method - the method object that contains the given invoke expression in the body.invokeExpr - it contains the call which is resolved.@Nonnull public static Optional<MethodSignature> resolveConcreteDispatch(View view, MethodSignature m)
m.
This is done by checking each superclass and the class itself for whether it contains the
concrete implementation.public static Optional<SootMethod> findConcreteMethod(@Nonnull View view, @Nonnull MethodSignature sig)
view - it contains all classessig - the signature of the searched methodCopyright © 2024 Soot OSS. All rights reserved.