--- old/src/share/vm/compiler/compileBroker.cpp 2016-04-13 14:48:45.426218448 +0200 +++ new/src/share/vm/compiler/compileBroker.cpp 2016-04-13 14:48:45.278218442 +0200 @@ -169,6 +169,18 @@ CompileQueue* CompileBroker::_c2_compile_queue = NULL; CompileQueue* CompileBroker::_c1_compile_queue = NULL; +const char * CompileBroker::reason_names[] = { + "no_reason", + "count", + "backedge_count", + "tiered", + "CTW", + "replay", + "whitebox", + "must_be_compiled", + "bootstrap" +}; + class CompilationLog : public StringEventLog { public: CompilationLog() : StringEventLog("Compilation events") { @@ -844,7 +856,7 @@ int comp_level, const methodHandle& hot_method, int hot_count, - const char* comment, + int compile_reason, bool blocking, Thread* thread) { guarantee(!method->is_abstract(), "cannot compile abstract methods"); @@ -860,7 +872,7 @@ if (osr_bci != InvocationEntryBci) { tty->print(" osr_bci: %d", osr_bci); } - tty->print(" level: %d comment: %s count: %d", comp_level, comment, hot_count); + tty->print(" level: %d comment: %s count: %d", comp_level, CompileBroker::reason_names[compile_reason], hot_count); if (!hot_method.is_null()) { tty->print(" hot: "); if (hot_method() != method()) { @@ -1024,7 +1036,7 @@ task = create_compile_task(queue, compile_id, method, osr_bci, comp_level, - hot_method, hot_count, comment, + hot_method, hot_count, compile_reason, blocking); } @@ -1036,7 +1048,7 @@ nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci, int comp_level, const methodHandle& hot_method, int hot_count, - const char* comment, Thread* THREAD) { + int compile_reason, Thread* THREAD) { // do nothing if compilebroker is not available if (!_initialized) { return NULL; @@ -1044,7 +1056,7 @@ AbstractCompiler *comp = CompileBroker::compiler(comp_level); assert(comp != NULL, "Ensure we don't compile before compilebroker init"); DirectiveSet* directive = DirectivesStack::getMatchingDirective(method, comp); - nmethod* nm = CompileBroker::compile_method(method, osr_bci, comp_level, hot_method, hot_count, comment, directive, THREAD); + nmethod* nm = CompileBroker::compile_method(method, osr_bci, comp_level, hot_method, hot_count, compile_reason, directive, THREAD); DirectivesStack::release(directive); return nm; } @@ -1052,7 +1064,7 @@ nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci, int comp_level, const methodHandle& hot_method, int hot_count, - const char* comment, DirectiveSet* directive, + int compile_reason, DirectiveSet* directive, Thread* THREAD) { // make sure arguments make sense @@ -1177,7 +1189,7 @@ return NULL; } bool is_blocking = !directive->BackgroundCompilationOption || CompileTheWorld || ReplayCompiles; - compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, comment, is_blocking, THREAD); + compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, compile_reason, is_blocking, THREAD); } // return requested nmethod @@ -1336,11 +1348,11 @@ int comp_level, const methodHandle& hot_method, int hot_count, - const char* comment, + int compile_reason, bool blocking) { CompileTask* new_task = CompileTask::allocate(); new_task->initialize(compile_id, method, osr_bci, comp_level, - hot_method, hot_count, comment, + hot_method, hot_count, compile_reason, blocking); queue->add(new_task); return new_task;