public final class PartialCallGraph extends Object implements Decayable, Reportable
Modifier and Type | Class and Description |
---|---|
private class |
PartialCallGraph.OrderByTotalWeight
Used to compare two call sites by total weight.
|
Modifier and Type | Field and Description |
---|---|
private HashMap<CallSite,WeightedCallTargets> |
callGraph
The dynamic call graph, which is a mapping from
CallSites to WeightedCallTargets.
|
private double |
seedWeight
Initial seed weight; saved for use in the reset method
|
private double |
totalEdgeWeights
sum of all edge weights in the call graph
|
private HashMap<UnResolvedCallSite,UnResolvedWeightedCallTargets> |
unresolvedCallGraph |
Constructor and Description |
---|
PartialCallGraph(double initialWeight)
Create a partial call graph.
|
Modifier and Type | Method and Description |
---|---|
private void |
augmentEdge(RVMMethod caller,
int bcIndex,
RVMMethod callee,
double weight)
Increment the edge represented by the input parameters,
creating it if it is not already in the call graph.
|
void |
decay()
Visit the WeightedCallTargets for every call site send them the
decay message.
|
void |
dumpGraph()
Dump all profile data to the given file
|
void |
dumpGraph(String fn)
Dump all profile data to the given file
|
WeightedCallTargets |
getCallTargets(CallSite callSite) |
WeightedCallTargets |
getCallTargets(RVMMethod caller,
int bcIndex) |
double |
getTotalEdgeWeights() |
void |
incrementEdge(RVMMethod caller,
int bcIndex,
RVMMethod callee)
Increment the edge represented by the input parameters,
creating it if it is not already in the call graph.
|
void |
incrementEdge(RVMMethod caller,
int bcIndex,
RVMMethod callee,
float weight)
Increment the edge represented by the input parameters,
creating it if it is not already in the call graph.
|
void |
incrementUnResolvedEdge(MethodReference callerRef,
int bcIndex,
MethodReference calleeRef,
float weight)
For the calling edge we read from a profile, we may not have
the methods loaded in yet.
|
void |
report()
Dump out set of edges in sorted order.
|
void |
reset()
reset (clear) data set being gathered
|
private final HashMap<CallSite,WeightedCallTargets> callGraph
private final HashMap<UnResolvedCallSite,UnResolvedWeightedCallTargets> unresolvedCallGraph
private double totalEdgeWeights
private final double seedWeight
public PartialCallGraph(double initialWeight)
initialWeight
- an initial value for totalEdgeWeights.
Used by AOS to cause inlining based in the dynamic call graph
to initially be conservative until sufficient samples have
accumulated that there is more confidence in the accuracy
of the call graph.public void reset()
Reportable
reset
in interface Reportable
public double getTotalEdgeWeights()
public void decay()
public WeightedCallTargets getCallTargets(RVMMethod caller, int bcIndex)
caller
- caller methodbcIndex
- bytecode index in caller methodpublic WeightedCallTargets getCallTargets(CallSite callSite)
callSite
- the callsite to look forpublic void incrementEdge(RVMMethod caller, int bcIndex, RVMMethod callee)
caller
- method making the callbcIndex
- call site, if -1 then no call site is specified.callee
- method calledpublic void incrementEdge(RVMMethod caller, int bcIndex, RVMMethod callee, float weight)
caller
- method making the callbcIndex
- call site, if -1 then no call site is specified.callee
- method calledweight
- the frequency of this calling edgepublic void incrementUnResolvedEdge(MethodReference callerRef, int bcIndex, MethodReference calleeRef, float weight)
callerRef
- method making the callbcIndex
- call site, if -1 then no call site is specified.calleeRef
- method calledweight
- the frequency of this calling edgeprivate void augmentEdge(RVMMethod caller, int bcIndex, RVMMethod callee, double weight)
caller
- method making the callbcIndex
- call site, if -1 then no call site is specified.callee
- method calledweight
- the frequency of this calling edgepublic void report()
report
in interface Reportable
public void dumpGraph()