--- old/src/share/vm/opto/compile.cpp 2014-03-25 14:56:09.561480491 +0100 +++ new/src/share/vm/opto/compile.cpp 2014-03-25 14:56:09.262374255 +0100 @@ -3831,7 +3831,7 @@ void Compile::dump_inlining() { bool do_print_inlining = print_inlining() || print_intrinsics(); - if (do_print_inlining) { + if (do_print_inlining || log() != NULL) { // Print inlining message for candidates that we couldn't inline // for lack of space for (int i = 0; i < _late_inlines.length(); i++) { @@ -3841,6 +3841,7 @@ if (do_print_inlining) { cg->print_inlining_late(msg); } + log_late_inline_failure(cg, msg); } } } @@ -3851,6 +3852,48 @@ } } +void Compile::log_late_inline(CallGenerator* cg) { + if (log() != NULL) { + log()->head("late_inline method='%d' inline_id='" JLONG_FORMAT "'", log()->identify(cg->method()), + cg->unique_id()); + JVMState* p = cg->call_node()->jvms(); + while (p != NULL) { + log()->elem("jvms bci='%d' method='%d'", p->bci(), log()->identify(p->method())); + p = p->caller(); + } + log()->tail("late_inline"); + } +} + +void Compile::log_late_inline_failure(CallGenerator* cg, const char* msg) { + log_late_inline(cg); + if (log() != NULL) { + log()->inline_fail(msg); + } +} + +void Compile::log_inline_id(CallGenerator* cg) { + if (log() != NULL) { + // The LogCompilation tool needs a unique way to identify late + // inline call sites. This id must be unique for this call site in + // this compilation. Try to have it unique across compilations as + // well because it can be convenient when grepping through the log + // file. + // Distinguish OSR compilations from others in case CICountOSR is + // on. + jlong id = ((jlong)unique()) + (((jlong)compile_id()) << (is_osr_compilation() ? 33 : 32)); + cg->set_unique_id(id); + log()->elem("inline_id id='" JLONG_FORMAT "'", id); + } +} + +void Compile::log_inline_failure(const char* msg) { + if (C->log() != NULL) { + C->log()->inline_fail(msg); + } +} + + // Dump inlining replay data to the stream. // Don't change thread state and acquire any locks. void Compile::dump_inline_data(outputStream* out) {