< prev index next >

src/share/vm/utilities/globalDefinitions.hpp

Print this page




 128 extern int LogBitsPerHeapOop;
 129 extern int BytesPerHeapOop;
 130 extern int BitsPerHeapOop;
 131 
 132 // Oop encoding heap max
 133 extern uint64_t OopEncodingHeapMax;
 134 
 135 const int BitsPerJavaInteger = 32;
 136 const int BitsPerJavaLong    = 64;
 137 const int BitsPerSize_t      = size_tSize * BitsPerByte;
 138 
 139 // Size of a char[] needed to represent a jint as a string in decimal.
 140 const int jintAsStringSize = 12;
 141 
 142 // In fact this should be
 143 // log2_intptr(sizeof(class JavaThread)) - log2_intptr(64);
 144 // see os::set_memory_serialize_page()
 145 #ifdef _LP64
 146 const int SerializePageShiftCount = 4;
 147 #else





 148 const int SerializePageShiftCount = 3;
 149 #endif

 150 
 151 // An opaque struct of heap-word width, so that HeapWord* can be a generic
 152 // pointer into the heap.  We require that object sizes be measured in
 153 // units of heap words, so that that
 154 //   HeapWord* hw;
 155 //   hw += oop(hw)->foo();
 156 // works, where foo is a method (like size or scavenge) that returns the
 157 // object size.
 158 class HeapWord {
 159   friend class VMStructs;
 160  private:
 161   char* i;
 162 #ifndef PRODUCT
 163  public:
 164   char* value() { return i; }
 165 #endif
 166 };
 167 
 168 // Analogous opaque struct for metadata allocated from
 169 // metaspaces.


1410 // integers.  These are derived from the definitions in inttypes.h.  If the platform
1411 // doesn't provide appropriate definitions, they should be provided in
1412 // the compiler-specific definitions file (e.g., globalDefinitions_gcc.hpp)
1413 
1414 #define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false")
1415 
1416 // Format 32-bit quantities.
1417 #define INT32_FORMAT           "%" PRId32
1418 #define UINT32_FORMAT          "%" PRIu32
1419 #define INT32_FORMAT_W(width)  "%" #width PRId32
1420 #define UINT32_FORMAT_W(width) "%" #width PRIu32
1421 
1422 #define PTR32_FORMAT           "0x%08" PRIx32
1423 
1424 // Format 64-bit quantities.
1425 #define INT64_FORMAT           "%" PRId64
1426 #define UINT64_FORMAT          "%" PRIu64
1427 #define UINT64_FORMAT_X        "%" PRIx64
1428 #define INT64_FORMAT_W(width)  "%" #width PRId64
1429 #define UINT64_FORMAT_W(width) "%" #width PRIu64

1430 
1431 #define PTR64_FORMAT           "0x%016" PRIx64
1432 
1433 // Format jlong, if necessary
1434 #ifndef JLONG_FORMAT
1435 #define JLONG_FORMAT           INT64_FORMAT
1436 #endif
1437 #ifndef JULONG_FORMAT
1438 #define JULONG_FORMAT          UINT64_FORMAT
1439 #endif
1440 
1441 // Format pointers which change size between 32- and 64-bit.
1442 #ifdef  _LP64
1443 #define INTPTR_FORMAT "0x%016" PRIxPTR
1444 #define PTR_FORMAT    "0x%016" PRIxPTR
1445 #else   // !_LP64
1446 #define INTPTR_FORMAT "0x%08"  PRIxPTR
1447 #define PTR_FORMAT    "0x%08"  PRIxPTR
1448 #endif  // _LP64
1449 




 128 extern int LogBitsPerHeapOop;
 129 extern int BytesPerHeapOop;
 130 extern int BitsPerHeapOop;
 131 
 132 // Oop encoding heap max
 133 extern uint64_t OopEncodingHeapMax;
 134 
 135 const int BitsPerJavaInteger = 32;
 136 const int BitsPerJavaLong    = 64;
 137 const int BitsPerSize_t      = size_tSize * BitsPerByte;
 138 
 139 // Size of a char[] needed to represent a jint as a string in decimal.
 140 const int jintAsStringSize = 12;
 141 
 142 // In fact this should be
 143 // log2_intptr(sizeof(class JavaThread)) - log2_intptr(64);
 144 // see os::set_memory_serialize_page()
 145 #ifdef _LP64
 146 const int SerializePageShiftCount = 4;
 147 #else
 148 #if INCLUDE_JFR && INCLUDE_ALL_GCS
 149 // JavaThread already has quite a few Shenandoah fields. Adding many JFR fields
 150 // trips sizeof(JavaThread) > 1024. Need to adjust it here.
 151 const int SerializePageShiftCount = 4;
 152 #else
 153 const int SerializePageShiftCount = 3;
 154 #endif
 155 #endif
 156 
 157 // An opaque struct of heap-word width, so that HeapWord* can be a generic
 158 // pointer into the heap.  We require that object sizes be measured in
 159 // units of heap words, so that that
 160 //   HeapWord* hw;
 161 //   hw += oop(hw)->foo();
 162 // works, where foo is a method (like size or scavenge) that returns the
 163 // object size.
 164 class HeapWord {
 165   friend class VMStructs;
 166  private:
 167   char* i;
 168 #ifndef PRODUCT
 169  public:
 170   char* value() { return i; }
 171 #endif
 172 };
 173 
 174 // Analogous opaque struct for metadata allocated from
 175 // metaspaces.


1416 // integers.  These are derived from the definitions in inttypes.h.  If the platform
1417 // doesn't provide appropriate definitions, they should be provided in
1418 // the compiler-specific definitions file (e.g., globalDefinitions_gcc.hpp)
1419 
1420 #define BOOL_TO_STR(_b_) ((_b_) ? "true" : "false")
1421 
1422 // Format 32-bit quantities.
1423 #define INT32_FORMAT           "%" PRId32
1424 #define UINT32_FORMAT          "%" PRIu32
1425 #define INT32_FORMAT_W(width)  "%" #width PRId32
1426 #define UINT32_FORMAT_W(width) "%" #width PRIu32
1427 
1428 #define PTR32_FORMAT           "0x%08" PRIx32
1429 
1430 // Format 64-bit quantities.
1431 #define INT64_FORMAT           "%" PRId64
1432 #define UINT64_FORMAT          "%" PRIu64
1433 #define UINT64_FORMAT_X        "%" PRIx64
1434 #define INT64_FORMAT_W(width)  "%" #width PRId64
1435 #define UINT64_FORMAT_W(width) "%" #width PRIu64
1436 #define UINT64_FORMAT_X_W(width) "%" #width PRIx64
1437 
1438 #define PTR64_FORMAT           "0x%016" PRIx64
1439 
1440 // Format jlong, if necessary
1441 #ifndef JLONG_FORMAT
1442 #define JLONG_FORMAT           INT64_FORMAT
1443 #endif
1444 #ifndef JULONG_FORMAT
1445 #define JULONG_FORMAT          UINT64_FORMAT
1446 #endif
1447 
1448 // Format pointers which change size between 32- and 64-bit.
1449 #ifdef  _LP64
1450 #define INTPTR_FORMAT "0x%016" PRIxPTR
1451 #define PTR_FORMAT    "0x%016" PRIxPTR
1452 #else   // !_LP64
1453 #define INTPTR_FORMAT "0x%08"  PRIxPTR
1454 #define PTR_FORMAT    "0x%08"  PRIxPTR
1455 #endif  // _LP64
1456 


< prev index next >