comparison src/share/vm/runtime/deoptimization.cpp @ 18225:40074f6ac788

Record frame state for deopts with +LogCompilation
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Fri, 31 Oct 2014 11:25:32 -0700
parents 5c1bd485c54b
children e04712c8928a
comparison
equal deleted inserted replaced
18224:bfa20550f0a8 18225:40074f6ac788
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 1231 // Patch the nmethod so that when execution returns to it we will
1232 // deopt the execution state and return to the interpreter. 1232 // deopt the execution state and return to the interpreter.
1233 fr.deoptimize(thread); 1233 fr.deoptimize(thread);
1234
1235 if (LogCompilation && xtty != NULL) {
1236 nmethod* nm = fr.cb()->as_nmethod_or_null();
1237 assert(nm != NULL, "only nmethods can deopt");
1238
1239 ttyLocker ttyl;
1240 xtty->begin_head("deoptimized thread='" UINTX_FORMAT "' compile_id='%d'",
1241 thread->osthread()->thread_id(), nm != NULL ? nm->compile_id() : -1);
1242 nm->log_identity(xtty);
1243 xtty->end_head();
1244 for (ScopeDesc* sd = nm->scope_desc_at(fr.pc()); ; sd = sd->sender()) {
1245 xtty->begin_elem("jvms bci='%d'", sd->bci());
1246 xtty->method(sd->method());
1247 xtty->end_elem();
1248 if (sd->is_top()) break;
1249 }
1250 xtty->tail("deoptimized");
1251 }
1234 } 1252 }
1235 1253
1236 void Deoptimization::deoptimize(JavaThread* thread, frame fr, RegisterMap *map) { 1254 void Deoptimization::deoptimize(JavaThread* thread, frame fr, RegisterMap *map) {
1237 deoptimize(thread, fr, map, Reason_constraint); 1255 deoptimize(thread, fr, map, Reason_constraint);
1238 } 1256 }