org.jikesrvm.compilers.opt.ssa
Class ValueGraphVertex

java.lang.Object
  extended by org.jikesrvm.compilers.opt.util.SpaceEffGraphNode
      extended by org.jikesrvm.compilers.opt.ssa.ValueGraphVertex
All Implemented Interfaces:
GraphElement, GraphNode

final class ValueGraphVertex
extends SpaceEffGraphNode

This class implements a vertex in the value graph used in global value numbering ala Alpern, Wegman and Zadeck. See Muchnick p.348 for a nice discussion.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jikesrvm.compilers.opt.util.SpaceEffGraphNode
SpaceEffGraphNode.GraphEdgeEnumeration<T extends GraphEdge>, SpaceEffGraphNode.OutEdgeEnumeration
 
Field Summary
private  int arity
          number of operands needed
private  Object label
          the name of the operator that does the definition
private  Object name
          the name of the variable defined by this node
private  ValueGraphVertex[] targets
          operand vertices, in order
private  int valueNumber
          integer value number
 
Fields inherited from class org.jikesrvm.compilers.opt.util.SpaceEffGraphNode
_inEdgeEnd, _inEdgeStart, _outEdgeEnd, _outEdgeStart, info, next, nextSorted, prev, scratch, scratchObject
 
Constructor Summary
ValueGraphVertex(Object name)
           
 
Method Summary
 void addTarget(ValueGraphVertex target, int pos)
           
(package private)  void copyVertex(ValueGraphVertex v)
          Set up properties of this vertex identically to another vertex
 int getArity()
           
(package private)  Object getLabel()
           
(package private)  Object getName()
           
 ValueGraphVertex getTarget(int i)
          return the target of the ith operand of this node
(package private)  int getValueNumber()
           
(package private)  boolean isBornAtAllocation()
           
(package private)  boolean isConstant()
           
(package private)  boolean representsParameter()
          Does this vertex represent an incoming parameter?
(package private)  void setLabel(Object label, int arity)
          Set the label for this vertex.
(package private)  void setValueNumber(int number)
           
 String toString()
           
 
Methods inherited from class org.jikesrvm.compilers.opt.util.SpaceEffGraphNode
_sortDFS, _sortRevTop, _sortTop, append, appendInEdge, appendOutEdge, clearDfsVisited, clearFlags, clearInFlags, clearLoopHeader, clearOnStack, clearOutFlags, clearTopVisited, deleteIn, deleteOut, deleteOut, deleteOut, dfsVisited, findOutEdgeTo, firstInEdge, firstInNode, firstOutEdge, firstOutNode, flagsOn, getIndex, getNext, getNumber, getNumberOfIn, getNumberOfOut, getPrev, getScratch, hasIn, hasOneIn, hasOneIn, hasOneOut, hasOneOut, hasOut, hasZeroIn, hasZeroOut, inEdges, inNodes, insertOut, insertOut, isLoopHeader, markDFN, markSCC, onStack, outEdges, outNodes, pointsIn, pointsOut, printExtended, printInEdges, printInNodes, printOutEdges, printOutNodes, remove, removeIn, removeIn, removeOut, removeOut, replaceInEdge, replaceOut, setDfsVisited, setDfsVisitedOnStack, setIndex, setLoopHeader, setNumber, setOnStack, setScratch, setTopVisited, sortDFS, sortRevTop, sortTop, topVisited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final Object name
the name of the variable defined by this node


label

private Object label
the name of the operator that does the definition


targets

private ValueGraphVertex[] targets
operand vertices, in order


valueNumber

private int valueNumber
integer value number


arity

private int arity
number of operands needed

Constructor Detail

ValueGraphVertex

ValueGraphVertex(Object name)
Method Detail

copyVertex

void copyVertex(ValueGraphVertex v)
Set up properties of this vertex identically to another vertex


representsParameter

boolean representsParameter()
Does this vertex represent an incoming parameter?


setLabel

void setLabel(Object label,
              int arity)
Set the label for this vertex.

Parameters:
label - the label (an operator of some type)
arity - the number of operands needed

getLabel

Object getLabel()

getName

Object getName()

getValueNumber

int getValueNumber()

setValueNumber

void setValueNumber(int number)

isConstant

boolean isConstant()

isBornAtAllocation

boolean isBornAtAllocation()

getTarget

public ValueGraphVertex getTarget(int i)
return the target of the ith operand of this node


addTarget

public void addTarget(ValueGraphVertex target,
                      int pos)

getArity

public int getArity()

toString

public String toString()
Overrides:
toString in class Object