public abstract class WeightedCallTargets extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
WeightedCallTargets.MultiTarget
An implementation for storing a call site distribution that has multiple targets.
|
private static class |
WeightedCallTargets.SingleTarget
An implementation for storing a call site distribution that has a single target.
|
static interface |
WeightedCallTargets.Visitor
Used by visitTargets
|
Constructor and Description |
---|
WeightedCallTargets() |
Modifier and Type | Method and Description |
---|---|
abstract WeightedCallTargets |
augmentCount(RVMMethod target,
double amount)
Augment the weight associated with the argument method by the argument amount.
|
static WeightedCallTargets |
create(RVMMethod target,
double weight) |
abstract void |
decay(double rate)
Decay the weights of all call targets by the specified amount
|
abstract WeightedCallTargets |
filter(RVMMethod goal,
boolean isPrecise) |
WeightedCallTargets |
incrementCount(RVMMethod target)
Augment the weight associated with the argument method by 1.
|
abstract double |
totalWeight() |
abstract void |
visitTargets(WeightedCallTargets.Visitor func)
Iterate over all of the targets, evaluating the argument function on each edge.
|
public WeightedCallTargets()
public abstract void visitTargets(WeightedCallTargets.Visitor func)
NOTE: We guarantee that the targets will be iterated in monotonically decreasing edge weight. This simplifies the coding of the inlining clients that consume this information.
func
- the function to evaluate on each targetpublic final WeightedCallTargets incrementCount(RVMMethod target)
NOTE: This method may change the representation of the target method. The caller must be sure to update their backing store of WeightedCallTargets accordingly to avoid losing the update.
target
- the method whose count is to be incrementedpublic abstract WeightedCallTargets augmentCount(RVMMethod target, double amount)
target
- the method whose count is to be incrementedamount
- amount to increment bypublic abstract void decay(double rate)
rate
- the value to decay bypublic abstract double totalWeight()
public abstract WeightedCallTargets filter(RVMMethod goal, boolean isPrecise)
goal
- RVMMethod that is the statically possible targetisPrecise
- whether or not goal is a precise target, or should be
interpreted as being the root of a virtual method family, any of which
are statically possible.null
if no such target existspublic static WeightedCallTargets create(RVMMethod target, double weight)