|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectscale.common.Root
scale.score.Note
scale.score.chords.Chord
scale.score.chords.DecisionChord
public abstract class DecisionChord
This class represents a CFG node that has multiple out-going CFG edges.
$Id: DecisionChord.java,v 1.62 2007-10-17 13:44:05 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
This is the base class for all classes that have more than one out-going CFG edge.
| Field Summary |
|---|
| Fields inherited from class scale.score.chords.Chord |
|---|
lineNumber |
| Constructor Summary | |
|---|---|
DecisionChord(Expr predicate)
Create a Chord that has more than one out-going CFG edge where the edge is selected by some computation. |
|
| Method Summary | |
|---|---|
void |
changeInDataEdge(Expr oldExpr,
Expr newExpr)
This method changes an incoming data edge to point to a new expression. |
void |
deleteInDataEdges()
Remove all the in-coming data edges. |
abstract int |
getBranchEdgeIndex(java.lang.Object key)
Return the index of the selected out-going CFG edge. |
abstract double |
getBranchProbability(Chord edge)
Return the probability that the specified edge will be executed next. |
Vector<Declaration> |
getDeclList()
Return a vector of all declarations referenced in this CFG node or null. |
DColor |
getDisplayColorHint()
Return a string specifying the color to use for coloring this node in a graphical display. |
DShape |
getDisplayShapeHint()
Return a string specifying a shape to use when drawing this node in a graphical display. |
Vector<Expr> |
getExprList()
Return a vector of all LoadExpr
instances in this CFG node or null. |
Expr |
getInDataEdge(int i)
Return the specified in-coming data edge. |
Expr[] |
getInDataEdgeArray()
Use this method when you may be modifying an in-coming data edge to this expression while iterating over the in-coming edges. |
Vector<LoadExpr> |
getLoadExprList()
Return a vector of all LoadExpr
instances in this CFG node or null. |
Chord |
getNextChord()
Return null because there is no ONE next Chord in the CFG. |
Expr |
getPredicateExpr()
Return the expression used to select an out-going CFG edge. |
boolean |
isBranch()
Return true if this chord may have multiple out-going CFG edges. |
boolean |
isLastInBasicBlock()
Return true if this is the last Chord in this Basic Block. |
int |
numInDataEdges()
Return the number of in-coming data edges. |
void |
pushInDataEdges(Stack<Expr> wl)
Push all incoming data edges on the stack. |
void |
recordRefs(References refs)
Record any variable references in this CFG node in the table of references. |
boolean |
removeDualExprs()
Remove all DualExpr instances
from the CFG. |
void |
removeRefs(References refs)
Record any variable references in this CFG node from the table of references. |
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. |
abstract void |
specifyBranchProbability(Chord edge,
double probability)
Specify the probability that the specified edge will be executed next. |
java.lang.String |
toStringSpecial()
Return a String containing additional information about this CFG node.. |
void |
validate()
Check this node for validity. |
| Methods inherited from class scale.score.Note |
|---|
executionCostEstimate, getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString, 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 DecisionChord(Expr predicate)
predicate - the expression which is evaluated to select the
out-going edge| Method Detail |
|---|
public final Expr[] getInDataEdgeArray()
getInDataEdgeArray in class Chordpublic Expr getInDataEdge(int i)
getInDataEdge in class Chordpublic int numInDataEdges()
numInDataEdges in class Chordpublic void pushInDataEdges(Stack<Expr> wl)
pushInDataEdges in class Chordpublic java.lang.String toStringSpecial()
toStringSpecial in class Chordpublic final Expr getPredicateExpr()
public abstract void specifyBranchProbability(Chord edge,
double probability)
public abstract double getBranchProbability(Chord edge)
public final Chord getNextChord()
getNextChord in class Chordpublic final boolean isLastInBasicBlock()
isLastInBasicBlock in class ChordChord.lastInBasicBlock(),
Chord.isFirstInBasicBlock(),
Chord.firstInBasicBlock()public final boolean isBranch()
isBranch in class Chordpublic abstract int getBranchEdgeIndex(java.lang.Object key)
key - specifies the out-going CFG edge
public void changeInDataEdge(Expr oldExpr,
Expr newExpr)
This method ensures that the node previously pointing to this one is updated properly, as well as, the node which will now point to this node.
Expr and Chord nodes have a fixed number of incoming edges with specific meaning applied to each.
changeInDataEdge in class ChordoldExpr - is the expression to be replacednewExpr - is the new expressionpublic void deleteInDataEdges()
deleteInDataEdges in class Chordpublic DColor getDisplayColorHint()
getDisplayColorHint in interface DisplayNodegetDisplayColorHint in class ChordDColorpublic DShape getDisplayShapeHint()
getDisplayShapeHint in interface DisplayNodegetDisplayShapeHint in class ChordDShapepublic Vector<Declaration> getDeclList()
null.
getDeclList in class Chordpublic Vector<LoadExpr> getLoadExprList()
LoadExpr
instances in this CFG node or null.
getLoadExprList in class Chordpublic Vector<Expr> getExprList()
LoadExpr
instances in this CFG node or null.
getExprList in class Chord
public boolean replaceDecl(Declaration oldDecl,
Declaration newDecl)
replaceDecl in class Chordpublic void removeUseDef()
removeUseDef in class Chordpublic void validate()
validate in class Notepublic void recordRefs(References refs)
recordRefs in class Chordpublic void removeRefs(References refs)
removeRefs in class Chordpublic boolean removeDualExprs()
DualExpr instances
from the CFG. Use the lower form. This eliminates references to
variables that may no longer be needed.
removeDualExprs in class Chord
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||