< 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.


 410 // Klass encoding metaspace max size
 411 const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlassAlignmentInBytes;
 412 
 413 // Machine dependent stuff
 414 
 415 #if defined(X86) && defined(COMPILER2) && !defined(JAVASE_EMBEDDED)
 416 // Include Restricted Transactional Memory lock eliding optimization
 417 #define INCLUDE_RTM_OPT 1
 418 #define RTM_OPT_ONLY(code) code
 419 #else
 420 #define INCLUDE_RTM_OPT 0
 421 #define RTM_OPT_ONLY(code)
 422 #endif
 423 // States of Restricted Transactional Memory usage.
 424 enum RTMState {
 425   NoRTM      = 0x2, // Don't use RTM
 426   UseRTM     = 0x1, // Use RTM
 427   ProfileRTM = 0x0  // Use RTM with abort ratio calculation
 428 };
 429 





 430 #ifdef TARGET_ARCH_x86
 431 # include "globalDefinitions_x86.hpp"
 432 #endif



 433 #ifdef TARGET_ARCH_sparc
 434 # include "globalDefinitions_sparc.hpp"
 435 #endif
 436 #ifdef TARGET_ARCH_zero
 437 # include "globalDefinitions_zero.hpp"
 438 #endif
 439 #ifdef TARGET_ARCH_arm
 440 # include "globalDefinitions_arm.hpp"
 441 #endif
 442 #ifdef TARGET_ARCH_ppc
 443 # include "globalDefinitions_ppc.hpp"
 444 #endif
 445 
 446 /*
 447  * If a platform does not support native stack walking
 448  * the platform specific globalDefinitions (above)
 449  * can set PLATFORM_NATIVE_STACK_WALKING_SUPPORTED to 0
 450  */
 451 #ifndef PLATFORM_NATIVE_STACK_WALKING_SUPPORTED
 452 #define PLATFORM_NATIVE_STACK_WALKING_SUPPORTED 1


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

1421 
1422 #define PTR64_FORMAT           "0x%016" PRIx64
1423 
1424 // Format jlong, if necessary
1425 #ifndef JLONG_FORMAT
1426 #define JLONG_FORMAT           INT64_FORMAT
1427 #endif
1428 #ifndef JULONG_FORMAT
1429 #define JULONG_FORMAT          UINT64_FORMAT
1430 #endif
1431 
1432 // Format pointers which change size between 32- and 64-bit.
1433 #ifdef  _LP64
1434 #define INTPTR_FORMAT "0x%016" PRIxPTR
1435 #define PTR_FORMAT    "0x%016" PRIxPTR
1436 #else   // !_LP64
1437 #define INTPTR_FORMAT "0x%08"  PRIxPTR
1438 #define PTR_FORMAT    "0x%08"  PRIxPTR
1439 #endif  // _LP64
1440 




 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.


 416 // Klass encoding metaspace max size
 417 const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlassAlignmentInBytes;
 418 
 419 // Machine dependent stuff
 420 
 421 #if defined(X86) && defined(COMPILER2) && !defined(JAVASE_EMBEDDED)
 422 // Include Restricted Transactional Memory lock eliding optimization
 423 #define INCLUDE_RTM_OPT 1
 424 #define RTM_OPT_ONLY(code) code
 425 #else
 426 #define INCLUDE_RTM_OPT 0
 427 #define RTM_OPT_ONLY(code)
 428 #endif
 429 // States of Restricted Transactional Memory usage.
 430 enum RTMState {
 431   NoRTM      = 0x2, // Don't use RTM
 432   UseRTM     = 0x1, // Use RTM
 433   ProfileRTM = 0x0  // Use RTM with abort ratio calculation
 434 };
 435 
 436 // The maximum size of the code cache.  Can be overridden by targets.
 437 #define CODE_CACHE_SIZE_LIMIT (2*G)
 438 // Allow targets to reduce the default size of the code cache.
 439 #define CODE_CACHE_DEFAULT_LIMIT CODE_CACHE_SIZE_LIMIT
 440 
 441 #ifdef TARGET_ARCH_x86
 442 # include "globalDefinitions_x86.hpp"
 443 #endif
 444 #ifdef TARGET_ARCH_aarch64
 445 # include "globalDefinitions_aarch64.hpp"
 446 #endif
 447 #ifdef TARGET_ARCH_sparc
 448 # include "globalDefinitions_sparc.hpp"
 449 #endif
 450 #ifdef TARGET_ARCH_zero
 451 # include "globalDefinitions_zero.hpp"
 452 #endif
 453 #ifdef TARGET_ARCH_arm
 454 # include "globalDefinitions_arm.hpp"
 455 #endif
 456 #ifdef TARGET_ARCH_ppc
 457 # include "globalDefinitions_ppc.hpp"
 458 #endif
 459 
 460 /*
 461  * If a platform does not support native stack walking
 462  * the platform specific globalDefinitions (above)
 463  * can set PLATFORM_NATIVE_STACK_WALKING_SUPPORTED to 0
 464  */
 465 #ifndef PLATFORM_NATIVE_STACK_WALKING_SUPPORTED
 466 #define PLATFORM_NATIVE_STACK_WALKING_SUPPORTED 1


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


< prev index next >