harpoon.Analysis.PA2
Class WPPointerAnalysis
java.lang.Object
harpoon.Analysis.PA2.PointerAnalysis
harpoon.Analysis.PA2.WPPointerAnalysis
public class WPPointerAnalysis
- extends PointerAnalysis
WPPointerAnalysis is a whole-program pointer analysis.
"Whole-program" = every time the analysis is queried to analyze a
specific method m, it will analyze all the transitive
callees of m (the analysis results for the callees are
used by the intre-procedural analysis). Therefore, the analysis of
the main method of the application implies the analysis of all the
methods from the program, which leads to a precise result, but may
take a very long time.
- Version:
- $Id: WPPointerAnalysis.java,v 1.13 2006/01/09 05:13:12 salcianu Exp $
- Author:
- Alexandru Salcianu <salcianu@alum.mit.edu>
WPPointerAnalysis
public WPPointerAnalysis(CachingCodeFactory hcf,
CallGraph cg,
Linker linker,
ClassHierarchy classHierarchy,
Collection<HMethod> roots,
int fpMaxIter)
getCallGraph
public CallGraph getCallGraph()
- Specified by:
getCallGraph in class PointerAnalysis
- Returns:
- Call graph used by
this
PointerAnalysis to interpret the virtual calls in
the inter-procedural analysis.
getCodeFactory
public CachingCodeFactory getCodeFactory()
- Specified by:
getCodeFactory in class PointerAnalysis
- Returns:
- Code factory used to generate the code of the analyzed methods.
getNodeRep
public NodeRepository getNodeRep()
- Specified by:
getNodeRep in class PointerAnalysis
- Returns:
NodeRepository object that maps between
nodes and the instructions they were introduced for: e.g.,
will give the inside node for a specific NEW instruction.
getInterProcResult
public InterProcAnalysisResult getInterProcResult(HMethod hm,
AnalysisPolicy ap)
- Description copied from class:
PointerAnalysis
- The simplified analysis result for the end of the method
hm. This result is used in the inter-procedural
analysis. In addition, it seems to be enough for certain
optimizations (i.e., stack-allocation).
- Specified by:
getInterProcResult in class PointerAnalysis
- Parameters:
hm - Method to analyze.ap - Analysis policy (e.g., flow sensitivity or not?)
This is only a HINT: different analysis implementations may
ignore certain elements of the analysis policy. If
null, the analysis will return whatever is the
best analysis result it already has computed
(null if no such result).- See Also:
InterProcAnalysisResult
getFullResult
public FullAnalysisResult getFullResult(HMethod hm,
AnalysisPolicy ap)
- Description copied from class:
PointerAnalysis
- Similar to
getInterProcResult but returns all
information the pointer analysis is able to infer about
hm.
- Specified by:
getFullResult in class PointerAnalysis
- See Also:
PointerAnalysis#InterProcAnalysisResult
hasAnalyzedCALL
public boolean hasAnalyzedCALL(CALL cs,
HMethod callee)
- Description copied from class:
PointerAnalysis
- Checks whether the call
cs to callee
has been analyzed or not. Why is this important? For speed
reasons, the pointer analysis may have decided to ignore
certain calls. However, analysis clients must be aware of
this; e.g., this information is important if we perform
inlining in order to enhance stack-allocation.
- Overrides:
hasAnalyzedCALL in class PointerAnalysis
finalize
protected void finalize()
- Overrides:
finalize in class Object