hotspot/src/share/vm/compiler/compileBroker.cpp
changeset 25642 9d809ea074d9
parent 25477 7dad9f95fd31
child 25647 949674dcd7c7
equal deleted inserted replaced
25641:d99065e4572b 25642:9d809ea074d9
   295   _hot_method = NULL;
   295   _hot_method = NULL;
   296   _hot_method_holder = NULL;
   296   _hot_method_holder = NULL;
   297   _hot_count = hot_count;
   297   _hot_count = hot_count;
   298   _time_queued = 0;  // tidy
   298   _time_queued = 0;  // tidy
   299   _comment = comment;
   299   _comment = comment;
       
   300   _failure_reason = NULL;
   300 
   301 
   301   if (LogCompilation) {
   302   if (LogCompilation) {
   302     _time_queued = os::elapsed_counter();
   303     _time_queued = os::elapsed_counter();
   303     if (hot_method.not_null()) {
   304     if (hot_method.not_null()) {
   304       if (hot_method == method) {
   305       if (hot_method == method) {
   563 // CompileTask::log_task_done
   564 // CompileTask::log_task_done
   564 void CompileTask::log_task_done(CompileLog* log) {
   565 void CompileTask::log_task_done(CompileLog* log) {
   565   Thread* thread = Thread::current();
   566   Thread* thread = Thread::current();
   566   methodHandle method(thread, this->method());
   567   methodHandle method(thread, this->method());
   567   ResourceMark rm(thread);
   568   ResourceMark rm(thread);
       
   569 
       
   570   if (!_is_success) {
       
   571     const char* reason = _failure_reason != NULL ? _failure_reason : "unknown";
       
   572     log->elem("failure reason='%s'", reason);
       
   573   }
   568 
   574 
   569   // <task_done ... stamp='1.234'>  </task>
   575   // <task_done ... stamp='1.234'>  </task>
   570   nmethod* nm = code();
   576   nmethod* nm = code();
   571   log->begin_elem("task_done success='%d' nmsize='%d' count='%d'",
   577   log->begin_elem("task_done success='%d' nmsize='%d' count='%d'",
   572                   _is_success, nm == NULL ? 0 : nm->content_size(),
   578                   _is_success, nm == NULL ? 0 : nm->content_size(),
   731     {
   737     {
   732       MutexUnlocker ul(lock());
   738       MutexUnlocker ul(lock());
   733       for (CompileTask* task = head; task != NULL; ) {
   739       for (CompileTask* task = head; task != NULL; ) {
   734         CompileTask* next_task = task->next();
   740         CompileTask* next_task = task->next();
   735         CompileTaskWrapper ctw(task); // Frees the task
   741         CompileTaskWrapper ctw(task); // Frees the task
       
   742         task->set_failure_reason("stale task");
   736         task = next_task;
   743         task = next_task;
   737       }
   744       }
   738     }
   745     }
   739   }
   746   }
   740 }
   747 }
  1784 #endif /* COMPILER1 */
  1791 #endif /* COMPILER1 */
  1785         invoke_compiler_on_method(task);
  1792         invoke_compiler_on_method(task);
  1786       } else {
  1793       } else {
  1787         // After compilation is disabled, remove remaining methods from queue
  1794         // After compilation is disabled, remove remaining methods from queue
  1788         method->clear_queued_for_compilation();
  1795         method->clear_queued_for_compilation();
       
  1796         task->set_failure_reason("compilation is disabled");
  1789       }
  1797       }
  1790     }
  1798     }
  1791   }
  1799   }
  1792 
  1800 
  1793   // Shut down compiler runtime
  1801   // Shut down compiler runtime
  1971 
  1979 
  1972     // Copy this bit to the enclosing block:
  1980     // Copy this bit to the enclosing block:
  1973     compilable = ci_env.compilable();
  1981     compilable = ci_env.compilable();
  1974 
  1982 
  1975     if (ci_env.failing()) {
  1983     if (ci_env.failing()) {
       
  1984       task->set_failure_reason(ci_env.failure_reason());
  1976       const char* retry_message = ci_env.retry_message();
  1985       const char* retry_message = ci_env.retry_message();
  1977       if (_compilation_log != NULL) {
  1986       if (_compilation_log != NULL) {
  1978         _compilation_log->log_failure(thread, task, ci_env.failure_reason(), retry_message);
  1987         _compilation_log->log_failure(thread, task, ci_env.failure_reason(), retry_message);
  1979       }
  1988       }
  1980       if (PrintCompilation) {
  1989       if (PrintCompilation) {