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