harpoon.Analysis.Maps
Class DefaultMap

java.lang.Object
  |
  +--harpoon.Analysis.Maps.DefaultMap
All Implemented Interfaces:
ConstMap, ExecMap

public class DefaultMap
extends Object
implements ConstMap, ExecMap

A DefaultMap returns conservative values for const and exec information: namely that no temp corresponds to a constant and that every node and edge is potentially executable.

Version:
$Id: DefaultMap.java,v 1.3 2002/02/25 20:58:10 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Constructor Summary
DefaultMap()
           
 
Method Summary
 Object constMap(HCodeElement hce, Temp t)
          Determine the constant value of a given temporary in the context of a specific definition.
 boolean execMap(HCodeEdge edge)
          Returns the executable status of an HCodeEdge.
 boolean execMap(HCodeElement node)
          Returns the executable status of an HCodeElement.
 boolean isConst(HCodeElement hce, Temp t)
          Determine whether a given temporary has a constant value at the specified definition point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMap

public DefaultMap()
Method Detail

isConst

public boolean isConst(HCodeElement hce,
                       Temp t)
Description copied from interface: ConstMap
Determine whether a given temporary has a constant value at the specified definition point.

Specified by:
isConst in interface ConstMap
Parameters:
hce - the definition point.
t - the Temp to be examined.
Returns:
true is the given definition point can be proven to give the specified Temp a constant value, false otherwise.

constMap

public Object constMap(HCodeElement hce,
                       Temp t)
Description copied from interface: ConstMap
Determine the constant value of a given temporary in the context of a specific definition.

Specified by:
constMap in interface ConstMap
Parameters:
hce - the definition point.
t - the temporary to be examined.
Returns:
an object corresponding to the constant value of this temporary defined at this point. Values of base types get wrapped in objects in the standard way.

execMap

public boolean execMap(HCodeElement node)
Description copied from interface: ExecMap
Returns the executable status of an HCodeElement.

Specified by:
execMap in interface ExecMap
Parameters:
node - The HCodeElement to examine.
Returns:
true if it is possible to execute this HCodeElement; or false if it can be proved that this HCodeElement will never be executed.

execMap

public boolean execMap(HCodeEdge edge)
Description copied from interface: ExecMap
Returns the executable status of an HCodeEdge.

Specified by:
execMap in interface ExecMap
Parameters:
edge - An edge between two HCodeElements in some HCode.
Returns:
true if it is possible to traverse this edge during execution, or false if it can be proved that this edge will never be followed.