# HG changeset patch # User Gilles Duboscq # Date 1389963839 -3600 # Node ID f82eb515d58d0fbe34cbf996edbff2f15abb3208 # Parent 034706a93f277c8666c092bbc242f4f8f1bedac7 deoptimization, replace 'speculation' with 'debug_id' in some debug messages, Add debug messages arounf speculation handling diff -r 034706a93f27 -r f82eb515d58d src/share/vm/runtime/deoptimization.cpp --- a/src/share/vm/runtime/deoptimization.cpp Fri Jan 17 14:02:42 2014 +0100 +++ b/src/share/vm/runtime/deoptimization.cpp Fri Jan 17 14:03:59 2014 +0100 @@ -1359,7 +1359,7 @@ ScopeDesc* trap_scope = cvf->scope(); if (TraceDeoptimization) { - tty->print_cr(" bci=%d pc=%d, relative_pc=%d, method=%s" GRAAL_ONLY(", speculation=%d"), trap_scope->bci(), fr.pc(), fr.pc() - nm->code_begin(), trap_scope->method()->name()->as_C_string() + tty->print_cr(" bci=%d pc=%d, relative_pc=%d, method=%s" GRAAL_ONLY(", debug_id=%d"), trap_scope->bci(), fr.pc(), fr.pc() - nm->code_begin(), trap_scope->method()->name()->as_C_string() #ifdef GRAAL , debug_id #endif @@ -1373,14 +1373,25 @@ if (speculation != NULL) { oop speculation_log = nm->speculation_log(); if (speculation_log != NULL) { - if (TraceUncollectedSpeculations) { + if (TraceDeoptimization || TraceUncollectedSpeculations) { if (SpeculationLog::lastFailed(speculation_log) != NULL) { tty->print_cr("A speculation that was not collected by the compiler is being overwritten"); } } + if (TraceDeoptimization) { + tty->print_cr("Saving speculation to speculation log"); + } SpeculationLog::set_lastFailed(speculation_log, speculation); + } else { + if (TraceDeoptimization) { + tty->print_cr("Speculation present but no speculation log"); + } } thread->set_pending_failed_speculation(NULL); + } else { + if (TraceDeoptimization) { + tty->print_cr("No speculation"); + } } if (trap_bci == SynchronizationEntryBCI) { @@ -1490,7 +1501,7 @@ tty->print(" (Graal: no installed code) "); } #endif //GRAAL - tty->print(" (@" INTPTR_FORMAT ") thread=" UINTX_FORMAT " reason=%s action=%s unloaded_class_index=%d" GRAAL_ONLY(" speculation=%d"), + tty->print(" (@" INTPTR_FORMAT ") thread=" UINTX_FORMAT " reason=%s action=%s unloaded_class_index=%d" GRAAL_ONLY(" debug_id=%d"), fr.pc(), os::current_thread_id(), trap_reason_name(reason), @@ -2025,14 +2036,14 @@ #endif size_t len; if (unloaded_class_index < 0) { - len = jio_snprintf(buf, buflen, "reason='%s' action='%s'" GRAAL_ONLY(" speculation='%d'"), + len = jio_snprintf(buf, buflen, "reason='%s' action='%s'" GRAAL_ONLY(" debug_id='%d'"), reason, action #ifdef GRAAL ,debug_id #endif ); } else { - len = jio_snprintf(buf, buflen, "reason='%s' action='%s' index='%d'" GRAAL_ONLY(" speculation='%d'"), + len = jio_snprintf(buf, buflen, "reason='%s' action='%s' index='%d'" GRAAL_ONLY(" debug_id='%d'"), reason, action, unloaded_class_index #ifdef GRAAL ,debug_id