Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8272330: C2: Cleanup profile counter scaling #5087

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -880,17 +880,16 @@ ciKlass* ciMethod::get_declared_method_holder_at_bci(int bci) {
// invocation counts in methods.
int ciMethod::scale_count(int count, float prof_factor) {
if (count > 0 && method_data() != NULL) {
int counter_life;
int counter_life = method_data()->invocation_count();
int method_life = interpreter_invocation_count();
// In tiered the MDO's life is measured directly, so just use the snapshotted counters
counter_life = MAX2(method_data()->invocation_count(), method_data()->backedge_count());

// counter_life due to backedge_counter could be > method_life
if (counter_life > method_life)
counter_life = method_life;
if (0 < counter_life && counter_life <= method_life) {
if (method_life < counter_life) { // may happen because of the snapshot timing
method_life = counter_life;
}
if (counter_life > 0) {
count = (int)((double)count * prof_factor * method_life / counter_life + 0.5);
count = (count > 0) ? count : 1;
} else {
count = 1;
}
}
return count;