Mercurial > hg > graal-jvmci-8
comparison src/share/vm/utilities/globalDefinitions.hpp @ 9060:cc32ccaaf47f
8003310: Enable -Wunused-function when compiling with gcc
Summary: Add the -Wunused-function flag and remove a number of unused functions.
Reviewed-by: dholmes, coleenp, kvn
author | mikael |
---|---|
date | Thu, 04 Apr 2013 10:01:26 -0700 |
parents | 203f64878aab |
children | 7a5aec879506 |
comparison
equal
deleted
inserted
replaced
9059:17bf4d428955 | 9060:cc32ccaaf47f |
---|---|
416 // Pad out certain offsets to jlong alignment, in HeapWord units. | 416 // Pad out certain offsets to jlong alignment, in HeapWord units. |
417 | 417 |
418 inline intptr_t align_object_offset(intptr_t offset) { | 418 inline intptr_t align_object_offset(intptr_t offset) { |
419 return align_size_up(offset, HeapWordsPerLong); | 419 return align_size_up(offset, HeapWordsPerLong); |
420 } | 420 } |
421 | |
422 // Clamp an address to be within a specific page | |
423 // 1. If addr is on the page it is returned as is | |
424 // 2. If addr is above the page_address the start of the *next* page will be returned | |
425 // 3. Otherwise, if addr is below the page_address the start of the page will be returned | |
426 inline address clamp_address_in_page(address addr, address page_address, intptr_t page_size) { | |
427 if (align_size_down(intptr_t(addr), page_size) == align_size_down(intptr_t(page_address), page_size)) { | |
428 // address is in the specified page, just return it as is | |
429 return addr; | |
430 } else if (addr > page_address) { | |
431 // address is above specified page, return start of next page | |
432 return (address)align_size_down(intptr_t(page_address), page_size) + page_size; | |
433 } else { | |
434 // address is below specified page, return start of page | |
435 return (address)align_size_down(intptr_t(page_address), page_size); | |
436 } | |
437 } | |
438 | |
421 | 439 |
422 // The expected size in bytes of a cache line, used to pad data structures. | 440 // The expected size in bytes of a cache line, used to pad data structures. |
423 #define DEFAULT_CACHE_LINE_SIZE 64 | 441 #define DEFAULT_CACHE_LINE_SIZE 64 |
424 | 442 |
425 // Bytes needed to pad type to avoid cache-line sharing; alignment should be the | 443 // Bytes needed to pad type to avoid cache-line sharing; alignment should be the |
1294 // specific. | 1312 // specific. |
1295 static inline void* dereference_vptr(void* addr) { | 1313 static inline void* dereference_vptr(void* addr) { |
1296 return *(void**)addr; | 1314 return *(void**)addr; |
1297 } | 1315 } |
1298 | 1316 |
1317 | |
1318 #ifndef PRODUCT | |
1319 | |
1320 // For unit testing only | |
1321 class GlobalDefinitions { | |
1322 public: | |
1323 static void test_globals(); | |
1324 }; | |
1325 | |
1326 #endif // PRODUCT | |
1327 | |
1299 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP | 1328 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP |