Class FieldBasedCallGraphBuilder
java.lang.Object
com.ibm.wala.cast.js.callgraph.fieldbased.FieldBasedCallGraphBuilder
- Direct Known Subclasses:
OptimisticCallgraphBuilder
,PessimisticCallGraphBuilder
,WorklistBasedOptimisticCallgraphBuilder
Abstract call graph builder class for building a call graph from a field-based flow graph. The
algorithm for building the flow graph is left unspecified, and is implemented differently by
subclasses.
- Author:
- mschaefer
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Full result of call graph computation -
Field Summary
Modifier and TypeFieldDescriptionprotected final IAnalysisCacheView
protected final IClassHierarchy
protected final JavaScriptConstructorFunctions
protected final AnalysisOptions
protected final boolean
final MethodTargetSelector
-
Constructor Summary
ConstructorDescriptionFieldBasedCallGraphBuilder
(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView iAnalysisCacheView, boolean supportFullPointerAnalysis) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addEdgeToJSCallGraph
(JSCallGraph cg, CallSiteReference site, IMethod target, CGNode caller) buildCallGraph
(Iterable<? extends Entrypoint> eps, MonitorUtil.IProgressMonitor monitor) Main entry point: builds a flow graph, then extracts a call graph and returns it.abstract FlowGraph
Build a flow graph for the program to be analysed.extract
(FlowGraph flowgraph, Iterable<? extends Entrypoint> eps, MonitorUtil.IProgressMonitor monitor) Extract a call graph from a given flow graph.extract
(SSAContextInterpreter interpreter, FlowGraph flowgraph, Iterable<? extends Entrypoint> eps, MonitorUtil.IProgressMonitor monitor) extractCallGraphEdges
(FlowGraph flowgraph, MonitorUtil.IProgressMonitor monitor) Extract call edges from the flow graph into high-level representation.protected FlowGraph
boolean
handleFunctionCallOrApplyInvocation
(FlowGraph flowgraph, MonitorUtil.IProgressMonitor monitor, JSCallGraph cg, CallVertex callVertex, CGNode caller, CallSiteReference site, IMethod target)
-
Field Details
-
cha
-
options
-
cache
-
constructors
-
targetSelector
-
supportFullPointerAnalysis
protected final boolean supportFullPointerAnalysis
-
-
Constructor Details
-
FieldBasedCallGraphBuilder
public FieldBasedCallGraphBuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView iAnalysisCacheView, boolean supportFullPointerAnalysis)
-
-
Method Details
-
flowGraphFactory
-
buildFlowGraph
public abstract FlowGraph buildFlowGraph(MonitorUtil.IProgressMonitor monitor) throws CancelException Build a flow graph for the program to be analysed.- Throws:
CancelException
-
buildCallGraph
public FieldBasedCallGraphBuilder.CallGraphResult buildCallGraph(Iterable<? extends Entrypoint> eps, MonitorUtil.IProgressMonitor monitor) throws CancelException Main entry point: builds a flow graph, then extracts a call graph and returns it.- Throws:
CancelException
-
extract
public JSCallGraph extract(FlowGraph flowgraph, Iterable<? extends Entrypoint> eps, MonitorUtil.IProgressMonitor monitor) throws CancelException Extract a call graph from a given flow graph.- Throws:
CancelException
-
extract
public JSCallGraph extract(SSAContextInterpreter interpreter, FlowGraph flowgraph, Iterable<? extends Entrypoint> eps, MonitorUtil.IProgressMonitor monitor) throws CancelException - Throws:
CancelException
-
handleFunctionCallOrApplyInvocation
public boolean handleFunctionCallOrApplyInvocation(FlowGraph flowgraph, MonitorUtil.IProgressMonitor monitor, JSCallGraph cg, CallVertex callVertex, CGNode caller, CallSiteReference site, IMethod target) throws CancelException - Throws:
CancelException
-
addEdgeToJSCallGraph
public boolean addEdgeToJSCallGraph(JSCallGraph cg, CallSiteReference site, IMethod target, CGNode caller) throws CancelException - Throws:
CancelException
-
extractCallGraphEdges
public Set<Pair<CallVertex,FuncVertex>> extractCallGraphEdges(FlowGraph flowgraph, MonitorUtil.IProgressMonitor monitor) throws CancelException Extract call edges from the flow graph into high-level representation.- Throws:
CancelException
-