7058689: Tiered: Reprofiling doesn't happen in presence of level 4 OSR methods

Take into account current state of profiling before believing that existing higher level versions are valid

Reviewed-by: kvn, never
This commit is contained in:
Igor Veresov 2011-07-01 10:35:54 -07:00
parent b443bf1f4c
commit 528a9bb452
2 changed files with 11 additions and 7 deletions

View file

@ -379,7 +379,8 @@ CompLevel AdvancedThresholdPolicy::common(Predicate p, methodOop method, CompLev
// Determine if a method should be compiled with a normal entry point at a different level. // Determine if a method should be compiled with a normal entry point at a different level.
CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_level) { CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_level) {
CompLevel osr_level = (CompLevel) method->highest_osr_comp_level(); CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(),
common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level));
CompLevel next_level = common(&AdvancedThresholdPolicy::call_predicate, method, cur_level); CompLevel next_level = common(&AdvancedThresholdPolicy::call_predicate, method, cur_level);
// If OSR method level is greater than the regular method level, the levels should be // If OSR method level is greater than the regular method level, the levels should be
@ -400,15 +401,16 @@ CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_l
// Determine if we should do an OSR compilation of a given method. // Determine if we should do an OSR compilation of a given method.
CompLevel AdvancedThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) { CompLevel AdvancedThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) {
CompLevel next_level = common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level);
if (cur_level == CompLevel_none) { if (cur_level == CompLevel_none) {
// If there is a live OSR method that means that we deopted to the interpreter // If there is a live OSR method that means that we deopted to the interpreter
// for the transition. // for the transition.
CompLevel osr_level = (CompLevel)method->highest_osr_comp_level(); CompLevel osr_level = MIN2((CompLevel)method->highest_osr_comp_level(), next_level);
if (osr_level > CompLevel_none) { if (osr_level > CompLevel_none) {
return osr_level; return osr_level;
} }
} }
return common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level); return next_level;
} }
// Update the rate and submit compile // Update the rate and submit compile

View file

@ -323,7 +323,8 @@ CompLevel SimpleThresholdPolicy::common(Predicate p, methodOop method, CompLevel
// Determine if a method should be compiled with a normal entry point at a different level. // Determine if a method should be compiled with a normal entry point at a different level.
CompLevel SimpleThresholdPolicy::call_event(methodOop method, CompLevel cur_level) { CompLevel SimpleThresholdPolicy::call_event(methodOop method, CompLevel cur_level) {
CompLevel osr_level = (CompLevel) method->highest_osr_comp_level(); CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(),
common(&SimpleThresholdPolicy::loop_predicate, method, cur_level));
CompLevel next_level = common(&SimpleThresholdPolicy::call_predicate, method, cur_level); CompLevel next_level = common(&SimpleThresholdPolicy::call_predicate, method, cur_level);
// If OSR method level is greater than the regular method level, the levels should be // If OSR method level is greater than the regular method level, the levels should be
@ -344,15 +345,16 @@ CompLevel SimpleThresholdPolicy::call_event(methodOop method, CompLevel cur_lev
// Determine if we should do an OSR compilation of a given method. // Determine if we should do an OSR compilation of a given method.
CompLevel SimpleThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) { CompLevel SimpleThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) {
CompLevel next_level = common(&SimpleThresholdPolicy::loop_predicate, method, cur_level);
if (cur_level == CompLevel_none) { if (cur_level == CompLevel_none) {
// If there is a live OSR method that means that we deopted to the interpreter // If there is a live OSR method that means that we deopted to the interpreter
// for the transition. // for the transition.
CompLevel osr_level = (CompLevel)method->highest_osr_comp_level(); CompLevel osr_level = MIN2((CompLevel)method->highest_osr_comp_level(), next_level);
if (osr_level > CompLevel_none) { if (osr_level > CompLevel_none) {
return osr_level; return osr_level;
} }
} }
return common(&SimpleThresholdPolicy::loop_predicate, method, cur_level); return next_level;
} }