8272330: C2: Cleanup profile counter scaling
Reviewed-by: kvn
This commit is contained in:
parent
75a06421e5
commit
9faab400b8
@ -880,17 +880,16 @@ ciKlass* ciMethod::get_declared_method_holder_at_bci(int bci) {
|
|||||||
// invocation counts in methods.
|
// invocation counts in methods.
|
||||||
int ciMethod::scale_count(int count, float prof_factor) {
|
int ciMethod::scale_count(int count, float prof_factor) {
|
||||||
if (count > 0 && method_data() != NULL) {
|
if (count > 0 && method_data() != NULL) {
|
||||||
int counter_life;
|
int counter_life = method_data()->invocation_count();
|
||||||
int method_life = interpreter_invocation_count();
|
int method_life = interpreter_invocation_count();
|
||||||
// In tiered the MDO's life is measured directly, so just use the snapshotted counters
|
if (method_life < counter_life) { // may happen because of the snapshot timing
|
||||||
counter_life = MAX2(method_data()->invocation_count(), method_data()->backedge_count());
|
method_life = counter_life;
|
||||||
|
}
|
||||||
// counter_life due to backedge_counter could be > method_life
|
if (counter_life > 0) {
|
||||||
if (counter_life > method_life)
|
|
||||||
counter_life = method_life;
|
|
||||||
if (0 < counter_life && counter_life <= method_life) {
|
|
||||||
count = (int)((double)count * prof_factor * method_life / counter_life + 0.5);
|
count = (int)((double)count * prof_factor * method_life / counter_life + 0.5);
|
||||||
count = (count > 0) ? count : 1;
|
count = (count > 0) ? count : 1;
|
||||||
|
} else {
|
||||||
|
count = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user