--- old/src/share/vm/utilities/globalDefinitions.hpp 2012-11-12 10:52:11.648617572 -0800 +++ new/src/share/vm/utilities/globalDefinitions.hpp 2012-11-12 10:52:11.560618678 -0800 @@ -413,6 +413,13 @@ return align_size_up(offset, HeapWordsPerLong); } +// Clamp an address to be within a specific page +// 1. If addr is on the page it is returned as is +// 2. If addr is above the page_address the start of the *next* page will be returned +// 3. Otherwise, if addr is below the page_address the start of the page will be returned +address clamp_address_in_page(address addr, address page_address); + + // The expected size in bytes of a cache line, used to pad data structures. #define DEFAULT_CACHE_LINE_SIZE 64 @@ -1274,4 +1281,15 @@ #define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0])) + +#ifndef PRODUCT + +// For unit testing only +class GlobalDefinitions { +public: + static void test_globals(); +}; + +#endif // PRODUCT + #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP