diff src/share/vm/runtime/compilationPolicy.cpp @ 22764:9c0966b935a9

converted select_task_blocking_aware into select_task_helper (GRAAL-1387)
author Doug Simon <doug.simon@oracle.com>
date Fri, 08 Jan 2016 23:45:00 +0100
parents 94b7354ef0e0
children 7ae6a635fad0
line wrap: on
line diff
--- a/src/share/vm/runtime/compilationPolicy.cpp	Fri Jan 08 22:24:51 2016 +0100
+++ b/src/share/vm/runtime/compilationPolicy.cpp	Fri Jan 08 23:45:00 2016 +0100
@@ -160,18 +160,25 @@
   return !delay_compilation_during_startup() && CompileBroker::should_compile_new_jobs();
 }
 
+CompileTask* CompilationPolicy::select_task_helper(CompileQueue* compile_queue) {
 #ifdef COMPILERJVMCI
-CompileTask* CompilationPolicy::select_task_blocking_aware(CompileQueue* compile_queue) {
   if (!BackgroundCompilation) {
+    /*
+     * In blocking compilation mode, the CompileBroker will make
+     * compilations submitted by a JVMCI compiler thread non-blocking. These
+     * compilations should be scheduled after all blocking compilations
+     * to service non-compiler related compilations sooner and reduce the
+     * chance of such compilations timing out.
+     */
     for (CompileTask* task = compile_queue->first(); task != NULL; task = task->next()) {
       if (task->is_blocking()) {
         return task;
       }
     }
   }
+#endif
   return compile_queue->first();
 }
-#endif
 
 #ifndef PRODUCT
 void CompilationPolicy::print_time() {
@@ -353,11 +360,7 @@
 }
 
 CompileTask* NonTieredCompPolicy::select_task(CompileQueue* compile_queue) {
-#ifdef COMPILERJVMCI
-  return select_task_blocking_aware(compile_queue);
-#else
-  return compile_queue->first();
-#endif
+  return select_task_helper(compile_queue);
 }
 
 bool NonTieredCompPolicy::is_mature(Method* method) {