harpoon.Analysis.Maps
Class DefaultMap<HCE extends HCodeElement>

java.lang.Object
  extended by harpoon.Analysis.Maps.DefaultMap<HCE>
All Implemented Interfaces:
ConstMap<HCE>, ExecMap<HCE>

public class DefaultMap<HCE extends HCodeElement>
extends Object
implements ConstMap<HCE>, ExecMap<HCE>

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.4 2002/09/02 19:23:26 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Constructor Summary
DefaultMap()
           
 
Method Summary
 Object constMap(HCE hce, Temp t)
          Determine the constant value of a given temporary in the context of a specific definition.
 boolean execMap(HCE node)
          Returns the executable status of an HCodeElement.
 boolean execMap(HCodeEdge<HCE> edge)
          Returns the executable status of an HCodeEdge.
 boolean isConst(HCE 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(HCE 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<HCE extends HCodeElement>
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(HCE 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<HCE extends HCodeElement>
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(HCE node)
Description copied from interface: ExecMap
Returns the executable status of an HCodeElement.

Specified by:
execMap in interface ExecMap<HCE extends HCodeElement>
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<HCE> edge)
Description copied from interface: ExecMap
Returns the executable status of an HCodeEdge.

Specified by:
execMap in interface ExecMap<HCE extends HCodeElement>
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.