changeset 13670:f82eb515d58d

deoptimization, replace 'speculation' with 'debug_id' in some debug messages, Add debug messages arounf speculation handling
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 17 Jan 2014 14:03:59 +0100
parents 034706a93f27
children 1bb4f8920dd3
files src/share/vm/runtime/deoptimization.cpp
diffstat 1 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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