comparison agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @ 1579:e9ff18c4ace7

Merge
author jrose
date Wed, 02 Jun 2010 22:45:42 -0700
parents c18cbe5936b8 4a2e260bb13a
children 0a8e0d4345b3
comparison
equal deleted inserted replaced
1562:dfe27f03244a 1579:e9ff18c4ace7
91 /** Flag indicating whether UseTLAB is turned on */ 91 /** Flag indicating whether UseTLAB is turned on */
92 private boolean useTLAB; 92 private boolean useTLAB;
93 /** alignment constants */ 93 /** alignment constants */
94 private boolean isLP64; 94 private boolean isLP64;
95 private int bytesPerLong; 95 private int bytesPerLong;
96 private int objectAlignmentInBytes;
96 private int minObjAlignmentInBytes; 97 private int minObjAlignmentInBytes;
97 private int logMinObjAlignmentInBytes; 98 private int logMinObjAlignmentInBytes;
98 private int heapWordSize; 99 private int heapWordSize;
99 private int heapOopSize; 100 private int heapOopSize;
100 private int oopSize; 101 private int oopSize;
311 312
312 if (debugger != null) { 313 if (debugger != null) {
313 isLP64 = debugger.getMachineDescription().isLP64(); 314 isLP64 = debugger.getMachineDescription().isLP64();
314 } 315 }
315 bytesPerLong = db.lookupIntConstant("BytesPerLong").intValue(); 316 bytesPerLong = db.lookupIntConstant("BytesPerLong").intValue();
316 minObjAlignmentInBytes = db.lookupIntConstant("MinObjAlignmentInBytes").intValue();
317 // minObjAlignment = db.lookupIntConstant("MinObjAlignment").intValue();
318 logMinObjAlignmentInBytes = db.lookupIntConstant("LogMinObjAlignmentInBytes").intValue();
319 heapWordSize = db.lookupIntConstant("HeapWordSize").intValue(); 317 heapWordSize = db.lookupIntConstant("HeapWordSize").intValue();
320 oopSize = db.lookupIntConstant("oopSize").intValue(); 318 oopSize = db.lookupIntConstant("oopSize").intValue();
321 319
322 intxType = db.lookupType("intx"); 320 intxType = db.lookupType("intx");
323 uintxType = db.lookupType("uintx"); 321 uintxType = db.lookupType("uintx");
324 boolType = (CIntegerType) db.lookupType("bool"); 322 boolType = (CIntegerType) db.lookupType("bool");
323
324 minObjAlignmentInBytes = getObjectAlignmentInBytes();
325 if (minObjAlignmentInBytes == 8) {
326 logMinObjAlignmentInBytes = 3;
327 } else if (minObjAlignmentInBytes == 16) {
328 logMinObjAlignmentInBytes = 4;
329 } else {
330 throw new RuntimeException("Object alignment " + minObjAlignmentInBytes + " not yet supported");
331 }
325 332
326 if (isCompressedOopsEnabled()) { 333 if (isCompressedOopsEnabled()) {
327 // Size info for oops within java objects is fixed 334 // Size info for oops within java objects is fixed
328 heapOopSize = (int)getIntSize(); 335 heapOopSize = (int)getIntSize();
329 } else { 336 } else {
490 public int getBytesPerLong() { 497 public int getBytesPerLong() {
491 return bytesPerLong; 498 return bytesPerLong;
492 } 499 }
493 500
494 /** Get minimum object alignment in bytes. */ 501 /** Get minimum object alignment in bytes. */
495 public int getMinObjAlignment() {
496 return minObjAlignmentInBytes;
497 }
498
499 public int getMinObjAlignmentInBytes() { 502 public int getMinObjAlignmentInBytes() {
500 return minObjAlignmentInBytes; 503 return minObjAlignmentInBytes;
501 } 504 }
502 public int getLogMinObjAlignmentInBytes() { 505 public int getLogMinObjAlignmentInBytes() {
503 return logMinObjAlignmentInBytes; 506 return logMinObjAlignmentInBytes;
750 Flag flag = getCommandLineFlag("UseCompressedOops"); 753 Flag flag = getCommandLineFlag("UseCompressedOops");
751 compressedOopsEnabled = (flag == null) ? Boolean.FALSE: 754 compressedOopsEnabled = (flag == null) ? Boolean.FALSE:
752 (flag.getBool()? Boolean.TRUE: Boolean.FALSE); 755 (flag.getBool()? Boolean.TRUE: Boolean.FALSE);
753 } 756 }
754 return compressedOopsEnabled.booleanValue(); 757 return compressedOopsEnabled.booleanValue();
758 }
759
760 public int getObjectAlignmentInBytes() {
761 if (objectAlignmentInBytes == 0) {
762 Flag flag = getCommandLineFlag("ObjectAlignmentInBytes");
763 objectAlignmentInBytes = (flag == null) ? 8 : (int)flag.getIntx();
764 }
765 return objectAlignmentInBytes;
755 } 766 }
756 767
757 // returns null, if not available. 768 // returns null, if not available.
758 public Flag[] getCommandLineFlags() { 769 public Flag[] getCommandLineFlags() {
759 if (commandLineFlags == null) { 770 if (commandLineFlags == null) {