src/share/vm/utilities/globalDefinitions.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hsx-rt.8007074 Sdiff src/share/vm/utilities

src/share/vm/utilities/globalDefinitions.hpp

Print this page




 385 /*
 386  * If a platform does not support native stack walking
 387  * the platform specific globalDefinitions (above)
 388  * can set PLATFORM_NATIVE_STACK_WALKING_SUPPORTED to 0
 389  */
 390 #ifndef PLATFORM_NATIVE_STACK_WALKING_SUPPORTED
 391 #define PLATFORM_NATIVE_STACK_WALKING_SUPPORTED 1
 392 #endif
 393 
 394 // The byte alignment to be used by Arena::Amalloc.  See bugid 4169348.
 395 // Note: this value must be a power of 2
 396 
 397 #define ARENA_AMALLOC_ALIGNMENT (2*BytesPerWord)
 398 
 399 // Signed variants of alignment helpers.  There are two versions of each, a macro
 400 // for use in places like enum definitions that require compile-time constant
 401 // expressions and a function for all other places so as to get type checking.
 402 
 403 #define align_size_up_(size, alignment) (((size) + ((alignment) - 1)) & ~((alignment) - 1))
 404 








 405 inline intptr_t align_size_up(intptr_t size, intptr_t alignment) {
 406   return align_size_up_(size, alignment);
 407 }
 408 
 409 #define align_size_down_(size, alignment) ((size) & ~((alignment) - 1))
 410 
 411 inline intptr_t align_size_down(intptr_t size, intptr_t alignment) {
 412   return align_size_down_(size, alignment);
 413 }
 414 
 415 #define is_size_aligned_(size, alignment) ((size) == (align_size_up_(size, alignment)))








 416 
 417 // Align objects by rounding up their size, in HeapWord units.
 418 
 419 #define align_object_size_(size) align_size_up_(size, MinObjAlignment)
 420 
 421 inline intptr_t align_object_size(intptr_t size) {
 422   return align_size_up(size, MinObjAlignment);
 423 }
 424 
 425 inline bool is_object_aligned(intptr_t addr) {
 426   return addr == align_object_size(addr);
 427 }
 428 
 429 // Pad out certain offsets to jlong alignment, in HeapWord units.
 430 
 431 inline intptr_t align_object_offset(intptr_t offset) {
 432   return align_size_up(offset, HeapWordsPerLong);
 433 }
 434 
 435 inline void* align_pointer_up(const void* addr, size_t size) {




 385 /*
 386  * If a platform does not support native stack walking
 387  * the platform specific globalDefinitions (above)
 388  * can set PLATFORM_NATIVE_STACK_WALKING_SUPPORTED to 0
 389  */
 390 #ifndef PLATFORM_NATIVE_STACK_WALKING_SUPPORTED
 391 #define PLATFORM_NATIVE_STACK_WALKING_SUPPORTED 1
 392 #endif
 393 
 394 // The byte alignment to be used by Arena::Amalloc.  See bugid 4169348.
 395 // Note: this value must be a power of 2
 396 
 397 #define ARENA_AMALLOC_ALIGNMENT (2*BytesPerWord)
 398 
 399 // Signed variants of alignment helpers.  There are two versions of each, a macro
 400 // for use in places like enum definitions that require compile-time constant
 401 // expressions and a function for all other places so as to get type checking.
 402 
 403 #define align_size_up_(size, alignment) (((size) + ((alignment) - 1)) & ~((alignment) - 1))
 404 
 405 inline bool is_size_aligned(size_t size, size_t alignment) {
 406   return align_size_up_(size, alignment) == size;
 407 }
 408 
 409 inline bool is_ptr_aligned(void* ptr, size_t alignment) {
 410   return align_size_up_((intptr_t)ptr, (intptr_t)alignment) == (intptr_t)ptr;
 411 }
 412 
 413 inline intptr_t align_size_up(intptr_t size, intptr_t alignment) {
 414   return align_size_up_(size, alignment);
 415 }
 416 
 417 #define align_size_down_(size, alignment) ((size) & ~((alignment) - 1))
 418 
 419 inline intptr_t align_size_down(intptr_t size, intptr_t alignment) {
 420   return align_size_down_(size, alignment);
 421 }
 422 
 423 #define is_size_aligned_(size, alignment) ((size) == (align_size_up_(size, alignment)))
 424 
 425 inline void* align_ptr_up(void* ptr, size_t alignment) {
 426   return (void*)align_size_up((intptr_t)ptr, (intptr_t)alignment);
 427 }
 428 
 429 inline void* align_ptr_down(void* ptr, size_t alignment) {
 430   return (void*)align_size_down((intptr_t)ptr, (intptr_t)alignment);
 431 }
 432 
 433 // Align objects by rounding up their size, in HeapWord units.
 434 
 435 #define align_object_size_(size) align_size_up_(size, MinObjAlignment)
 436 
 437 inline intptr_t align_object_size(intptr_t size) {
 438   return align_size_up(size, MinObjAlignment);
 439 }
 440 
 441 inline bool is_object_aligned(intptr_t addr) {
 442   return addr == align_object_size(addr);
 443 }
 444 
 445 // Pad out certain offsets to jlong alignment, in HeapWord units.
 446 
 447 inline intptr_t align_object_offset(intptr_t offset) {
 448   return align_size_up(offset, HeapWordsPerLong);
 449 }
 450 
 451 inline void* align_pointer_up(const void* addr, size_t size) {


src/share/vm/utilities/globalDefinitions.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File