221 static bool stack_shadow_pages_available(Thread *thread, methodHandle method); 222 223 // OS interface to Virtual Memory 224 225 // Return the default page size. 226 static int vm_page_size(); 227 228 // Return the page size to use for a region of memory. The min_pages argument 229 // is a hint intended to limit fragmentation; it says the returned page size 230 // should be <= region_max_size / min_pages. Because min_pages is a hint, 231 // this routine may return a size larger than region_max_size / min_pages. 232 // 233 // The current implementation ignores min_pages if a larger page size is an 234 // exact multiple of both region_min_size and region_max_size. This allows 235 // larger pages to be used when doing so would not cause fragmentation; in 236 // particular, a single page can be used when region_min_size == 237 // region_max_size == a supported page size. 238 static size_t page_size_for_region(size_t region_min_size, 239 size_t region_max_size, 240 uint min_pages); 241 242 // Methods for tracing page sizes returned by the above method; enabled by 243 // TracePageSizes. The region_{min,max}_size parameters should be the values 244 // passed to page_size_for_region() and page_size should be the result of that 245 // call. The (optional) base and size parameters should come from the 246 // ReservedSpace base() and size() methods. 247 static void trace_page_sizes(const char* str, const size_t* page_sizes, 248 int count) PRODUCT_RETURN; 249 static void trace_page_sizes(const char* str, const size_t region_min_size, 250 const size_t region_max_size, 251 const size_t page_size, 252 const char* base = NULL, 253 const size_t size = 0) PRODUCT_RETURN; 254 255 static int vm_allocation_granularity(); 256 static char* reserve_memory(size_t bytes, char* addr = 0, 257 size_t alignment_hint = 0); 258 static char* reserve_memory(size_t bytes, char* addr, 259 size_t alignment_hint, MEMFLAGS flags); 260 static char* reserve_memory_aligned(size_t size, size_t alignment); | 221 static bool stack_shadow_pages_available(Thread *thread, methodHandle method); 222 223 // OS interface to Virtual Memory 224 225 // Return the default page size. 226 static int vm_page_size(); 227 228 // Return the page size to use for a region of memory. The min_pages argument 229 // is a hint intended to limit fragmentation; it says the returned page size 230 // should be <= region_max_size / min_pages. Because min_pages is a hint, 231 // this routine may return a size larger than region_max_size / min_pages. 232 // 233 // The current implementation ignores min_pages if a larger page size is an 234 // exact multiple of both region_min_size and region_max_size. This allows 235 // larger pages to be used when doing so would not cause fragmentation; in 236 // particular, a single page can be used when region_min_size == 237 // region_max_size == a supported page size. 238 static size_t page_size_for_region(size_t region_min_size, 239 size_t region_max_size, 240 uint min_pages); 241 // return the largest page size used 242 static size_t max_page_size() { 243 // the _page_sizes array is sorted in descending order. 244 return _page_sizes[0]; 245 } 246 247 // Methods for tracing page sizes returned by the above method; enabled by 248 // TracePageSizes. The region_{min,max}_size parameters should be the values 249 // passed to page_size_for_region() and page_size should be the result of that 250 // call. The (optional) base and size parameters should come from the 251 // ReservedSpace base() and size() methods. 252 static void trace_page_sizes(const char* str, const size_t* page_sizes, 253 int count) PRODUCT_RETURN; 254 static void trace_page_sizes(const char* str, const size_t region_min_size, 255 const size_t region_max_size, 256 const size_t page_size, 257 const char* base = NULL, 258 const size_t size = 0) PRODUCT_RETURN; 259 260 static int vm_allocation_granularity(); 261 static char* reserve_memory(size_t bytes, char* addr = 0, 262 size_t alignment_hint = 0); 263 static char* reserve_memory(size_t bytes, char* addr, 264 size_t alignment_hint, MEMFLAGS flags); 265 static char* reserve_memory_aligned(size_t size, size_t alignment); |