提交 6b840423 编写于 作者: I iveresov

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

Summary: Take into account current state of profiling before believing that existing higher level versions are valid
Reviewed-by: kvn, never
上级 b60fd6d8
...@@ -378,8 +378,9 @@ CompLevel AdvancedThresholdPolicy::common(Predicate p, methodOop method, CompLev ...@@ -378,8 +378,9 @@ 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 ...@@ -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
......
...@@ -323,7 +323,8 @@ CompLevel SimpleThresholdPolicy::common(Predicate p, methodOop method, CompLevel ...@@ -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 ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册