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

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

public class ConstMapProxy<HCE extends HCodeElement>
extends Object
implements ConstMap<HCE>

A ConstMapProxy implements a ConstMap for a cloned HCode given the HCodeAndMaps which specifies its relationship to an HCode for which a ConstMap is known.

Version:
$Id: ConstMapProxy.java,v 1.3 2002/09/02 19:23:26 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Constructor Summary
ConstMapProxy(HCodeAndMaps<HCE> hcam, ConstMap<HCE> cm)
          Creates a ConstMapProxy.
 
Method Summary
 Object constMap(HCE hce, Temp t)
          Determine the constant value of a given temporary in the context of a specific definition.
 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

ConstMapProxy

public ConstMapProxy(HCodeAndMaps<HCE> hcam,
                     ConstMap<HCE> cm)
Creates a ConstMapProxy.

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.