changeset 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 61cc3ee666d2
files src/share/vm/compiler/compileBroker.cpp src/share/vm/runtime/compilationPolicy.cpp src/share/vm/runtime/compilationPolicy.hpp src/share/vm/runtime/simpleThresholdPolicy.cpp
diffstat 4 files changed, 12 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/compiler/compileBroker.cpp	Fri Jan 08 22:24:51 2016 +0100
+++ b/src/share/vm/compiler/compileBroker.cpp	Fri Jan 08 23:45:00 2016 +0100
@@ -1745,9 +1745,6 @@
       }
       if (state == _thread_blocked) {
         if (++consecutively_blocked == BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS) {
-          if (_compilation_log != NULL) {
-            _compilation_log->log_failure(thread, task, "wait for blocking compilation timed out", NULL);
-          }
           if (PrintCompilation) {
             task->print_compilation(tty, "wait for blocking compilation timed out");
           }
--- 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) {
--- a/src/share/vm/runtime/compilationPolicy.hpp	Fri Jan 08 22:24:51 2016 +0100
+++ b/src/share/vm/runtime/compilationPolicy.hpp	Fri Jan 08 23:45:00 2016 +0100
@@ -58,21 +58,7 @@
   static void set_policy(CompilationPolicy* policy) { _policy = policy; }
   static CompilationPolicy* policy()                { return _policy; }
 
-#ifdef COMPILERJVMCI
-  /**
-   * If in blocking compilation mode and the JVMCI compiler is in use,
-   * this method selects a blocking task (if any) before a non-blocking
-   * task. 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.
-   *
-   * @return the first non-blocking task in compile_queue if there is one otherwise
-   *         the first task in compile_queue
-   */
-  static CompileTask* select_task_blocking_aware(CompileQueue* compile_queue);
-#endif
+  static CompileTask* select_task_helper(CompileQueue* compile_queue);
 
   // Profiling
   elapsedTimer* accumulated_time() { return &_accumulated_time; }
--- a/src/share/vm/runtime/simpleThresholdPolicy.cpp	Fri Jan 08 22:24:51 2016 +0100
+++ b/src/share/vm/runtime/simpleThresholdPolicy.cpp	Fri Jan 08 23:45:00 2016 +0100
@@ -168,11 +168,7 @@
 
 // Called with the queue locked and with at least one element
 CompileTask* SimpleThresholdPolicy::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);
 }
 
 void SimpleThresholdPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) {