|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Root scale.score.pp.PPBlock
public class PPBlock
Represents a basic block in a path profiling CFG (PPCfg).
$Id: PPBlock.java,v 1.14 2007-10-29 13:38:14 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Constructor Summary | |
---|---|
protected |
PPBlock()
A constructor used by subclass PPSupergraphBlock. |
|
PPBlock(Chord firstChord,
PPCfg cfg)
Constructor that sets the first and last chords in the basic block. |
Method Summary | |
---|---|
void |
addAllInEdges(java.util.AbstractCollection<PPEdge> list)
Add all incoming edges to the specified collection. |
void |
addAllOutEdges(java.util.AbstractCollection<PPEdge> list)
Add all outgoing edges to the specified collection. |
boolean |
addInEdge(PPEdge edge)
Add the edge to the incoming edges. |
boolean |
addOutEdge(PPEdge edge)
Add the edge to the outgoing edges. |
void |
dumpEdges()
|
boolean |
equals(java.lang.Object o)
Two blocks are the same if they have the same first chord. |
Chord |
firstChord()
Return the first Chord of this block. |
double |
getAvgTripCount()
Get the average trip count for a loop. |
long |
getBranchEdgeFrequency()
Return the outgoing branch edge frequency. |
PPCfg |
getCfg()
Return the path profiling CFG representation that this block is part of. |
java.lang.String |
getDisplayName()
Return a unique label for graphical displays. |
PPEdge |
getHighestOutEdge(long pathNum)
Return the outgoing edge that has the highest value that is less than or equal to the current value of pathNum.. |
long |
getHighRange()
|
PPEdge |
getInEdge(int i)
Return the specified incoming edge. |
long |
getInEdgeFrequency()
Return the incoming edge frequency. |
long |
getLowRange()
|
int |
getNumChords()
|
long |
getNumPaths()
Return the number of paths for this block. |
PPEdge |
getOutEdge(int i)
Return the specified outgoing edge. |
long |
getOutEdgeFrequency()
Return the outgoing edge frequency. |
java.lang.String |
getRangeText()
|
int |
getRank()
|
double |
getWeight()
The computed weight of the block. |
boolean |
hasEdges()
Return true if there are any edges. |
int |
hashCode()
Return the hash code for this block which is just the first Chord's hash code. |
boolean |
hasInEdges()
Return true if there are any incoming edges. |
boolean |
hasOutEdges()
Return true if there are any outgoing edges. |
PPEdge[] |
incoming()
Return a list of the incoming edges of this block. |
void |
incRank()
|
void |
incrementInEdges(long inc)
Add the specified increment to all of the incoming edges. |
boolean |
isBeginBlock()
Return true if and only if this basic block is BEGIN. |
boolean |
isEndBlock()
Return true if and only if this basic block is END. |
boolean |
isLoopHeader()
Return true if the basic block is a loop header. |
boolean |
isNumPathsSet()
Return true if and only the number of paths for this block has been set. |
Chord |
lastChord()
Return the last Chord of this block. |
int |
numInEdges()
Return the number of incoming edges. |
int |
numOutEdges()
Return the number of incoming edges. |
PPEdge[] |
outgoing()
Return a list of the incoming edges of this block. |
boolean |
removeInEdge(PPEdge edge)
Remove the specified incoming edge. |
boolean |
removeOutEdge(PPEdge edge)
Remove the specified outgoing edge. |
void |
resetNumPaths()
Reset the number of paths for this block. |
void |
setHighRange(long high)
|
void |
setLowRange(long low)
|
void |
setNumPaths(long numPaths)
Set the number of paths for this block. |
void |
setRank(int rank)
|
java.lang.String |
toString()
|
void |
unionRange(long low,
long high)
|
void |
validate(PPBlock block,
HashSet<PPEdge> incomingEdgesEncountered,
HashSet<PPEdge> outgoingEdgesEncountered)
Check the block edges and add them to the specified sets. |
Methods inherited from class scale.common.Root |
---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayColorHint, getDisplayLabel, getDisplayShapeHint, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, toStringSpecial, trace, trace, trace |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PPBlock(Chord firstChord, PPCfg cfg)
firstChord
- The first Chord (from Scribble) of a basic block.cfg
- The CFG that this basic block is part of.protected PPBlock()
Method Detail |
---|
public java.lang.String toString()
toString
in class Root
public java.lang.String getDisplayName()
Root
getDisplayName
in interface DisplayNode
getDisplayName
in class Root
public Chord firstChord()
public Chord lastChord()
public PPEdge[] incoming()
public PPEdge[] outgoing()
public boolean addInEdge(PPEdge edge)
public boolean addOutEdge(PPEdge edge)
public boolean removeInEdge(PPEdge edge)
public boolean removeOutEdge(PPEdge edge)
public void addAllInEdges(java.util.AbstractCollection<PPEdge> list)
public void addAllOutEdges(java.util.AbstractCollection<PPEdge> list)
public int numInEdges()
public PPEdge getInEdge(int i)
public PPEdge getOutEdge(int i)
public int numOutEdges()
public boolean hasInEdges()
public boolean hasOutEdges()
public final boolean hasEdges()
public long getInEdgeFrequency()
public long getOutEdgeFrequency()
public long getBranchEdgeFrequency()
public PPEdge getHighestOutEdge(long pathNum)
public void dumpEdges()
public void incrementInEdges(long inc)
public double getAvgTripCount()
public void validate(PPBlock block, HashSet<PPEdge> incomingEdgesEncountered, HashSet<PPEdge> outgoingEdgesEncountered)
public long getNumPaths()
public void setNumPaths(long numPaths)
numPaths
- The number of paths for this block.public void resetNumPaths()
public boolean isNumPathsSet()
public boolean isBeginBlock()
public boolean isEndBlock()
public PPCfg getCfg()
public int getNumChords()
public boolean isLoopHeader()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class Root
public double getWeight()
public final long getLowRange()
public final void setLowRange(long low)
public final long getHighRange()
public final void setHighRange(long high)
public final void unionRange(long low, long high)
public final java.lang.String getRangeText()
public final int getRank()
public final void setRank(int rank)
public final void incRank()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |