@@ -294,37 +294,45 @@ public String details() {
294294 StringWriter sw = new StringWriter ();
295295 PrintWriter out = new PrintWriter (sw );
296296
297- out .println ("# Running " + (addressSize * 8 ) + "-bit HotSpot VM. " );
297+ out .println ("# VM mode: " + (addressSize * 8 ) + " bits " );
298298
299299 if (lilliputVM ) {
300- out .println ("# Lilliput VM detected (experimental). " );
300+ out .println ("# Lilliput VM detected (experimental)" );
301301 }
302302
303+ out .print ("# Compressed references (oops): " );
303304 if (compressedOopsEnabled ) {
305+ out .print (narrowOopShift + "-bit shift" );
304306 if (narrowOopBase != 0 ) {
305- out .println ("# Using compressed oop with " +
306- formatAddressAsHexByAddressSize (narrowOopBase ) + " base address and " +
307- narrowOopShift + "-bit shift." );
308- } else {
309- out .println ("# Using compressed oop with " + narrowOopShift + "-bit shift." );
307+ out .print (" and " + formatAddressAsHexByAddressSize (narrowOopBase ) + " base" );
310308 }
309+ } else if (addressSize == 4 ){
310+ out .print ("not needed" );
311+ } else {
312+ out .print ("disabled" );
311313 }
314+ out .println ();
315+
316+ out .print ("# Compressed class pointers: " );
312317 if (compressedKlassOopsEnabled ) {
318+ out .print (narrowKlassShift + "-bit shift" );
313319 if (narrowKlassBase != 0 ) {
314- out .println ("# Using compressed klass with " +
315- formatAddressAsHexByAddressSize (narrowKlassBase ) + " base address and " +
316- narrowKlassShift + "-bit shift." );
317- } else {
318- out .println ("# Using compressed klass with " + narrowKlassShift + "-bit shift." );
320+ out .print (" and " + formatAddressAsHexByAddressSize (narrowKlassBase ) + " base" );
319321 }
322+ } else if (addressSize == 4 ) {
323+ out .print ("not needed" );
324+ } else {
325+ out .print ("disabled" );
320326 }
321- if (!isAccurate && (compressedOopsEnabled || compressedKlassOopsEnabled )) {
327+ out .println ();
328+
329+ if (addressSize != 4 && !isAccurate && (compressedOopsEnabled || compressedKlassOopsEnabled )) {
322330 out .println ("# WARNING | Compressed references base/shifts are guessed by the experiment!" );
323331 out .println ("# WARNING | Therefore, computed addresses are just guesses, and ARE NOT RELIABLE." );
324332 out .println ("# WARNING | Make sure to attach Serviceability Agent to get the reliable addresses." );
325333 }
326334
327- out .println ("# Objects are " + objectAlignment + " bytes aligned. " );
335+ out .println ("# Object alignment: " + objectAlignment + " bytes" );
328336
329337 out .printf ("# %-20s %4s, %4s, %4s, %4s, %4s, %4s, %4s, %4s, %4s%n" ,
330338 "" ,
@@ -682,7 +690,7 @@ private long toJvmKlassAddress(long address) {
682690 }
683691
684692 private String formatAddressAsHexByAddressSize (long address ) {
685- return "0x" + String .format ("%" + ( addressSize * 2 ) + " s" ,
693+ return "0x" + String .format ("%s" ,
686694 Long .toHexString (address ).toUpperCase ()).replace (' ' , '0' );
687695 }
688696
0 commit comments