harpoon.Backend.CSAHack.RegAlloc
Class DerivationGenerator
java.lang.Object
harpoon.Backend.CSAHack.RegAlloc.DerivationGenerator
- All Implemented Interfaces:
- Derivation, TypeMap
public class DerivationGenerator
- extends Object
- implements Derivation
DerivationGenerator
helps maintain the accuracy of
the Derivation
while the register allocator creates
spills.
- Version:
- $Id: DerivationGenerator.java,v 1.6 2004/02/08 03:20:48 cananian Exp $
- Author:
- C. Scott Ananian <cananian@alumni.princeton.edu>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DerivationGenerator
public DerivationGenerator(Instr instrs,
Derivation deriv)
- Creates a
DerivationGenerator
.
typeMap
public HClass typeMap(HCodeElement hce,
Temp t)
throws TypeMap.TypeNotKnownException
- Description copied from interface:
TypeMap
- Return the type of a given temporary
t
, as defined
at the definition point hce
. Iff the type of the
temporary is not known, or if hce
does not define
t
, throws TypeNotKnownException
. If
the temporary represents a derived pointer, null
should be returned; in which case the Derivation
must return a non-null
value. Obviously,
TypeMap
s for high-level representations without
derived pointers should never return null
. As a
special case, HClass.Void
may be returned in
low-level IRs to indicate an opaque pointer value which does
not correspond to a java object pointer or some
derivation thereof --- for example, a pointer into a method
dispatch table. The only other time HClass.Void
should be returned is for known-null
pointer values.
- Specified by:
typeMap
in interface TypeMap
- Parameters:
hce
- The HCodeElement
defining t
.t
- The temporary to examine.
- Returns:
- the static type of
t
.
- Throws:
TypeMap.TypeNotKnownException
- if the TypeMap
does
not have any information about t
as defined
at hc
.
derivation
public Derivation.DList derivation(HCodeElement hce,
Temp t)
throws TypeMap.TypeNotKnownException
- Description copied from interface:
Derivation
- Map compiler temporaries to their derivations.
- Specified by:
derivation
in interface Derivation
- Parameters:
hce
- A definition point for t
.t
- The temporary to query.
- Returns:
null
if the temporary has no derivation (is
a base pointer, for example), or the derivation otherwise.
- Throws:
TypeMap.TypeNotKnownException