harpoon.Analysis.PointerAnalysis
Class ODPointerAnalysis

java.lang.Object
  |
  +--harpoon.Analysis.PointerAnalysis.ODPointerAnalysis

public class ODPointerAnalysis
extends Object

ODPointerAnalysis is the main class of the Pointer Analysis package. It is designed to act as a query-object: after being initialized, it can be asked to provide the Parallel Interaction Graph valid at the end of a specific method.

Version:
$Id: ODPointerAnalysis.java,v 1.3 2002/02/26 22:41:20 cananian Exp $
Author:
Alexandru SALCIANU <salcianu@retezat.lcs.mit.edu>

Field Summary
static String ARRAY_CONTENT
          Array elements are modeled as fields of the array object, all of them with the same name since the analysis is not able to make the distinction between the fields.
static MethodHole BottomHole
           
static boolean BOUNDED_ANALYSIS_DEPTH
           
static boolean CALL_CONTEXT_SENSITIVE
          Activates the calling context sensitivity.
static int current_analysis_depth
           
static boolean DEBUG
           
static boolean DEBUG_SCC
           
static boolean DEBUG2
           
static boolean DETAILS2
           
static boolean DETERMINISTIC
          Makes the pointer analysis deterministic to make the debug easier.
static boolean FIRST_ANALYSIS
           
static HashMap[] hash_proc_ext_d
           
static HashMap[] hash_proc_int_d
           
static boolean IGNORE_EO
          Hack to speed it up: it appears to me that the edge ordering relation is not extremely important: in recursive methods or in methods with loops, it tends to be just a cartesian product between I and O.
static Set interestingNodes
           
static Set interestingQuads
           
static boolean LOOP_SENSITIVE
          Activates the loop sensitivity.
static boolean MartinTheWildHacker
           
static int MAX_ANALYSIS_ABOVE_SPEC
           
static int MAX_ANALYSIS_DEPTH
           
static int MAX_SPEC_DEPTH
          The specialization limit.
static int mh_number
           
static boolean NODES_DRIVEN
           
static int number_of_mapups
           
static int number_of_mm_analyzed
           
static boolean ODA_precise
           
static boolean ON_DEMAND_ANALYSIS
           
static Map Quad2Node
           
static Relation Quad2Nodes
           
static boolean SAVE_MEMORY
          Turns on the save memory mode.
 CachingSCCLBBFactory scc_lbb_factory
           
static boolean SHOW_NODES
           
static boolean STATS
           
static boolean THREAD_SENSITIVE
          Activates the full thread sensitivity.
static boolean TIMING
          Turns on the priniting of some timing info.
static boolean TOUCHED_THREAD_SUPPORT
          Controls the recording of data about the thread nodes that are touched after being started.
static boolean WEAKLY_THREAD_SENSITIVE
          Activates the weak thread sensitivity.
 
Constructor Summary
ODPointerAnalysis(MetaCallGraph _mcg, MetaAllCallers _mac, LBBConverter lbbconv)
          Creates a ODPointerAnalysis.
 
Method Summary
static boolean analyzable(HMethod hm)
          Check if hm can be analyzed by the pointer analysis.
 void analyze_intra_proc(MetaMethod mm)
           
 int count_creation_sites(MetaMethod mm)
           
 boolean create_inside_nodes(MetaMethod mm)
           
 ODParIntGraph getExtParIntGraph(MetaMethod mm)
          Returns the simplified (external) ODParIntGraph attached to the method hm i.e.
 ODParIntGraph getExtParIntGraph(MetaMethod mm, boolean compute_it)
           
 ODParIntGraph getExtThreadInteraction(MetaMethod mm)
           
 ODParIntGraph getIntParIntGraph(MetaMethod mm)
          Returns the full (internal) ODParIntGraph attached to the method hm i.e.
 ODParIntGraph getIntParIntGraph(MetaMethod mm, boolean compute_it)
           
 ODParIntGraph getIntThreadInteraction(MetaMethod mm)
           
 MetaAllCallers getMetaAllCallers()
           
 MetaCallGraph getMetaCallGraph()
           
 PANode[] getParamNodes(MetaMethod mm)
          Returns the parameter nodes of the method hm.
 ODParIntGraph getPIGAtQuad(MetaMethod mm, Quad q)
          Returns the parallel interaction graph attached to the program point right before q in the body of meta-method mm.
 boolean harmful_native(HMethod hm)
           
 boolean isAnalyzed(MetaMethod mm)
           
 void make_thread_heap(MetaMethod mm, ODMAInfo mainfo)
           
 Set pointedNodes(MetaMethod mm, Quad q, Temp l)
          Returns the set of the nodes pointed by the temporary t at the point right before executing instruction q from the body of meta-method mm.
 void print_stats()
          Prints some statistics.
 ODParIntGraph threadInteraction(MetaMethod mm)
          Returns the parallel interaction graph for the end of the method hm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values

DEBUG2

public static final boolean DEBUG2
See Also:
Constant Field Values

DEBUG_SCC

public static final boolean DEBUG_SCC
See Also:
Constant Field Values

SAVE_MEMORY

public static final boolean SAVE_MEMORY
Turns on the save memory mode. In this mode, some of the speed is sacrified for the sake of the memory consumption. More specifically, the Interior, large version of the Parallel Interaction Graph at the end of a method is no longer cached.

See Also:
Constant Field Values

DETERMINISTIC

public static final boolean DETERMINISTIC
Makes the pointer analysis deterministic to make the debug easier. The main source of undeterminism in our code is the intensive use of Sets which doesn't offer any guarantee about the order in which they iterate over their elements.

See Also:
Constant Field Values

TIMING

public static boolean TIMING
Turns on the priniting of some timing info.


STATS

public static final boolean STATS
See Also:
Constant Field Values

SHOW_NODES

public static boolean SHOW_NODES

DETAILS2

public static final boolean DETAILS2
See Also:
Constant Field Values

IGNORE_EO

public static final boolean IGNORE_EO
Hack to speed it up: it appears to me that the edge ordering relation is not extremely important: in recursive methods or in methods with loops, it tends to be just a cartesian product between I and O.

See Also:
Constant Field Values

TOUCHED_THREAD_SUPPORT

public static final boolean TOUCHED_THREAD_SUPPORT
Controls the recording of data about the thread nodes that are touched after being started.

See Also:
Constant Field Values

CALL_CONTEXT_SENSITIVE

public static boolean CALL_CONTEXT_SENSITIVE
Activates the calling context sensitivity. When this flag is on, the nodes from the graph of the callee are specialized for each call site (up to MAX_SPEC_DEPTH times). This increases the precision of the analysis but requires more time and memory.


MAX_SPEC_DEPTH

public static int MAX_SPEC_DEPTH
The specialization limit. This puts a limit to the otherwise exponential growth of the number of nodes in the analysis.


THREAD_SENSITIVE

public static boolean THREAD_SENSITIVE
Activates the full thread sensitivity. When this flag is on, the analysis makes the distinction not only between the nodes allocated by the current thread and those allocated by all the others but also between the nodes allocated by threads with different run methods (for the time being, we cannot make the distinction between two threads with the same thread node).


WEAKLY_THREAD_SENSITIVE

public static boolean WEAKLY_THREAD_SENSITIVE
Activates the weak thread sensitivity. When this flag is on, the precision of the interthread analysis is increased: the nodes from the graph of the run method of the thread whose interactions with the current thread are analyzed are specialized to differenciate between the nodes created by that thread and the nodes created by the current one. This increases the precision of the analysis but requires more time and memory.


LOOP_SENSITIVE

public static boolean LOOP_SENSITIVE
Activates the loop sensitivity. When this flag is on, the precision of the intra-method analysis is increased by making the difference between the last object allocated at a specific object creation site inside a loop and the objects allocated at the same object creation site but in the previous iterations. This enambles some strong optimizations but requires more time and memory.


ARRAY_CONTENT

public static final String ARRAY_CONTENT
Array elements are modeled as fields of the array object, all of them with the same name since the analysis is not able to make the distinction between the fields. this name is supposed to be "as impossible as possible", so that we don't have any conflict with real fields.

See Also:
Constant Field Values

BOUNDED_ANALYSIS_DEPTH

public static boolean BOUNDED_ANALYSIS_DEPTH

ON_DEMAND_ANALYSIS

public static boolean ON_DEMAND_ANALYSIS

ODA_precise

public static boolean ODA_precise

NODES_DRIVEN

public static boolean NODES_DRIVEN

FIRST_ANALYSIS

public static boolean FIRST_ANALYSIS

MAX_ANALYSIS_DEPTH

public static int MAX_ANALYSIS_DEPTH

MAX_ANALYSIS_ABOVE_SPEC

public static int MAX_ANALYSIS_ABOVE_SPEC

current_analysis_depth

public static int current_analysis_depth

number_of_mapups

public static int number_of_mapups

number_of_mm_analyzed

public static int number_of_mm_analyzed

Quad2Node

public static Map Quad2Node

MartinTheWildHacker

public static boolean MartinTheWildHacker

hash_proc_int_d

public static HashMap[] hash_proc_int_d

hash_proc_ext_d

public static HashMap[] hash_proc_ext_d

interestingQuads

public static Set interestingQuads

interestingNodes

public static Set interestingNodes

Quad2Nodes

public static Relation Quad2Nodes

scc_lbb_factory

public final CachingSCCLBBFactory scc_lbb_factory

mh_number

public static int mh_number

BottomHole

public static MethodHole BottomHole
Constructor Detail

ODPointerAnalysis

public ODPointerAnalysis(MetaCallGraph _mcg,
                         MetaAllCallers _mac,
                         LBBConverter lbbconv)
Creates a ODPointerAnalysis.

Parameters:
_mcg - The (meta) Call Graph that models the caller-callee relation between methods.
_mac - The dual of _mcg (ie the callee-caller relation.
lbbconv - The producer of the (Light) Basic Block representation of a method body.
Method Detail

getMetaCallGraph

public final MetaCallGraph getMetaCallGraph()

getMetaAllCallers

public final MetaAllCallers getMetaAllCallers()

getIntParIntGraph

public ODParIntGraph getIntParIntGraph(MetaMethod mm)
Returns the full (internal) ODParIntGraph attached to the method hm i.e. the graph at the end of the method. Returns null if no such graph is available.


isAnalyzed

public boolean isAnalyzed(MetaMethod mm)

getIntParIntGraph

public ODParIntGraph getIntParIntGraph(MetaMethod mm,
                                       boolean compute_it)

getExtParIntGraph

public ODParIntGraph getExtParIntGraph(MetaMethod mm)
Returns the simplified (external) ODParIntGraph attached to the method hm i.e. the graph at the end of the method. of which only the parts reachable from the exterior (via parameters, returned objects or static classes) have been preserved. The escape function do not consider the parameters of the function (anyway, this graph is supposed to be inlined into the graph of the caller, so the parameters will disappear anyway). Returns null if no such graph is available.


getExtParIntGraph

public ODParIntGraph getExtParIntGraph(MetaMethod mm,
                                       boolean compute_it)

getParamNodes

public PANode[] getParamNodes(MetaMethod mm)
Returns the parameter nodes of the method hm. This is useful for the understanding of the ODParIntGraph attached to hm


threadInteraction

public ODParIntGraph threadInteraction(MetaMethod mm)
Returns the parallel interaction graph for the end of the method hm. The interactions between hm and the threads it (transitively) starts are analyzed in order to "recover" some of the escaped nodes.
See Section 10 Inter-thread Analysis in the original paper of Martin and John Whaley for more details.


getExtThreadInteraction

public ODParIntGraph getExtThreadInteraction(MetaMethod mm)

getIntThreadInteraction

public ODParIntGraph getIntThreadInteraction(MetaMethod mm)

analyze_intra_proc

public void analyze_intra_proc(MetaMethod mm)

create_inside_nodes

public boolean create_inside_nodes(MetaMethod mm)

make_thread_heap

public void make_thread_heap(MetaMethod mm,
                             ODMAInfo mainfo)

count_creation_sites

public int count_creation_sites(MetaMethod mm)

analyzable

public static final boolean analyzable(HMethod hm)
Check if hm can be analyzed by the pointer analysis.


harmful_native

public final boolean harmful_native(HMethod hm)

print_stats

public final void print_stats()
Prints some statistics.


getPIGAtQuad

public final ODParIntGraph getPIGAtQuad(MetaMethod mm,
                                        Quad q)
Returns the parallel interaction graph attached to the program point right before q in the body of meta-method mm.


pointedNodes

public final Set pointedNodes(MetaMethod mm,
                              Quad q,
                              Temp l)
Returns the set of the nodes pointed by the temporary t at the point right before executing instruction q from the body of meta-method mm.