Mercurial > hg > truffle
diff src/share/vm/runtime/advancedThresholdPolicy.cpp @ 3790:6f6e91603a45
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
author | iveresov |
---|---|
date | Fri, 01 Jul 2011 10:35:54 -0700 |
parents | 97b64f73103b |
children | 2c359f27615c |
line wrap: on
line diff
--- a/src/share/vm/runtime/advancedThresholdPolicy.cpp Tue Jun 28 15:50:07 2011 -0700 +++ b/src/share/vm/runtime/advancedThresholdPolicy.cpp Fri Jul 01 10:35:54 2011 -0700 @@ -378,8 +378,9 @@ } // 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 osr_level = (CompLevel) method->highest_osr_comp_level(); +CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_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); // If OSR method level is greater than the regular method level, the levels should be @@ -400,15 +401,16 @@ // Determine if we should do an OSR compilation of a given method. 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 there is a live OSR method that means that we deopted to the interpreter // 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) { return osr_level; } } - return common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level); + return next_level; } // Update the rate and submit compile