|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Root scale.score.Note scale.score.chords.Chord scale.score.chords.SequentialChord
public abstract class SequentialChord
This class is a base class for any node in the CFG which does not alter control flow.
$Id: SequentialChord.java,v 1.47 2007-10-17 13:39:59 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
All superclasses of this class have only one out-going CFG edge.
Field Summary |
---|
Fields inherited from class scale.score.chords.Chord |
---|
lineNumber |
Constructor Summary | |
---|---|
SequentialChord()
Construct a new Chord with no out-going CFG edge. |
|
SequentialChord(Chord next)
Construct a new Chord with the indicated out-going CFG edge. |
Method Summary | |
---|---|
void |
changeOutCfgEdge(Chord oldEdge,
Chord newEdge)
Change the out-going CFG edge indicated by the position to the new edge. |
void |
clearEdge(int edge)
Clear the marker associated with the specified out-going CFG edge. |
void |
clearEdgeMarkers()
Clear all the markers. |
void |
deleteInDataEdges()
Remove all the in-coming adat edges. |
void |
deleteOutCfgEdges()
Set the out-going CFG edge to null . |
boolean |
edgeMarked(int edge)
Return the marker associated with the specified out-going CFG edge. |
int |
executionCostEstimate()
Return a relative cost estimate for executing the expression. |
Vector<Declaration> |
getDeclList()
Return a vector of all declarations referenced in this CFG node or null . |
Vector<Expr> |
getExprList()
Return a vector of all Expr
instances in this CFG node or null . |
Vector<LoadExpr> |
getLoadExprList()
Return a vector of all {#link scale.score.expr.LoadExpr LoadExpr} instances in this CFG node or null . |
Chord |
getNextChord()
Return the CFG out-going edge. |
Chord |
getOutCfgEdge(int i)
Return the specified out-going CFG edge. |
Chord[] |
getOutCfgEdgeArray()
Use this method when you may be modifying an out-going CFG edge from this Chord while iterating over the out-going edges. |
Chord |
getTarget()
Return the out-going CFG edge (i.e., target of this branch). |
int |
indexOfOutCfgEdge(Chord to,
int skip)
This routine is needed because it is possible for more than one out-going edge from a CFG node to go the the same CFG node. |
boolean |
isLastInBasicBlock()
Return true if this is the last Chord in this Basic Block. |
boolean |
isSequential()
Return true if this is a sequential chord. |
void |
linkSubgraph(HashMap<Chord,Chord> nm)
Link a new CFG node that contains old links. |
void |
linkTo(Chord child)
Link child to parent if it's a SequentialChord and not a BranchChord or EndChord. |
void |
markEdge(int edge)
Set the marker associated with the specified out-going CFG edge. |
int |
numOutCfgEdges()
Return the number of out-going CFG edges. |
void |
pushAllOutCfgEdges(Stack<Chord> wl)
Add the successors of this Chord to the stack. |
void |
pushOutCfgEdges(Stack<Chord> wl)
Add the successors of this Chord to the stack if they haven't been visited before. |
void |
pushOutCfgEdges(Stack<Chord> wl,
HashSet<Chord> done)
Add the successors of this Chord to the stack if they haven't been visited before. |
void |
pushSortedOutCfgEdges(Stack<Chord> wl)
Add the successors of this Chord to the stack if they haven't been visited, and all their parents have. |
void |
pushSortedOutCfgEdges(Stack<Chord> wl,
HashSet<Chord> finished)
Add the successors of this Chord to the stack if they haven't been visited, and all their parents have. |
void |
removeUseDef()
Remove any use - def links, may - use links, etc. |
boolean |
replaceDecl(Declaration oldDecl,
Declaration newDecl)
Replace all occurrances of a Declaration with another Declaration. |
void |
replaceOutCfgEdge(Chord oldChord,
Chord newChord)
Replace the existing out-going CFG edge with a new edge. |
void |
setTarget(Chord target)
Set the out-going CFG edge of this node (i.e., target of the branch). |
void |
setTargetUnsafe(Chord target)
Set the out-going CFG edge of this node (i.e., target of the branch). |
Methods inherited from class scale.score.Note |
---|
getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString, validate, visit |
Methods inherited from class scale.common.Root |
---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SequentialChord(Chord next)
next
- is the out-going CFG edgepublic SequentialChord()
setTarget(scale.score.chords.Chord)
Method Detail |
---|
public final boolean isSequential()
isSequential
in class Chord
public void deleteOutCfgEdges()
null
.
This method does not maintain the validity of the CFG as the
node at the other ends of the edge is not modified.
deleteOutCfgEdges
in class Chord
public void setTarget(Chord target)
target
- is the out-going CFG edgepublic void setTargetUnsafe(Chord target)
target
- is the out-going CFG edgepublic Chord getTarget()
public void linkTo(Chord child)
linkTo
in class Chord
public final void replaceOutCfgEdge(Chord oldChord, Chord newChord)
replaceOutCfgEdge
in class Chord
oldChord
- is the old edgenewChord
- is the new edgepublic final Chord getNextChord()
getNextChord
in class Chord
public boolean isLastInBasicBlock()
isLastInBasicBlock
in class Chord
Chord.lastInBasicBlock()
,
Chord.isFirstInBasicBlock()
,
Chord.firstInBasicBlock()
public final int numOutCfgEdges()
numOutCfgEdges
in class Chord
public final Chord getOutCfgEdge(int i)
getOutCfgEdge
in class Chord
public final Chord[] getOutCfgEdgeArray()
getOutCfgEdgeArray
in class Chord
public final int indexOfOutCfgEdge(Chord to, int skip)
indexOfOutCfgEdge
in class Chord
to
- is the target CFG nodeskip
- ispecifies how many occurrances of to
to skip
public final void pushAllOutCfgEdges(Stack<Chord> wl)
pushAllOutCfgEdges
in class Chord
public final void pushOutCfgEdges(Stack<Chord> wl)
pushOutCfgEdges
in class Chord
Chord.nextVisit()
,
Chord.setVisited()
,
Chord.visited()
public final void pushOutCfgEdges(Stack<Chord> wl, HashSet<Chord> done)
pushOutCfgEdges
in class Chord
done
- is the set of visited CFG nodespublic void pushSortedOutCfgEdges(Stack<Chord> wl)
pushSortedOutCfgEdges
in class Chord
public void pushSortedOutCfgEdges(Stack<Chord> wl, HashSet<Chord> finished)
pushSortedOutCfgEdges
in class Chord
finished
- is the set of finished nodes.public final void clearEdgeMarkers()
clearEdgeMarkers
in class Chord
public final boolean edgeMarked(int edge)
edgeMarked
in class Chord
edge
- specifies the edge associated with the marker
public final void markEdge(int edge)
markEdge
in class Chord
edge
- specifies the edge associated with the markerpublic final void clearEdge(int edge)
clearEdge
in class Chord
edge
- specifies the edge associated with the markerpublic void deleteInDataEdges()
deleteInDataEdges
in class Chord
public void changeOutCfgEdge(Chord oldEdge, Chord newEdge)
changeOutCfgEdge
in class Chord
oldEdge
- the out-going CFG edge to be changednewEdge
- the new out-going CFG edgepublic Vector<Declaration> getDeclList()
null
.
getDeclList
in class Chord
public Vector<LoadExpr> getLoadExprList()
null
.
getLoadExprList
in class Chord
public Vector<Expr> getExprList()
Expr
instances in this CFG node or null
.
getExprList
in class Chord
public boolean replaceDecl(Declaration oldDecl, Declaration newDecl)
replaceDecl
in class Chord
public void removeUseDef()
removeUseDef
in class Chord
public void linkSubgraph(HashMap<Chord,Chord> nm)
linkSubgraph
in class Chord
nm
- is a map from the old nodes to the new nodes.Scribble.linkSubgraph(scale.common.Vector, scale.common.HashMap, scale.common.Vector)
public int executionCostEstimate()
executionCostEstimate
in class Note
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |