< prev index next >

src/share/vm/utilities/globalDefinitions.hpp

Print this page




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





 153 const int SerializePageShiftCount = 3;
 154 #endif

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


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

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




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


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


< prev index next >