|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.dfsolver.DF_AbstractCell org.jikesrvm.compilers.opt.ssa.IndexPropagation.ObjectCell
static final class IndexPropagation.ObjectCell
An ObjectCell is a lattice cell for the index propagation problem, used in redundant load elimination for fields.
An ObjectCell represents a set of value numbers, indicating that the elements indexed by these value numbers are available for a certain field type.
Note: this implementation does not scale, and is not terribly efficient.
Field Summary | |
---|---|
private static int |
CAPACITY
a bound on the size of a lattice cell. |
private HeapVariable<?> |
key
The heap variable this lattice cell tracks information for. |
private int[] |
numbers
a set of value numbers comparising this lattice cell. |
private int |
size
The number of value numbers in this cell. |
private boolean |
TOP
Does this lattice cell represent TOP? |
Constructor Summary | |
---|---|
IndexPropagation.ObjectCell(HeapVariable<?> key)
Create a lattice cell corresponding to a heap variable. |
Method Summary | |
---|---|
(package private) void |
add(int v)
Add a value number to this cell. |
(package private) void |
clear()
Clear all value numbers from this cell. |
(package private) boolean |
contains(int v)
Does this cell contain the value number v? |
(package private) int[] |
copyValueNumbers()
Return a deep copy of the value numbers in this cell. |
(package private) HeapVariable<?> |
getKey()
Return the key |
(package private) boolean |
isBOTTOM()
Does this cell represent the BOTTOM element in the dataflow lattice? |
(package private) boolean |
isTOP()
Does this cell represent the TOP element in the dataflow lattice? |
(package private) void |
remove(int v)
Remove a value number from this cell. |
(package private) void |
setBOTTOM()
Set the value of this cell to BOTTOM. |
static boolean |
setsDiffer(int[] set1,
int[] set2)
Do two sets of value numbers differ? |
(package private) void |
setTOP(boolean b)
Mark this cell as representing (or not) the TOP element in the dataflow lattice. |
String |
toString()
Return a string representation of this cell |
Methods inherited from class org.jikesrvm.compilers.opt.dfsolver.DF_AbstractCell |
---|
addDef, addUse, getDefs, getIndex, getScratch, getUses, inNodes, outNodes, setIndex, setScratch |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final int CAPACITY
private int[] numbers
private int size
private final HeapVariable<?> key
private boolean TOP
Constructor Detail |
---|
IndexPropagation.ObjectCell(HeapVariable<?> key)
key
- the heap variable associated with this cell.Method Detail |
---|
HeapVariable<?> getKey()
boolean isTOP()
boolean isBOTTOM()
void setTOP(boolean b)
b
- should this cell contain TOP?void setBOTTOM()
boolean contains(int v)
v
- value number in question
void add(int v)
v
- value numbervoid remove(int v)
v
- value numbervoid clear()
int[] copyValueNumbers()
public String toString()
toString
in interface DF_LatticeCell
toString
in class DF_AbstractCell
public static boolean setsDiffer(int[] set1, int[] set2)
SIDE EFFECT: sorts the sets
set1
- first set to compareset2
- second set to compare
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |