src/share/vm/runtime/advancedThresholdPolicy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8015774 Sdiff src/share/vm/runtime

src/share/vm/runtime/advancedThresholdPolicy.cpp

Print this page




 198       && is_method_profiled(max_method)) {
 199     max_task->set_comp_level(CompLevel_limited_profile);
 200     if (PrintTieredEvents) {
 201       print_event(UPDATE_IN_QUEUE, max_method, max_method, max_task->osr_bci(), (CompLevel)max_task->comp_level());
 202     }
 203   }
 204 
 205   return max_task;
 206 }
 207 
 208 double AdvancedThresholdPolicy::threshold_scale(CompLevel level, int feedback_k) {
 209   double queue_size = CompileBroker::queue_size(level);
 210   int comp_count = compiler_count(level);
 211   double k = queue_size / (feedback_k * comp_count) + 1;
 212 
 213   // Increase C1 compile threshold when the code cache is filled more
 214   // than specified by IncreaseFirstTierCompileThresholdAt percentage.
 215   // The main intention is to keep enough free space for C2 compiled code
 216   // to achieve peak performance if the code cache is under stress.
 217   if ((TieredStopAtLevel == CompLevel_full_optimization) && (level != CompLevel_full_optimization))  {
 218     double current_reverse_free_ratio = CodeCache::reverse_free_ratio();
 219     if (current_reverse_free_ratio > _increase_threshold_at_ratio) {
 220       k *= exp(current_reverse_free_ratio - _increase_threshold_at_ratio);
 221     }
 222   }
 223   return k;
 224 }
 225 
 226 // Call and loop predicates determine whether a transition to a higher
 227 // compilation level should be performed (pointers to predicate functions
 228 // are passed to common()).
 229 // Tier?LoadFeedback is basically a coefficient that determines of
 230 // how many methods per compiler thread can be in the queue before
 231 // the threshold values double.
 232 bool AdvancedThresholdPolicy::loop_predicate(int i, int b, CompLevel cur_level) {
 233   switch(cur_level) {
 234   case CompLevel_none:
 235   case CompLevel_limited_profile: {
 236     double k = threshold_scale(CompLevel_full_profile, Tier3LoadFeedback);
 237     return loop_predicate_helper<CompLevel_none>(i, b, k);
 238   }




 198       && is_method_profiled(max_method)) {
 199     max_task->set_comp_level(CompLevel_limited_profile);
 200     if (PrintTieredEvents) {
 201       print_event(UPDATE_IN_QUEUE, max_method, max_method, max_task->osr_bci(), (CompLevel)max_task->comp_level());
 202     }
 203   }
 204 
 205   return max_task;
 206 }
 207 
 208 double AdvancedThresholdPolicy::threshold_scale(CompLevel level, int feedback_k) {
 209   double queue_size = CompileBroker::queue_size(level);
 210   int comp_count = compiler_count(level);
 211   double k = queue_size / (feedback_k * comp_count) + 1;
 212 
 213   // Increase C1 compile threshold when the code cache is filled more
 214   // than specified by IncreaseFirstTierCompileThresholdAt percentage.
 215   // The main intention is to keep enough free space for C2 compiled code
 216   // to achieve peak performance if the code cache is under stress.
 217   if ((TieredStopAtLevel == CompLevel_full_optimization) && (level != CompLevel_full_optimization))  {
 218     double current_reverse_free_ratio = CodeCache::reverse_free_ratio(CodeCache::get_code_blob_type(level));
 219     if (current_reverse_free_ratio > _increase_threshold_at_ratio) {
 220       k *= exp(current_reverse_free_ratio - _increase_threshold_at_ratio);
 221     }
 222   }
 223   return k;
 224 }
 225 
 226 // Call and loop predicates determine whether a transition to a higher
 227 // compilation level should be performed (pointers to predicate functions
 228 // are passed to common()).
 229 // Tier?LoadFeedback is basically a coefficient that determines of
 230 // how many methods per compiler thread can be in the queue before
 231 // the threshold values double.
 232 bool AdvancedThresholdPolicy::loop_predicate(int i, int b, CompLevel cur_level) {
 233   switch(cur_level) {
 234   case CompLevel_none:
 235   case CompLevel_limited_profile: {
 236     double k = threshold_scale(CompLevel_full_profile, Tier3LoadFeedback);
 237     return loop_predicate_helper<CompLevel_none>(i, b, k);
 238   }


src/share/vm/runtime/advancedThresholdPolicy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File