|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object spiglet.translate.graph.Liveness<T>
T
- the type of the variable (member of live-in
and
live-out
sets).public class Liveness<T>
This class represents a liveness analyzer of a control flow graph. From the
def
and set
sets of a flow graph, liveness analysis is done
to generate the live-in
and live-out
sets of each node.
This information will eventually be used to build an interference graph
based on a given control flow graph.
FlowGraph
,
InterferenceGraph
,
Node
Nested Class Summary | |
---|---|
class |
Liveness.LiveRange
Defines the data structure for a live range of a variable, with the natural ordering based on start point. |
Constructor Summary | |
---|---|
Liveness(FlowGraph<T> graph)
Analyze the given flow graph for liveness of variables along its edges. |
Method Summary | |
---|---|
protected java.util.Set<T> |
getInSet(Node n)
Returns the (modifiable) live-in set of a node. |
java.util.Set<Liveness.LiveRange> |
getLiveRanges()
Returns the set of variable live ranges (as encoded in the wrapper). |
java.util.Set<T> |
getOutSet(Node n)
Returns the (unmodifiable) live-out set of a node. |
java.lang.String |
toString()
Returns a multi-line string representation of each node's live-in and live-out sets, each line in the form:
[#] [live-in={?,?,...,?.}, live-out={?,?,...,?,}] . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Liveness(FlowGraph<T> graph)
graph
- the control flow graphMethod Detail |
---|
protected java.util.Set<T> getInSet(Node n)
live-in
set of a node. This set
contains the variables that are live along the edge coming into the
given node.
Pre-condition: n
exists in the given flow graph.
n
- the node to look up
live-in
set of the nodepublic java.util.Set<T> getOutSet(Node n)
live-out
set of a node. This set
contains the variables that are live along the edge going out of the
given node.
Pre-condition: n
exists in the given flow graph.
n
- the node to look up
live-out
set of the nodepublic java.util.Set<Liveness.LiveRange> getLiveRanges()
public java.lang.String toString()
live-in
and live-out
sets, each line in the form:
[#] [live-in={?,?,...,?.}, live-out={?,?,...,?,}]
.
Used for debugging dump.
toString
in class java.lang.Object
live-in
and live-out
sets
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |