Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java @ 6972:bd7a7ce2e264
6830717: replay of compilations would help with debugging
Summary: When java process crashed in compiler thread, repeat the compilation process will help finding root cause. This is done with using SA dump application class data and replay data from core dump, then use debug version of jvm to recompile the problematic java method.
Reviewed-by: kvn, twisti, sspitsyn
Contributed-by: yumin.qi@oracle.com
author | minqi |
---|---|
date | Mon, 12 Nov 2012 14:03:53 -0800 |
parents | 5a98bf7d847b |
children | 7b23cb975cf2 |
comparison
equal
deleted
inserted
replaced
6965:3be318ecfae5 | 6972:bd7a7ce2e264 |
---|---|
496 method.getMethodHolder().getName().asString() + "." + | 496 method.getMethodHolder().getName().asString() + "." + |
497 method.getName().asString() + | 497 method.getName().asString() + |
498 method.getSignature().asString(); | 498 method.getSignature().asString(); |
499 } | 499 } |
500 | 500 |
501 public void dumpReplayData(PrintStream out) { | |
502 HashMap h = new HashMap(); | |
503 for (int i = 1; i < getMetadataLength(); i++) { | |
504 Metadata meta = Metadata.instantiateWrapperFor(getMetadataAt(i)); | |
505 System.err.println(meta); | |
506 if (h.get(meta) != null) continue; | |
507 h.put(meta, meta); | |
508 if (meta instanceof InstanceKlass) { | |
509 ((InstanceKlass)meta).dumpReplayData(out); | |
510 } else if (meta instanceof Method) { | |
511 ((Method)meta).dumpReplayData(out); | |
512 MethodData mdo = ((Method)meta).getMethodData(); | |
513 if (mdo != null) { | |
514 mdo.dumpReplayData(out); | |
515 } | |
516 } | |
517 } | |
518 Method method = getMethod(); | |
519 if (h.get(method) == null) { | |
520 method.dumpReplayData(out); | |
521 MethodData mdo = method.getMethodData(); | |
522 if (mdo != null) { | |
523 mdo.dumpReplayData(out); | |
524 } | |
525 } | |
526 if (h.get(method.getMethodHolder()) == null) { | |
527 ((InstanceKlass)method.getMethodHolder()).dumpReplayData(out); | |
528 } | |
529 Klass holder = method.getMethodHolder(); | |
530 out.println("compile " + holder.getName().asString() + " " + | |
531 OopUtilities.escapeString(method.getName().asString()) + " " + | |
532 method.getSignature().asString() + " " + | |
533 getEntryBCI()); | |
534 | |
535 } | |
536 | |
501 //-------------------------------------------------------------------------------- | 537 //-------------------------------------------------------------------------------- |
502 // Internals only below this point | 538 // Internals only below this point |
503 // | 539 // |
504 | 540 |
505 private int getEntryBCI() { return (int) entryBCIField .getValue(addr); } | 541 private int getEntryBCI() { return (int) entryBCIField .getValue(addr); } |