public class OnFlyCallGraph extends Object implements MutableCallGraph, Iterable<Edge>
| Modifier and Type | Field and Description |
|---|---|
protected int |
callCnt |
protected Map<MethodSignature,Set<MethodSignature>> |
calls |
protected Edge |
dummy |
protected Set<Edge> |
edges |
protected Set<MethodSignature> |
methods |
protected QueueReader<Edge> |
reader |
protected Map<ContextMethod,Edge> |
srcMethodToEdge |
protected Map<Stmt,Edge> |
srcUnitToEdge |
protected ChunkedQueue<Edge> |
stream |
protected Map<ContextMethod,Edge> |
tgtToEdge |
| Constructor and Description |
|---|
OnFlyCallGraph() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCall(MethodSignature sourceMethod,
MethodSignature targetMethod) |
boolean |
addEdge(Edge e)
Used to add an edge to the call graph.
|
void |
addMethod(MethodSignature calledMethod) |
int |
callCount() |
Set<MethodSignature> |
callsFrom(MethodSignature sourceMethod) |
Set<MethodSignature> |
callsTo(MethodSignature targetMethod) |
boolean |
containsCall(MethodSignature sourceMethod,
MethodSignature targetMethod) |
boolean |
containsMethod(MethodSignature method) |
MutableCallGraph |
copy() |
Iterator<Edge> |
edgesInto(ContextMethod m)
Returns an iterator over all edges that have m as their target method.
|
Iterator<Edge> |
edgesOutOf(ContextMethod m)
Returns an iterator over all edges that have m as their source method.
|
Iterator<Edge> |
edgesOutOf(Stmt u)
Returns an iterator over all edges that have u as their source unit.
|
String |
exportAsDot() |
Edge |
findEdge(Stmt u,
SootMethod callee)
Find the specific call edge that is going out from the callsite u and the call target is
callee.
|
Set<MethodSignature> |
getMethodSignatures() |
boolean |
isEntryMethod(SootMethod method)
Does this method have no incoming edge?
|
Iterator<Edge> |
iterator() |
QueueReader<Edge> |
listener()
Returns a QueueReader object containing all edges added so far, and which will be informed of
any new edges that are later added to the graph.
|
QueueReader<Edge> |
newListener()
Returns a QueueReader object which will contain ONLY NEW edges which will be added to the
graph.
|
boolean |
removeAllEdgesOutOf(Stmt u)
Removes all outgoing edges that start at the given unit
|
boolean |
removeEdge(Edge e)
Removes the edge e from the call graph.
|
boolean |
removeEdge(Edge e,
boolean removeInEdgeList)
Removes the edge e from the call graph.
|
boolean |
removeEdges(Collection<Edge> edges)
Removes the edges from the call graph.
|
int |
size()
Returns the number of edges in the call graph.
|
Iterator<ContextMethod> |
sourceMethods()
Returns an iterator over all methods that are the sources of at least one edge.
|
boolean |
swapEdgesOutOf(Stmt out,
Stmt in)
Swaps an invocation statement.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected Set<MethodSignature> methods
protected Map<MethodSignature,Set<MethodSignature>> calls
protected int callCnt
protected ChunkedQueue<Edge> stream
protected QueueReader<Edge> reader
protected Map<ContextMethod,Edge> srcMethodToEdge
protected Map<ContextMethod,Edge> tgtToEdge
protected Edge dummy
public boolean addEdge(Edge e)
public boolean removeAllEdgesOutOf(Stmt u)
u - The unit from which to remove all outgoing edgespublic boolean swapEdgesOutOf(Stmt out, Stmt in)
out - The old statementin - The new statementpublic boolean removeEdge(Edge e)
public boolean removeEdge(Edge e, boolean removeInEdgeList)
e - the edgeremoveInEdgeList - when true (recommended), it is ensured that the edge reader is informed
about the removalpublic boolean removeEdges(Collection<Edge> edges)
edges - the edgespublic boolean isEntryMethod(SootMethod method)
method - public Edge findEdge(Stmt u, SootMethod callee)
u - callee - public Iterator<ContextMethod> sourceMethods()
public Iterator<Edge> edgesOutOf(Stmt u)
public Iterator<Edge> edgesOutOf(ContextMethod m)
public Iterator<Edge> edgesInto(ContextMethod m)
public QueueReader<Edge> listener()
public QueueReader<Edge> newListener()
public int size()
public void addMethod(@Nonnull MethodSignature calledMethod)
addMethod in interface MutableCallGraphpublic void addCall(@Nonnull MethodSignature sourceMethod, @Nonnull MethodSignature targetMethod)
addCall in interface MutableCallGraph@Nonnull public Set<MethodSignature> getMethodSignatures()
getMethodSignatures in interface CallGraph@Nonnull public MutableCallGraph copy()
public boolean containsMethod(@Nonnull MethodSignature method)
containsMethod in interface CallGraphpublic boolean containsCall(@Nonnull MethodSignature sourceMethod, @Nonnull MethodSignature targetMethod)
containsCall in interface CallGraphpublic String exportAsDot()
exportAsDot in interface CallGraph@Nonnull public Set<MethodSignature> callsFrom(@Nonnull MethodSignature sourceMethod)
@Nonnull public Set<MethodSignature> callsTo(@Nonnull MethodSignature targetMethod)
Copyright © 2024 Soot OSS. All rights reserved.