UserGuide:CallGraph

From WalaWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:50, 26 March 2007
Sjfink (Talk | contribs)

← Previous diff
Current revision
Msridhar (Talk | contribs)
(Call Graph Basics)
Line 1: Line 1:
 +[[wala.core technical overview]]
==Call Graph Basics== ==Call Graph Basics==
Line 9: Line 10:
WALA supports a family of on-the-fly call graph construction algorithms, integrated with flow-insensitive pointer analysis. See WALA supports a family of on-the-fly call graph construction algorithms, integrated with flow-insensitive pointer analysis. See
-[[UserGuide:PointerAnalysis]] for more details.+[[UserGuide:PointerAnalysis]] for more details. WALA also has an implementation of call-graph construction via rapid type analysis (see [http://wala.sourceforge.net/javadocs/com.ibm.wala.core/com/ibm/wala/ipa/callgraph/impl/Util.html#makeRTABuilder(com.ibm.wala.ipa.callgraph.AnalysisOptions,%20com.ibm.wala.ipa.cha.IClassHierarchy,%20com.ibm.wala.ipa.callgraph.AnalysisScope,%20com.ibm.wala.util.warnings.WarningSet) <tt>Util.makeRTABuilder()</tt>]), but its use is strongly discouraged. The included 0-CFA analysis (see [[UserGuide:PointerAnalysis]]) is almost always faster and more precise. Furthermore, RTA operates on bytecodes, some of which may be proved dead during SSA construction and hence not represented in the SSA IR. This can lead to undesirable behaviors like call sites returned by the RTA call graph that do not appear in the SSA IR. Finally, note that models of native methods like <tt>Object.clone()</tt> in the RTA call graph are "sound enough" to ensure that the call graph includes all reachable code but may be unsound otherwise.

Current revision

wala.core technical overview

Call Graph Basics

The CallGraph class represents potentially context-sensitive call graphs, via a logical cloning of methods. Each call graph node (CGNode) represents a method IMethod in a Context.

So what's a Context? Basically, a Context is just a name for a clone of an IMethod. For context-insensitive call graphs, note the special Context Everywhere.EVERYWHERE. This will be used as a default context in context-insensitive algorithms.

Note that for a given IMethod, a context-sensitive call graph may have many nodes (contexts) representing the method. You can get all these nodes using the method CallGraph.getNodes(MethodReference m)

WALA supports a family of on-the-fly call graph construction algorithms, integrated with flow-insensitive pointer analysis. See UserGuide:PointerAnalysis for more details. WALA also has an implementation of call-graph construction via rapid type analysis (see Util.makeRTABuilder()), but its use is strongly discouraged. The included 0-CFA analysis (see UserGuide:PointerAnalysis) is almost always faster and more precise. Furthermore, RTA operates on bytecodes, some of which may be proved dead during SSA construction and hence not represented in the SSA IR. This can lead to undesirable behaviors like call sites returned by the RTA call graph that do not appear in the SSA IR. Finally, note that models of native methods like Object.clone() in the RTA call graph are "sound enough" to ensure that the call graph includes all reachable code but may be unsound otherwise.

Personal tools
project information