|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.util.SpaceEffGraphNode
public class SpaceEffGraphNode
SpaceEffGraphNode is a generic graph node. Extend this to implement specific graph node types. A node has a list of out edges and a list of in edges. We maintain both to support bidirectional traversal of the graph.
Nested Class Summary | |
---|---|
static interface |
SpaceEffGraphNode.GraphEdgeEnumeration<T extends GraphEdge>
|
(package private) static class |
SpaceEffGraphNode.InEdgeEnumeration
|
(package private) static class |
SpaceEffGraphNode.InNodeEnumeration
|
static class |
SpaceEffGraphNode.OutEdgeEnumeration
|
(package private) static class |
SpaceEffGraphNode.OutNodeEnumeration
|
Field Summary | |
---|---|
protected SpaceEffGraphEdge |
_inEdgeEnd
|
protected SpaceEffGraphEdge |
_inEdgeStart
|
protected SpaceEffGraphEdge |
_outEdgeEnd
|
protected SpaceEffGraphEdge |
_outEdgeStart
|
(package private) static int |
DFS_VISITED
|
protected int |
info
The following word is used for various purposes. |
(package private) static int |
INFO_MASK
|
(package private) static int |
LOOP_HEADER
|
SpaceEffGraphNode |
next
Links inlined from DoublyLinkedListElement. |
SpaceEffGraphNode |
nextSorted
|
(package private) static int |
ON_STACK
|
SpaceEffGraphNode |
prev
Links inlined from DoublyLinkedListElement. |
int |
scratch
any optimization can use this for its own purposes |
Object |
scratchObject
scratch field: optimizations use as they wish |
(package private) static int |
TOP_VISITED
|
Constructor Summary | |
---|---|
SpaceEffGraphNode()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Object scratchObject
public int scratch
protected int info
static final int DFS_VISITED
static final int TOP_VISITED
static final int ON_STACK
static final int LOOP_HEADER
static final int INFO_MASK
public SpaceEffGraphNode nextSorted
protected SpaceEffGraphEdge _outEdgeStart
protected SpaceEffGraphEdge _outEdgeEnd
protected SpaceEffGraphEdge _inEdgeStart
protected SpaceEffGraphEdge _inEdgeEnd
public SpaceEffGraphNode prev
public SpaceEffGraphNode next
Constructor Detail |
---|
public SpaceEffGraphNode()
Method Detail |
---|
public final boolean dfsVisited()
public final boolean topVisited()
public final boolean onStack()
public final boolean flagsOn()
public final boolean isLoopHeader()
public final void setDfsVisited()
public final void setTopVisited()
public final void setOnStack()
public final void setDfsVisitedOnStack()
public final void setLoopHeader()
public final void clearDfsVisited()
public final void clearTopVisited()
public final void clearOnStack()
public final void clearFlags()
public final void clearLoopHeader()
public int getScratch()
GraphElement
getScratch
in interface GraphElement
public int setScratch(int scratch)
GraphElement
setScratch
in interface GraphElement
scratch
- the new contents of the int scratch fieldpublic final void setNumber(int value)
public final int getNumber()
public final int getIndex()
GraphNode
Graph.compactNodeNumbering
the nodes of a graph should be
numbered 0 thru (# of nodes in graph - 1).
getIndex
in interface GraphNode
public final void setIndex(int i)
setIndex
in interface GraphNode
public final SpaceEffGraphEdge firstInEdge()
public final SpaceEffGraphEdge firstOutEdge()
public final SpaceEffGraphNode firstInNode()
public final SpaceEffGraphNode firstOutNode()
final void clearIn()
final void clearOut()
public final void deleteIn()
public final void deleteOut()
public final int getNumberOfIn()
public final int getNumberOfOut()
public final boolean hasZeroOut()
public final boolean hasZeroIn()
public final boolean hasOneOut()
public final boolean hasOneIn()
public final boolean pointsIn(SpaceEffGraphNode inNode)
public final boolean pointsOut(SpaceEffGraphNode outNode)
public final boolean hasIn(GraphNode in)
public final boolean hasOut(GraphNode out)
public final SpaceEffGraphEdge findOutEdgeTo(SpaceEffGraphNode n)
public final void replaceInEdge(SpaceEffGraphEdge e1, SpaceEffGraphEdge e2)
TODO YUCK: this data structure is messy. I assume this is in the name of efficiency, but it makes control flow graph manipulations a real pain. (SJF)
public final boolean hasOneIn(SpaceEffGraphNode inNode)
public final boolean hasOneOut(SpaceEffGraphNode outNode)
public final void replaceOut(SpaceEffGraphNode oldOut, SpaceEffGraphNode newOut)
public final void insertOut(SpaceEffGraphNode to, SpaceEffGraphEdge e)
public final void insertOut(SpaceEffGraphNode to)
public final void deleteOut(SpaceEffGraphNode node)
public final void deleteOut(SpaceEffGraphEdge e)
public final void markDFN(int DFN)
public final void markSCC(int currSCC)
public final void sortDFS()
protected final void _sortDFS(SpaceEffGraphNode header)
public final void clearOutFlags()
public final void clearInFlags()
public final void sortTop()
protected final SpaceEffGraphNode _sortTop(SpaceEffGraphNode tail)
public final void sortRevTop()
protected final SpaceEffGraphNode _sortRevTop(SpaceEffGraphNode tail)
final void printSorted()
final void revertOuts()
public final SpaceEffGraphNode.InEdgeEnumeration inEdges()
public final SpaceEffGraphNode.OutEdgeEnumeration outEdges()
public final Enumeration<GraphNode> inNodes()
GraphNode
inNodes
in interface GraphNode
public final Enumeration<GraphNode> outNodes()
GraphNode
outNodes
in interface GraphNode
public void printInEdges()
public void printOutEdges()
public void printInNodes()
public void printOutNodes()
public void printExtended()
protected final void appendInEdge(SpaceEffGraphEdge e)
protected final void appendOutEdge(SpaceEffGraphEdge e)
protected final void removeIn(SpaceEffGraphEdge InEdge)
protected final SpaceEffGraphEdge removeIn(SpaceEffGraphNode InNode)
protected final void removeOut(SpaceEffGraphEdge OutEdge)
protected final SpaceEffGraphEdge removeOut(SpaceEffGraphNode OutNode)
public final SpaceEffGraphNode getNext()
public final SpaceEffGraphNode getPrev()
public final void append(SpaceEffGraphNode n)
n
- the node to appendpublic final SpaceEffGraphNode remove()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |