diff src/share/vm/runtime/deoptimization.cpp @ 12517:b2882f4ab612

Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 22 Oct 2013 15:10:14 +0200
parents 359f7e70ae7f
children d1f8d0538b79
line wrap: on
line diff
--- a/src/share/vm/runtime/deoptimization.cpp	Tue Oct 22 15:08:23 2013 +0200
+++ b/src/share/vm/runtime/deoptimization.cpp	Tue Oct 22 15:10:14 2013 +0200
@@ -89,6 +89,7 @@
 
 #ifdef GRAAL
 #include "graal/graalCompiler.hpp"
+#include "graal/graalJavaAccess.hpp"
 #endif
 
 
@@ -1420,6 +1421,19 @@
       if (TraceDeoptimization) {  // make noise on the tty
         tty->print("Uncommon trap occurred in");
         nm->method()->print_short_name(tty);
+#ifdef GRAAL
+        oop installedCode = nm->graal_installed_code();
+        if (installedCode != NULL) {
+          oop installedCodeName = HotSpotNmethod::name(installedCode);
+          if (installedCodeName != NULL) {
+            tty->print(" (Graal: installedCodeName=%s) ", java_lang_String::as_utf8_string(installedCodeName));
+          } else {
+            tty->print(" (Graal: installed code has no name) ");
+          }
+        } else {
+          tty->print(" (Graal: no installed code) ");
+        }
+#endif //GRAAL
         tty->print(" (@" INTPTR_FORMAT ") thread=" UINTX_FORMAT " reason=%s action=%s unloaded_class_index=%d",
                    fr.pc(),
                    os::current_thread_id(),