|
|||||||||
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.PPEdge
public final class PPEdge
Represents an edge in a path profiling CFG (PPCfg).
$Id: PPEdge.java,v 1.15 2007-10-29 13:38:15 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
TODO: Description of this class.
Field Summary | |
---|---|
static int |
DUMMY_FOR_BACK_EDGE
The type for a dummy edge added because a back edge was removed. |
static int |
DUMMY_FOR_TRUNCATED_EDGE
The type for a dummy edge added because a non-back edge was truncated. |
static int |
NORMAL
The type for a normal (non-dummy) edge. |
Constructor Summary | |
---|---|
PPEdge(PPBlock source,
PPBlock target,
int type,
PPCfg cfg)
A constructor that sets the source and target basic blocks of this edge, as well as the CFG that this edge is in. |
Method Summary | |
---|---|
void |
addToFrequency(long frequency)
Add the frequency to the frequency value of this edge. |
void |
addToIncrement(long increment)
Add the increment to the increment value of this edge. |
void |
addWeight(PPEdge srcEdge)
Add the weight of one edge to another edge. |
int |
compareTo(PPEdge o2)
Compare two edges by edge weight. |
int |
dir(PPEdge e1)
Return 1 if the edges are in the same direction and -1 otherwise. |
boolean |
equals(java.lang.Object o)
Compares two edges. |
boolean |
equals(PPBlock source,
PPBlock target,
int type)
Compares two edges. |
PPCfg |
getCfg()
Return the CFG that contains this edge. |
long |
getFrequency()
Retun the frequency value of this edge. |
long |
getIncrement()
Retun the increment value of this edge. |
int |
getType()
Return the type of this edge (see the constants in this class). |
double |
getWeight()
Return the edge's weight |
int |
hashCode()
The hash code for a block is a combination of the source, target, and type hash codes. |
static int |
hashCode(PPBlock source,
PPBlock target,
int type)
The hash code for a block is a combination of the source, target, and type hash codes. |
boolean |
isBackEdge()
Return true if the edge is a back edge. |
boolean |
isBranchEdge()
|
boolean |
isDummy()
Tells us whether this edge is a dummy edge. |
boolean |
isEditable()
Return true if this path profiling CFG edge is editable. |
static boolean |
isEditable(Chord sourceChord,
Chord targetChord)
Return true if the Scribble CFG edge is editable. |
boolean |
mayTruncate()
Return true if and only if it is okay to truncate this edge. |
void |
setFrequency(long frequency)
Set the frequency value of this edge. |
void |
setIncrement(long increment)
Set the increment value of this edge. |
void |
setWeight(double weight)
Return the edge's weight |
PPBlock |
source()
Return The source basic block of this edge. |
PPBlock |
target()
Return The target basic block of this edge. |
java.lang.String |
toString()
|
Methods inherited from class scale.common.Root |
---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayColorHint, getDisplayLabel, getDisplayName, 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 |
Field Detail |
---|
public static final int NORMAL
public static final int DUMMY_FOR_BACK_EDGE
public static final int DUMMY_FOR_TRUNCATED_EDGE
Constructor Detail |
---|
public PPEdge(PPBlock source, PPBlock target, int type, PPCfg cfg)
source
- is the source basic block of this edge.target
- is the target basic block of this edge.type
- is the type of this edge. See the constants in this class.cfg
- is the CFG that this edge is in.Method Detail |
---|
public int compareTo(PPEdge o2)
compareTo
in interface java.lang.Comparable<PPEdge>
public java.lang.String toString()
toString
in class Root
public PPBlock source()
public PPBlock target()
public int getType()
public boolean isDummy()
public final long getIncrement()
public final void setIncrement(long increment)
increment
- The new increment value for this edge.public final void addToIncrement(long increment)
increment
- The new increment value for this edge.public final long getFrequency()
public final void setFrequency(long frequency)
frequency
- The new frequency value for this edge.public final void addToFrequency(long frequency)
frequency
- The new frequency value for this edge.public boolean isEditable()
public static boolean isEditable(Chord sourceChord, Chord targetChord)
sourceChord
- The source of the edge. This parameter may be null.targetChord
- The target of the edge.public boolean isBackEdge()
public boolean mayTruncate()
public PPCfg getCfg()
public boolean equals(PPBlock source, PPBlock target, int type)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public static int hashCode(PPBlock source, PPBlock target, int type)
public int hashCode()
hashCode
in class Root
public double getWeight()
public void setWeight(double weight)
public void addWeight(PPEdge srcEdge)
srcEdge
- The edge to get weight from.public int dir(PPEdge e1)
public boolean isBranchEdge()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |