changeset 18712:37a5c6b8b930

Log deopt before deoptimizing the frame
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 17 Dec 2014 13:39:48 -0800
parents 88c280297bd2
children cbb097347545
files src/share/vm/runtime/deoptimization.cpp
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/deoptimization.cpp	Thu Dec 18 13:10:23 2014 +1000
+++ b/src/share/vm/runtime/deoptimization.cpp	Wed Dec 17 13:39:48 2014 -0800
@@ -1228,17 +1228,12 @@
 
   gather_statistics(reason, Action_none, Bytecodes::_illegal);
 
-  // Patch the nmethod so that when execution returns to it we will
-  // deopt the execution state and return to the interpreter.
-  fr.deoptimize(thread);
-
   if (LogCompilation && xtty != NULL) {
     nmethod* nm = fr.cb()->as_nmethod_or_null();
     assert(nm != NULL, "only nmethods can deopt");
 
     ttyLocker ttyl;
-    xtty->begin_head("deoptimized thread='" UINTX_FORMAT "' compile_id='%d'",
-               thread->osthread()->thread_id(), nm != NULL ? nm->compile_id() : -1);
+    xtty->begin_head("deoptimized thread='" UINTX_FORMAT "'", thread->osthread()->thread_id());
     nm->log_identity(xtty);
     xtty->end_head();
     for (ScopeDesc* sd = nm->scope_desc_at(fr.pc()); ; sd = sd->sender()) {
@@ -1249,6 +1244,10 @@
     }
     xtty->tail("deoptimized");
   }
+
+  // Patch the nmethod so that when execution returns to it we will
+  // deopt the execution state and return to the interpreter.
+  fr.deoptimize(thread);
 }
 
 void Deoptimization::deoptimize(JavaThread* thread, frame fr, RegisterMap *map) {