8005079: fix LogCompilation for incremental inlining

Report late inlining as part of the rest of the inlining output

Reviewed-by: twisti, kvn
This commit is contained in:
Roland Westrelin 2014-04-10 11:38:12 +02:00
parent 65d6e6b331
commit 522abfc113
16 changed files with 273 additions and 43 deletions

View file

@ -3851,7 +3851,7 @@ void Compile::print_inlining_assert_ready() {
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++) {
@ -3861,6 +3861,7 @@ void Compile::dump_inlining() {
if (do_print_inlining) {
cg->print_inlining_late(msg);
}
log_late_inline_failure(cg, msg);
}
}
}
@ -3871,6 +3872,48 @@ void Compile::dump_inlining() {
}
}
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()) << 33) + (CICountOSR && is_osr_compilation() ? ((jlong)1) << 32 : 0);
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) {