Class FieldBasedCallGraphBuilder
- java.lang.Object
-
- com.ibm.wala.cast.js.callgraph.fieldbased.FieldBasedCallGraphBuilder
-
- Direct Known Subclasses:
OptimisticCallgraphBuilder,PessimisticCallGraphBuilder,WorklistBasedOptimisticCallgraphBuilder
public abstract class FieldBasedCallGraphBuilder extends java.lang.ObjectAbstract 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldBasedCallGraphBuilder.CallGraphResultFull result of call graph computation
-
Field Summary
Fields Modifier and Type Field Description protected com.ibm.wala.ipa.callgraph.IAnalysisCacheViewcacheprotected com.ibm.wala.ipa.cha.IClassHierarchychaprotected JavaScriptConstructorFunctionsconstructorsprotected com.ibm.wala.ipa.callgraph.AnalysisOptionsoptionsprotected booleansupportFullPointerAnalysiscom.ibm.wala.ipa.callgraph.MethodTargetSelectortargetSelector
-
Constructor Summary
Constructors Constructor Description FieldBasedCallGraphBuilder(com.ibm.wala.ipa.cha.IClassHierarchy cha, com.ibm.wala.ipa.callgraph.AnalysisOptions options, com.ibm.wala.ipa.callgraph.IAnalysisCacheView iAnalysisCacheView, boolean supportFullPointerAnalysis)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaddEdgeToJSCallGraph(JSCallGraph cg, com.ibm.wala.classLoader.CallSiteReference site, com.ibm.wala.classLoader.IMethod target, com.ibm.wala.ipa.callgraph.CGNode caller)FieldBasedCallGraphBuilder.CallGraphResultbuildCallGraph(java.lang.Iterable<? extends com.ibm.wala.ipa.callgraph.Entrypoint> eps, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)Main entry point: builds a flow graph, then extracts a call graph and returns it.abstract FlowGraphbuildFlowGraph(com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)Build a flow graph for the program to be analysed.JSCallGraphextract(FlowGraph flowgraph, java.lang.Iterable<? extends com.ibm.wala.ipa.callgraph.Entrypoint> eps, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)Extract a call graph from a given flow graph.JSCallGraphextract(com.ibm.wala.ipa.callgraph.propagation.SSAContextInterpreter interpreter, FlowGraph flowgraph, java.lang.Iterable<? extends com.ibm.wala.ipa.callgraph.Entrypoint> eps, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)java.util.Set<com.ibm.wala.util.collections.Pair<CallVertex,FuncVertex>>extractCallGraphEdges(FlowGraph flowgraph, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)Extract call edges from the flow graph into high-level representation.protected FlowGraphflowGraphFactory()booleanhandleFunctionCallOrApplyInvocation(FlowGraph flowgraph, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor, JSCallGraph cg, CallVertex callVertex, com.ibm.wala.ipa.callgraph.CGNode caller, com.ibm.wala.classLoader.CallSiteReference site, com.ibm.wala.classLoader.IMethod target)
-
-
-
Field Detail
-
cha
protected final com.ibm.wala.ipa.cha.IClassHierarchy cha
-
options
protected final com.ibm.wala.ipa.callgraph.AnalysisOptions options
-
cache
protected final com.ibm.wala.ipa.callgraph.IAnalysisCacheView cache
-
constructors
protected final JavaScriptConstructorFunctions constructors
-
targetSelector
public final com.ibm.wala.ipa.callgraph.MethodTargetSelector targetSelector
-
supportFullPointerAnalysis
protected final boolean supportFullPointerAnalysis
-
-
Method Detail
-
flowGraphFactory
protected FlowGraph flowGraphFactory()
-
buildFlowGraph
public abstract FlowGraph buildFlowGraph(com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
Build a flow graph for the program to be analysed.- Throws:
com.ibm.wala.util.CancelException
-
buildCallGraph
public FieldBasedCallGraphBuilder.CallGraphResult buildCallGraph(java.lang.Iterable<? extends com.ibm.wala.ipa.callgraph.Entrypoint> eps, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
Main entry point: builds a flow graph, then extracts a call graph and returns it.- Throws:
com.ibm.wala.util.CancelException
-
extract
public JSCallGraph extract(FlowGraph flowgraph, java.lang.Iterable<? extends com.ibm.wala.ipa.callgraph.Entrypoint> eps, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
Extract a call graph from a given flow graph.- Throws:
com.ibm.wala.util.CancelException
-
extract
public JSCallGraph extract(com.ibm.wala.ipa.callgraph.propagation.SSAContextInterpreter interpreter, FlowGraph flowgraph, java.lang.Iterable<? extends com.ibm.wala.ipa.callgraph.Entrypoint> eps, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
- Throws:
com.ibm.wala.util.CancelException
-
handleFunctionCallOrApplyInvocation
public boolean handleFunctionCallOrApplyInvocation(FlowGraph flowgraph, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor, JSCallGraph cg, CallVertex callVertex, com.ibm.wala.ipa.callgraph.CGNode caller, com.ibm.wala.classLoader.CallSiteReference site, com.ibm.wala.classLoader.IMethod target) throws com.ibm.wala.util.CancelException
- Throws:
com.ibm.wala.util.CancelException
-
addEdgeToJSCallGraph
public boolean addEdgeToJSCallGraph(JSCallGraph cg, com.ibm.wala.classLoader.CallSiteReference site, com.ibm.wala.classLoader.IMethod target, com.ibm.wala.ipa.callgraph.CGNode caller) throws com.ibm.wala.util.CancelException
- Throws:
com.ibm.wala.util.CancelException
-
extractCallGraphEdges
public java.util.Set<com.ibm.wala.util.collections.Pair<CallVertex,FuncVertex>> extractCallGraphEdges(FlowGraph flowgraph, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
Extract call edges from the flow graph into high-level representation.- Throws:
com.ibm.wala.util.CancelException
-
-