src/hotspot/share/compiler/compileBroker.cpp
changeset 54015 cd701366fcf8
parent 53582 881c5fbeb849
child 54482 c914170817d4
--- a/src/hotspot/share/compiler/compileBroker.cpp	Thu Mar 07 00:23:45 2019 +0100
+++ b/src/hotspot/share/compiler/compileBroker.cpp	Thu Mar 07 08:38:16 2019 +0100
@@ -258,14 +258,14 @@
   }
 #endif
   CompileLog*     log  = thread->log();
-  if (log != NULL)  task->log_task_start(log);
+  if (log != NULL && !task->is_unloaded())  task->log_task_start(log);
 }
 
 CompileTaskWrapper::~CompileTaskWrapper() {
   CompilerThread* thread = CompilerThread::current();
   CompileTask* task = thread->task();
   CompileLog*  log  = thread->log();
-  if (log != NULL)  task->log_task_done(log);
+  if (log != NULL && !task->is_unloaded())  task->log_task_done(log);
   thread->set_task(NULL);
   task->set_code_handle(NULL);
   thread->set_env(NULL);
@@ -444,6 +444,9 @@
   {
     NoSafepointVerifier nsv;
     task = CompilationPolicy::policy()->select_task(this);
+    if (task != NULL) {
+      task = task->select_for_compilation();
+    }
   }
 
   if (task != NULL) {
@@ -455,7 +458,6 @@
     remove(task);
     purge_stale_tasks(); // may temporarily release MCQ lock
   }
-
   return task;
 }
 
@@ -483,7 +485,7 @@
 }
 
 void CompileQueue::remove(CompileTask* task) {
-   assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
+  assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
   if (task->prev() != NULL) {
     task->prev()->set_next(task->next());
   } else {
@@ -534,7 +536,7 @@
 
   char buf[2000];
   int buflen = sizeof(buf);
-  Threads::print_threads_compiling(st, buf, buflen);
+  Threads::print_threads_compiling(st, buf, buflen, /* short_form = */ true);
 
   st->cr();
   if (_c1_compile_queue != NULL) {