comparison agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.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 da91efe96a93
children 49618582fc5b
comparison
equal deleted inserted replaced
6965:3be318ecfae5 6972:bd7a7ce2e264
330 } 330 }
331 331
332 public int currentMileage() { 332 public int currentMileage() {
333 return 20000; 333 return 20000;
334 } 334 }
335
336 public void dumpReplayData(PrintStream out) {
337 Method method = getMethod();
338 Klass holder = method.getMethodHolder();
339 out.print("ciMethodData " +
340 holder.getName().asString() + " " +
341 OopUtilities.escapeString(method.getName().asString()) + " " +
342 method.getSignature().asString() + " " +
343 "2" + " " +
344 currentMileage());
345 byte[] orig = orig();
346 out.print(" orig " + orig.length);
347 for (int i = 0; i < orig.length; i++) {
348 out.print(" " + (orig[i] & 0xff));
349 }
350
351 long[] data = data();
352 out.print(" data " + data.length);
353 for (int i = 0; i < data.length; i++) {
354 out.print(" 0x" + Long.toHexString(data[i]));
355 }
356 int count = 0;
357 for (int round = 0; round < 2; round++) {
358 if (round == 1) out.print(" oops " + count);
359 ProfileData pdata = firstData();
360 for ( ; isValid(pdata); pdata = nextData(pdata)) {
361 if (pdata instanceof ReceiverTypeData) {
362 ReceiverTypeData vdata = (ReceiverTypeData)pdata;
363 for (int i = 0; i < vdata.rowLimit(); i++) {
364 Klass k = vdata.receiver(i);
365 if (k != null) {
366 if (round == 0) count++;
367 else out.print(" " +
368 (dpToDi(vdata.dp() +
369 vdata.cellOffset(vdata.receiverCellIndex(i))) / cellSize) + " " +
370 k.getName().asString());
371 }
372 }
373 } else if (pdata instanceof VirtualCallData) {
374 VirtualCallData vdata = (VirtualCallData)pdata;
375 for (int i = 0; i < vdata.rowLimit(); i++) {
376 Klass k = vdata.receiver(i);
377 if (k != null) {
378 if (round == 0) count++;
379 else out.print(" " +
380 (dpToDi(vdata.dp() +
381 vdata.cellOffset(vdata.receiverCellIndex(i))) / cellSize) + " " +
382 k.getName().asString());
383 }
384 }
385 }
386 }
387 }
388 out.println();
389 }
335 } 390 }