use of org.jikesrvm.compilers.baseline.ConditionalBranchProfile in project JikesRVM by JikesRVM.
the class GenerationContext method getConditionalBranchProfileOperand.
// /////////
// Profile data
// /////////
BranchProfileOperand getConditionalBranchProfileOperand(int bcIndex, boolean backwards) {
float prob;
BranchProfile bp;
if (branchProfiles != null && ((bp = branchProfiles.getEntry(bcIndex)) != null)) {
prob = ((ConditionalBranchProfile) bp).getTakenProbability();
} else {
if (branchProfiles != null) {
VM.sysWrite("Warning: conditional branch profile entry not found");
}
if (backwards) {
prob = 0.9f;
} else {
prob = 0.5f;
}
}
// we were completely wrong.
if (options.inverseFrequencyCounters()) {
prob = 1f - prob;
}
return new BranchProfileOperand(prob);
}
Aggregations