|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jikesrvm.compilers.opt.liveness.LiveSet
public class LiveSet
This file provides a sorted set (of registers) ADT with the following public operations: clear() - empties the set contains(reg) - checks if reg is in the set add(reg) - adds reg to the set add(set2) - adds the contents of set2 to the set remove(reg) - removes reg from the set remove(set2) - removes the contents of set2 from the set enumerator() - returns an enumeration of the set toString() - returns a string version of the set isEmpty() - returns true, iff the set is empty
| Field Summary | |
|---|---|
private static boolean |
DEBUG
just used for debugging |
private LiveSetElement |
first
The beginning of the list |
| Constructor Summary | |
|---|---|
LiveSet()
|
|
| Method Summary | |
|---|---|
boolean |
add(LiveSet additionList)
adds the contents of set2 to the set |
void |
add(RegisterOperand item)
create a new object from the passed parameter and add it to the list |
void |
clear()
Empties the set |
boolean |
contains(Register item)
Determines if the item passed is in the current set |
private LiveSetElement |
createAndAddToCurrentList(RegisterOperand register,
LiveSetElement prevElement)
Copy the newElement into a new object and add it to the list after prevElement. |
LiveSetEnumerator |
enumerator()
Returns an enumerator of the list |
private LiveSetElement |
getNextPtr(LiveSetElement ptr)
Inspects the passed ptr, if it is nonnull it returns its next field otherwise, it returns "first" |
boolean |
isEmpty()
Is the current set empty? |
void |
remove(LiveSet removalList)
removes the contents of the passed set from the currrent set, i.e., this = this - removeList |
(package private) void |
remove(RegisterOperand item)
removes the passed reg from the set |
String |
toString()
String-i-fy the current list |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private LiveSetElement first
private static final boolean DEBUG
| Constructor Detail |
|---|
public LiveSet()
| Method Detail |
|---|
public final void clear()
public boolean contains(Register item)
item - the register to search for
public void add(RegisterOperand item)
item - an object that contains the register to used in the newly
created objectpublic boolean add(LiveSet additionList)
additionList -
public void remove(LiveSet removalList)
removalList - the list to remove fromvoid remove(RegisterOperand item)
item - the registerOperand holding the register of interestpublic boolean isEmpty()
public String toString()
toString in class Objectpublic final LiveSetEnumerator enumerator()
private LiveSetElement createAndAddToCurrentList(RegisterOperand register,
LiveSetElement prevElement)
register - the element to copy and insertprevElement - the element on the current list to insert after
or null, indicating insert at the front
private LiveSetElement getNextPtr(LiveSetElement ptr)
ptr - the ptr to look at it
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||