harpoon.Analysis.PA2
Class PointerAnalysis

java.lang.Object
  extended by harpoon.Analysis.PA2.PointerAnalysis
Direct Known Subclasses:
WPPointerAnalysis

public abstract class PointerAnalysis
extends Object

PointerAnalysis attemps to give a specification for the different pointer analysis implementations.

Version:
$Id: PointerAnalysis.java,v 1.2 2005/09/19 00:43:30 salcianu Exp $
Author:
Alexandru Salcianu <salcianu@alum.mit.edu>

Constructor Summary
PointerAnalysis()
           
 
Method Summary
abstract  CallGraph getCallGraph()
           
abstract  CachingCodeFactory getCodeFactory()
           
abstract  FullAnalysisResult getFullResult(HMethod hm, AnalysisPolicy ap)
          Similar to getInterProcResult but returns all information the pointer analysis is able to infer about hm.
abstract  InterProcAnalysisResult getInterProcResult(HMethod hm, AnalysisPolicy ap)
          The simplified analysis result for the end of the method hm.
abstract  NodeRepository getNodeRep()
           
 boolean hasAnalyzedCALL(CALL cs, HMethod callee)
          Checks whether the call cs to callee has been analyzed or not.
 boolean isAnalyzable(HMethod hm)
          Checks whether hm can be analyzed.
 void notifyAnalyzedCALL(CALL cs, HMethod callee)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointerAnalysis

public PointerAnalysis()
Method Detail

getInterProcResult

public abstract InterProcAnalysisResult getInterProcResult(HMethod hm,
                                                           AnalysisPolicy ap)
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).

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 abstract FullAnalysisResult getFullResult(HMethod hm,
                                                 AnalysisPolicy ap)
Similar to getInterProcResult but returns all information the pointer analysis is able to infer about hm.

See Also:
PointerAnalysis#InterProcAnalysisResult

getCallGraph

public abstract CallGraph getCallGraph()
Returns:
Call graph used by this PointerAnalysis to interpret the virtual calls in the inter-procedural analysis.

getCodeFactory

public abstract CachingCodeFactory getCodeFactory()
Returns:
Code factory used to generate the code of the analyzed methods.

getNodeRep

public abstract NodeRepository getNodeRep()
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.

isAnalyzable

public boolean isAnalyzable(HMethod hm)
Checks whether hm can be analyzed. The default implementation returns true unless the method is native or abstract.


notifyAnalyzedCALL

public void notifyAnalyzedCALL(CALL cs,
                               HMethod callee)

hasAnalyzedCALL

public boolean hasAnalyzedCALL(CALL cs,
                               HMethod callee)
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.