comparison src/share/vm/compiler/compileBroker.cpp @ 20469:dd89808e49ba

8049530: Provide descriptive failure reason for compilation tasks removed for the queue Reviewed-by: roland, iveresov
author vlivanov
date Mon, 14 Jul 2014 03:26:52 -0700
parents 7301840ea20e
children 966205f0e717
comparison
equal deleted inserted replaced
20468:1de115720e74 20469:dd89808e49ba
285 _hot_method = NULL; 285 _hot_method = NULL;
286 _hot_method_holder = NULL; 286 _hot_method_holder = NULL;
287 _hot_count = hot_count; 287 _hot_count = hot_count;
288 _time_queued = 0; // tidy 288 _time_queued = 0; // tidy
289 _comment = comment; 289 _comment = comment;
290 _failure_reason = NULL;
290 291
291 if (LogCompilation) { 292 if (LogCompilation) {
292 _time_queued = os::elapsed_counter(); 293 _time_queued = os::elapsed_counter();
293 if (hot_method.not_null()) { 294 if (hot_method.not_null()) {
294 if (hot_method == method) { 295 if (hot_method == method) {
562 // CompileTask::log_task_done 563 // CompileTask::log_task_done
563 void CompileTask::log_task_done(CompileLog* log) { 564 void CompileTask::log_task_done(CompileLog* log) {
564 Thread* thread = Thread::current(); 565 Thread* thread = Thread::current();
565 methodHandle method(thread, this->method()); 566 methodHandle method(thread, this->method());
566 ResourceMark rm(thread); 567 ResourceMark rm(thread);
568
569 if (!_is_success) {
570 const char* reason = _failure_reason != NULL ? _failure_reason : "unknown";
571 log->elem("failure reason='%s'", reason);
572 }
567 573
568 // <task_done ... stamp='1.234'> </task> 574 // <task_done ... stamp='1.234'> </task>
569 nmethod* nm = code(); 575 nmethod* nm = code();
570 log->begin_elem("task_done success='%d' nmsize='%d' count='%d'", 576 log->begin_elem("task_done success='%d' nmsize='%d' count='%d'",
571 _is_success, nm == NULL ? 0 : nm->content_size(), 577 _is_success, nm == NULL ? 0 : nm->content_size(),
712 { 718 {
713 MutexUnlocker ul(lock()); 719 MutexUnlocker ul(lock());
714 for (CompileTask* task = head; task != NULL; ) { 720 for (CompileTask* task = head; task != NULL; ) {
715 CompileTask* next_task = task->next(); 721 CompileTask* next_task = task->next();
716 CompileTaskWrapper ctw(task); // Frees the task 722 CompileTaskWrapper ctw(task); // Frees the task
723 task->set_failure_reason("stale task");
717 task = next_task; 724 task = next_task;
718 } 725 }
719 } 726 }
720 } 727 }
721 } 728 }
1786 #endif /* COMPILER1 */ 1793 #endif /* COMPILER1 */
1787 invoke_compiler_on_method(task); 1794 invoke_compiler_on_method(task);
1788 } else { 1795 } else {
1789 // After compilation is disabled, remove remaining methods from queue 1796 // After compilation is disabled, remove remaining methods from queue
1790 method->clear_queued_for_compilation(); 1797 method->clear_queued_for_compilation();
1798 task->set_failure_reason("compilation is disabled");
1791 } 1799 }
1792 } 1800 }
1793 } 1801 }
1794 1802
1795 // Shut down compiler runtime 1803 // Shut down compiler runtime
1973 1981
1974 // Copy this bit to the enclosing block: 1982 // Copy this bit to the enclosing block:
1975 compilable = ci_env.compilable(); 1983 compilable = ci_env.compilable();
1976 1984
1977 if (ci_env.failing()) { 1985 if (ci_env.failing()) {
1986 task->set_failure_reason(ci_env.failure_reason());
1978 const char* retry_message = ci_env.retry_message(); 1987 const char* retry_message = ci_env.retry_message();
1979 if (_compilation_log != NULL) { 1988 if (_compilation_log != NULL) {
1980 _compilation_log->log_failure(thread, task, ci_env.failure_reason(), retry_message); 1989 _compilation_log->log_failure(thread, task, ci_env.failure_reason(), retry_message);
1981 } 1990 }
1982 if (PrintCompilation) { 1991 if (PrintCompilation) {