Mercurial > hg > truffle
comparison src/share/vm/runtime/deoptimization.cpp @ 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 | 3ad5d7a6adb5 |
children | 1f95f91dd1d6 |
comparison
equal
deleted
inserted
replaced
18711:88c280297bd2 | 18712:37a5c6b8b930 |
---|---|
1226 void Deoptimization::deoptimize_single_frame(JavaThread* thread, frame fr, Deoptimization::DeoptReason reason) { | 1226 void Deoptimization::deoptimize_single_frame(JavaThread* thread, frame fr, Deoptimization::DeoptReason reason) { |
1227 assert(fr.can_be_deoptimized(), "checking frame type"); | 1227 assert(fr.can_be_deoptimized(), "checking frame type"); |
1228 | 1228 |
1229 gather_statistics(reason, Action_none, Bytecodes::_illegal); | 1229 gather_statistics(reason, Action_none, Bytecodes::_illegal); |
1230 | 1230 |
1231 // Patch the nmethod so that when execution returns to it we will | |
1232 // deopt the execution state and return to the interpreter. | |
1233 fr.deoptimize(thread); | |
1234 | |
1235 if (LogCompilation && xtty != NULL) { | 1231 if (LogCompilation && xtty != NULL) { |
1236 nmethod* nm = fr.cb()->as_nmethod_or_null(); | 1232 nmethod* nm = fr.cb()->as_nmethod_or_null(); |
1237 assert(nm != NULL, "only nmethods can deopt"); | 1233 assert(nm != NULL, "only nmethods can deopt"); |
1238 | 1234 |
1239 ttyLocker ttyl; | 1235 ttyLocker ttyl; |
1240 xtty->begin_head("deoptimized thread='" UINTX_FORMAT "' compile_id='%d'", | 1236 xtty->begin_head("deoptimized thread='" UINTX_FORMAT "'", thread->osthread()->thread_id()); |
1241 thread->osthread()->thread_id(), nm != NULL ? nm->compile_id() : -1); | |
1242 nm->log_identity(xtty); | 1237 nm->log_identity(xtty); |
1243 xtty->end_head(); | 1238 xtty->end_head(); |
1244 for (ScopeDesc* sd = nm->scope_desc_at(fr.pc()); ; sd = sd->sender()) { | 1239 for (ScopeDesc* sd = nm->scope_desc_at(fr.pc()); ; sd = sd->sender()) { |
1245 xtty->begin_elem("jvms bci='%d'", sd->bci()); | 1240 xtty->begin_elem("jvms bci='%d'", sd->bci()); |
1246 xtty->method(sd->method()); | 1241 xtty->method(sd->method()); |
1247 xtty->end_elem(); | 1242 xtty->end_elem(); |
1248 if (sd->is_top()) break; | 1243 if (sd->is_top()) break; |
1249 } | 1244 } |
1250 xtty->tail("deoptimized"); | 1245 xtty->tail("deoptimized"); |
1251 } | 1246 } |
1247 | |
1248 // Patch the nmethod so that when execution returns to it we will | |
1249 // deopt the execution state and return to the interpreter. | |
1250 fr.deoptimize(thread); | |
1252 } | 1251 } |
1253 | 1252 |
1254 void Deoptimization::deoptimize(JavaThread* thread, frame fr, RegisterMap *map) { | 1253 void Deoptimization::deoptimize(JavaThread* thread, frame fr, RegisterMap *map) { |
1255 deoptimize(thread, fr, map, Reason_constraint); | 1254 deoptimize(thread, fr, map, Reason_constraint); |
1256 } | 1255 } |