|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.IR.Tree.DerivationGenerator
public class DerivationGenerator
DerivationGenerator
takes a partial map of
Tree.Exp
s-to-type/derivations and answers
type/derivation queries as if the complete map were
present. In particular, only Tree.TEMP
s
and Tree.MEM
s are typically explicitly
typed in the map; types for the rest of the
Tree.Exp
s can be inferred from these.
Constructor Summary | |
---|---|
DerivationGenerator()
Creates a DerivationGenerator . |
Method Summary | |
---|---|
Tree.CloneCallback |
cloneCallback(TreeDerivation oldDeriv)
|
Derivation.DList |
derivation(Exp exp)
Returns the derivation of a given tree expression exp . |
void |
putDerivation(Exp exp,
Derivation.DList derivation)
Add a mapping from the given Tree.Exp exp
to the given Derivation.DList derivation . |
void |
putType(Exp exp,
HClass type)
Add a mapping from the given Tree.Exp exp
to the given HClass type to this
DerivationGenerator . |
void |
putTypeAndTemp(Exp exp,
HClass type,
Temp temp)
Add a mapping from the given Tree.Exp exp
to the given HClass type to the
DerivationGenerator , indicating that this value lives
in Temp temp . |
void |
remove(Exp exp)
Remove all type and derivation mappings for the given Tree.Exp . |
HClass |
typeMap(Exp exp)
Returns the type of a given tree expression exp . |
void |
update(Exp oldE,
Exp newE)
Transfer typing from one exp to another. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DerivationGenerator()
DerivationGenerator
.
Method Detail |
---|
public HClass typeMap(Exp exp) throws TypeMap.TypeNotKnownException
TreeDerivation
exp
.
If the type of the Tree.Exp
is not known, throws
TypeNotKnownException
. If the Tree.Exp
represents a derived pointer, null
is returned, in
which case the derivation()
method must
return a non-null
value. HClass.Void
is returned to indicate the type of a null pointer; as a special
case, it is also returned to indicate the type of an opaque
pointer value which does not correspond to a java object pointer
or some derivation thereof and thus should not be traced during
garbage collection.
typeMap
in interface TreeDerivation
exp
- The tree expression to examine.
exp
TypeMap.TypeNotKnownException
- if the TreeDerivation
does not have any information about exp
.TypeMap
public Derivation.DList derivation(Exp exp) throws TypeMap.TypeNotKnownException
TreeDerivation
exp
.
If the derivation of the Tree.Exp
is not known,
throws TypeNotKnownException
. If the
Tree.Exp
represents a non-derived base pointer,
returns null
, in which case the typeMap()
method must return a non-null
value.
derivation
in interface TreeDerivation
exp
- The tree expression to examine.
exp
TypeMap.TypeNotKnownException
- if the TreeDerivation
does not have any information about exp
.Derivation
public void putType(Exp exp, HClass type)
Tree.Exp
exp
to the given HClass
type
to this
DerivationGenerator
.
public void putTypeAndTemp(Exp exp, HClass type, Temp temp)
Tree.Exp
exp
to the given HClass
type
to the
DerivationGenerator
, indicating that this value lives
in Temp
temp
.
public void putDerivation(Exp exp, Derivation.DList derivation)
Tree.Exp
exp
to the given Derivation.DList
derivation
.
public void update(Exp oldE, Exp newE)
public void remove(Exp exp)
Tree.Exp
. Used for memory management purposes.
public Tree.CloneCallback cloneCallback(TreeDerivation oldDeriv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |