|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.IR.LowQuad.DerivationMap
DerivationMap
is a simple map-based implementation of
common Derivation
functionality.
DerivationGenerator
Nested Class Summary |
Nested classes inherited from class harpoon.Analysis.Maps.Derivation |
Derivation.DList |
Nested classes inherited from class harpoon.Analysis.Maps.TypeMap |
TypeMap.TypeNotKnownException |
Constructor Summary | |
DerivationMap()
Creates a DerivationMap . |
Method Summary | |
Derivation.DList |
derivation(HCodeElement hce,
Temp t)
Map compiler temporaries to their derivations. |
void |
putDerivation(HCodeElement hce,
Temp t,
Derivation.DList derivation)
Add a mapping from the given Temp t
defined at the given HCodeElement hce
to the given Derivation.DList derivation
to this DerivationMap . |
void |
putType(HCodeElement hce,
Temp t,
HClass type)
Add a mapping from the given Temp t
defined at the given HCodeElement hce
to the given HClass type to this
DerivationMap . |
void |
remove(HCodeElement hce,
Temp t)
Remove all type and derivation mappings for the given Temp defined at the given HCodeElement . |
void |
transfer(HCodeElement new_hce,
HCodeElement old_hce,
Temp[] old_defs,
TempMap old2new,
Derivation old_deriv)
Transfer typings from one Derivation to another, using
an appropriate TempMap . |
HClass |
typeMap(HCodeElement hce,
Temp t)
Return the type of a given temporary t , as defined
at the definition point hce . |
void |
update(HCodeElement old_hce,
Temp old_t,
HCodeElement new_hce,
Temp new_t)
Transfer typing from one place to another. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DerivationMap()
DerivationMap
.
Method Detail |
public HClass typeMap(HCodeElement hce, Temp t) throws TypeMap.TypeNotKnownException
TypeMap
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.
typeMap
in interface TypeMap
hce
- The HCodeElement
defining t
.t
- The temporary to examine.
t
.
TypeMap.TypeNotKnownException
- if the TypeMap
does
not have any information about t
as defined
at hc
.
TypeMap.TypeNotKnownException
public Derivation.DList derivation(HCodeElement hce, Temp t) throws TypeMap.TypeNotKnownException
Derivation
derivation
in interface Derivation
t
- The temporary to query.hce
- A definition point for t
.
null
if the temporary has no derivation (is
a base pointer, for example), or the derivation otherwise.
TypeMap.TypeNotKnownException
public void putType(HCodeElement hce, Temp t, HClass type)
Temp
t
defined at the given HCodeElement
hce
to the given HClass
type
to this
DerivationMap
.
public void putDerivation(HCodeElement hce, Temp t, Derivation.DList derivation)
Temp
t
defined at the given HCodeElement
hce
to the given Derivation.DList
derivation
to this DerivationMap
.
public void update(HCodeElement old_hce, Temp old_t, HCodeElement new_hce, Temp new_t)
public void transfer(HCodeElement new_hce, HCodeElement old_hce, Temp[] old_defs, TempMap old2new, Derivation old_deriv)
Derivation
to another, using
an appropriate TempMap
.
public void remove(HCodeElement hce, Temp t)
Temp
defined at the given HCodeElement
.
Used for memory management purposes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |