Mercurial > hg > graal-jvmci-8
comparison src/share/vm/utilities/globalDefinitions.cpp @ 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 | 8e47bac5643a |
children | de6a9e811145 |
comparison
equal
deleted
inserted
replaced
9059:17bf4d428955 | 9060:cc32ccaaf47f |
---|---|
353 julong result = julong(a) * b / div; | 353 julong result = julong(a) * b / div; |
354 assert(result <= (size_t)max_uintx, "Integer overflow in lcm"); | 354 assert(result <= (size_t)max_uintx, "Integer overflow in lcm"); |
355 | 355 |
356 return size_t(result); | 356 return size_t(result); |
357 } | 357 } |
358 | |
359 #ifndef PRODUCT | |
360 | |
361 void GlobalDefinitions::test_globals() { | |
362 intptr_t page_sizes[] = { os::vm_page_size(), 4096, 8192, 65536, 2*1024*1024 }; | |
363 const int num_page_sizes = sizeof(page_sizes) / sizeof(page_sizes[0]); | |
364 | |
365 for (int i = 0; i < num_page_sizes; i++) { | |
366 intptr_t page_size = page_sizes[i]; | |
367 | |
368 address a_page = (address)(10*page_size); | |
369 | |
370 // Check that address within page is returned as is | |
371 assert(clamp_address_in_page(a_page, a_page, page_size) == a_page, "incorrect"); | |
372 assert(clamp_address_in_page(a_page + 128, a_page, page_size) == a_page + 128, "incorrect"); | |
373 assert(clamp_address_in_page(a_page + page_size - 1, a_page, page_size) == a_page + page_size - 1, "incorrect"); | |
374 | |
375 // Check that address above page returns start of next page | |
376 assert(clamp_address_in_page(a_page + page_size, a_page, page_size) == a_page + page_size, "incorrect"); | |
377 assert(clamp_address_in_page(a_page + page_size + 1, a_page, page_size) == a_page + page_size, "incorrect"); | |
378 assert(clamp_address_in_page(a_page + page_size*5 + 1, a_page, page_size) == a_page + page_size, "incorrect"); | |
379 | |
380 // Check that address below page returns start of page | |
381 assert(clamp_address_in_page(a_page - 1, a_page, page_size) == a_page, "incorrect"); | |
382 assert(clamp_address_in_page(a_page - 2*page_size - 1, a_page, page_size) == a_page, "incorrect"); | |
383 assert(clamp_address_in_page(a_page - 5*page_size - 1, a_page, page_size) == a_page, "incorrect"); | |
384 } | |
385 } | |
386 | |
387 #endif // PRODUCT |