Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/advancedThresholdPolicy.cpp @ 22762:9d78d44d3aac
improved JVMCI support for blocking compilation (GRAAL-1387)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 08 Jan 2016 17:30:33 +0100 |
parents | 569c82ebb96e |
children | 24505bf61633 |
comparison
equal
deleted
inserted
replaced
22761:f2206f5bb62e | 22762:9d78d44d3aac |
---|---|
159 return false; | 159 return false; |
160 } | 160 } |
161 | 161 |
162 // Called with the queue locked and with at least one element | 162 // Called with the queue locked and with at least one element |
163 CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) { | 163 CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) { |
164 #ifdef COMPILERJVMCI | |
165 CompileTask *max_blocking_task = NULL; | |
166 #endif | |
164 CompileTask *max_task = NULL; | 167 CompileTask *max_task = NULL; |
165 Method* max_method = NULL; | 168 Method* max_method = NULL; |
166 jlong t = os::javaTimeMillis(); | 169 jlong t = os::javaTimeMillis(); |
167 // Iterate through the queue and find a method with a maximum rate. | 170 // Iterate through the queue and find a method with a maximum rate. |
168 for (CompileTask* task = compile_queue->first(); task != NULL;) { | 171 for (CompileTask* task = compile_queue->first(); task != NULL;) { |
189 if (compare_methods(method, max_method)) { | 192 if (compare_methods(method, max_method)) { |
190 max_task = task; | 193 max_task = task; |
191 max_method = method; | 194 max_method = method; |
192 } | 195 } |
193 } | 196 } |
197 #ifdef COMPILERJVMCI | |
198 if (task->is_blocking()) { | |
199 if (max_blocking_task == NULL || compare_methods(method, max_blocking_task->method())) { | |
200 max_blocking_task = task; | |
201 } | |
202 } | |
203 #endif | |
194 task = next_task; | 204 task = next_task; |
195 } | 205 } |
206 | |
207 #ifdef COMPILERJVMCI | |
208 if (max_blocking_task != NULL) { | |
209 // In blocking compilation mode, the CompileBroker will make | |
210 // compilations submitted by a JVMCI compiler thread non-blocking. These | |
211 // compilations should be scheduled after all blocking compilations | |
212 // to service non-compiler related compilations sooner and reduce the | |
213 // chance of such compilations timing out. | |
214 max_task = max_blocking_task; | |
215 max_method = max_task->method(); | |
216 } | |
217 #endif | |
196 | 218 |
197 if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile | 219 if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile |
198 && is_method_profiled(max_method)) { | 220 && is_method_profiled(max_method)) { |
199 max_task->set_comp_level(CompLevel_limited_profile); | 221 max_task->set_comp_level(CompLevel_limited_profile); |
200 if (PrintTieredEvents) { | 222 if (PrintTieredEvents) { |