66 if (FLAG_IS_DEFAULT(InlineSmallCode)) { |
66 if (FLAG_IS_DEFAULT(InlineSmallCode)) { |
67 FLAG_SET_DEFAULT(InlineSmallCode, 2500); |
67 FLAG_SET_DEFAULT(InlineSmallCode, 2500); |
68 } |
68 } |
69 #endif |
69 #endif |
70 |
70 |
71 |
71 set_increase_threshold_at_ratio(); |
72 set_start_time(os::javaTimeMillis()); |
72 set_start_time(os::javaTimeMillis()); |
73 } |
73 } |
74 |
74 |
75 // update_rate() is called from select_task() while holding a compile queue lock. |
75 // update_rate() is called from select_task() while holding a compile queue lock. |
76 void AdvancedThresholdPolicy::update_rate(jlong t, Method* m) { |
76 void AdvancedThresholdPolicy::update_rate(jlong t, Method* m) { |
203 |
203 |
204 double AdvancedThresholdPolicy::threshold_scale(CompLevel level, int feedback_k) { |
204 double AdvancedThresholdPolicy::threshold_scale(CompLevel level, int feedback_k) { |
205 double queue_size = CompileBroker::queue_size(level); |
205 double queue_size = CompileBroker::queue_size(level); |
206 int comp_count = compiler_count(level); |
206 int comp_count = compiler_count(level); |
207 double k = queue_size / (feedback_k * comp_count) + 1; |
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 } |
208 return k; |
219 return k; |
209 } |
220 } |
210 |
221 |
211 // Call and loop predicates determine whether a transition to a higher |
222 // Call and loop predicates determine whether a transition to a higher |
212 // compilation level should be performed (pointers to predicate functions |
223 // compilation level should be performed (pointers to predicate functions |