|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectharpoon.Analysis.Instr.EqTempSets
public abstract class EqTempSets
EqTempSets tracks a set of disjoint set of temps, and
potentially associates each set with a favored register temp (which
itself is not part of the set)
Overview: an EqTempSets is a pair <S,M>, where
| Field Summary | |
|---|---|
protected RegAlloc |
ra
|
protected HashMap |
repToReg
|
| Constructor Summary | |
|---|---|
EqTempSets()
|
|
| Method Summary | |
|---|---|
void |
add(Temp t1,
Temp t2)
Adds an equivalency between t1 and
t2 to this. |
void |
associate(Temp t,
Temp reg)
Associates t with reg. |
Temp |
getReg(Temp t)
Returns the register temp associated with t. |
abstract Temp |
getRep(Temp t)
Returns the rep for t. |
static EqTempSets |
make(RegAlloc ra,
boolean printable)
Constructs and returns a new EqTempSets. |
Temp |
tempMap(Temp t)
Rename a single Temp. |
protected abstract void |
union(Temp t1,
Temp t2)
Unifies t1 and t2. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RegAlloc ra
protected HashMap repToReg
| Constructor Detail |
|---|
public EqTempSets()
| Method Detail |
|---|
public static EqTempSets make(RegAlloc ra,
boolean printable)
EqTempSets. The
returned EqTempSets will have a usable toString()
method (but have less efficent operation) if
the printable argument is true.
public void associate(Temp t,
Temp reg)
t with reg.
effects: M_post = { getRep( `t' ) -> `reg' } + M
public Temp getReg(Temp t)
t.
effects: if `t' is a register temp, returns `t'.
else if the set for `t' has an
register `r', returns `r'
else returns null
public Temp tempMap(Temp t)
TempMapTemp.
tempMap in interface TempMap
public void add(Temp t1,
Temp t2)
t1 and
t2 to this.
requires: t1 or t2 is not a register
modifies: this
effects: puts t1 and t2 in the same equivalence class,
unifying all the temps in the two equivalence
classes for t1 and t2
unless:
- one of the temps is a register and the equivalence
set for the other temp already has a register
=> no modification to this
public abstract Temp getRep(Temp t)
t.
effects: if `t' is not a register, returns the set-rep for
the set containing `t'. If `t' is a register, returns
`t'.
protected abstract void union(Temp t1,
Temp t2)
t1 and t2.
requires: t1 and t2 are not registers
modifies: this
effects: unifies the equivalence classes for t1 and t2,
removing the old equivalence sets and creating a
new one whose rep is either t1 or t2.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||