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