src/hotspot/share/runtime/thread.cpp
changeset 48428 e569e83139fd
parent 48382 0997d6959851
child 48490 4f647519c8be
equal deleted inserted replaced
48427:b08405cc467a 48428:e569e83139fd
  2944     // need to walk ciMetadata in current compile tasks to keep alive.
  2944     // need to walk ciMetadata in current compile tasks to keep alive.
  2945     CompilerThread* ct = (CompilerThread*)this;
  2945     CompilerThread* ct = (CompilerThread*)this;
  2946     if (ct->env() != NULL) {
  2946     if (ct->env() != NULL) {
  2947       ct->env()->metadata_do(f);
  2947       ct->env()->metadata_do(f);
  2948     }
  2948     }
  2949     if (ct->task() != NULL) {
  2949     CompileTask* task = ct->task();
  2950       ct->task()->metadata_do(f);
  2950     if (task != NULL) {
       
  2951       task->metadata_do(f);
  2951     }
  2952     }
  2952   }
  2953   }
  2953 }
  2954 }
  2954 
  2955 
  2955 // Printing
  2956 // Printing
  2999 #ifndef PRODUCT
  3000 #ifndef PRODUCT
  3000   print_thread_state_on(st);
  3001   print_thread_state_on(st);
  3001   _safepoint_state->print_on(st);
  3002   _safepoint_state->print_on(st);
  3002 #endif // PRODUCT
  3003 #endif // PRODUCT
  3003   if (is_Compiler_thread()) {
  3004   if (is_Compiler_thread()) {
  3004     CompilerThread* ct = (CompilerThread*)this;
  3005     CompileTask *task = ((CompilerThread*)this)->task();
  3005     if (ct->task() != NULL) {
  3006     if (task != NULL) {
  3006       st->print("   Compiling: ");
  3007       st->print("   Compiling: ");
  3007       ct->task()->print(st, NULL, true, false);
  3008       task->print(st, NULL, true, false);
  3008     } else {
  3009     } else {
  3009       st->print("   No compile task");
  3010       st->print("   No compile task");
  3010     }
  3011     }
  3011     st->cr();
  3012     st->cr();
  3012   }
  3013   }
  4710 
  4711 
  4711 void Threads::print_threads_compiling(outputStream* st, char* buf, int buflen) {
  4712 void Threads::print_threads_compiling(outputStream* st, char* buf, int buflen) {
  4712   ALL_JAVA_THREADS(thread) {
  4713   ALL_JAVA_THREADS(thread) {
  4713     if (thread->is_Compiler_thread()) {
  4714     if (thread->is_Compiler_thread()) {
  4714       CompilerThread* ct = (CompilerThread*) thread;
  4715       CompilerThread* ct = (CompilerThread*) thread;
  4715       if (ct->task() != NULL) {
  4716 
       
  4717       // Keep task in local variable for NULL check.
       
  4718       // ct->_task might be set to NULL by concurring compiler thread
       
  4719       // because it completed the compilation. The task is never freed,
       
  4720       // though, just returned to a free list.
       
  4721       CompileTask* task = ct->task();
       
  4722       if (task != NULL) {
  4716         thread->print_name_on_error(st, buf, buflen);
  4723         thread->print_name_on_error(st, buf, buflen);
  4717         ct->task()->print(st, NULL, true, true);
  4724         task->print(st, NULL, true, true);
  4718       }
  4725       }
  4719     }
  4726     }
  4720   }
  4727   }
  4721 }
  4728 }
  4722 
  4729