< prev index next >

src/hotspot/share/code/codeCache.cpp

Print this page
rev 50428 : 8203030: Zero s390 31 bit size_t type conflicts in shared code
Summary: Cast to size_t or change to size_t foe compatibility with other archs.
Reviewed-by: Duke
Contributed-by: chrisphi


 392   }
 393   if (code_blob_type_accepts_nmethod(type)) {
 394     _nmethod_heaps->insert_sorted<code_heap_compare>(heap);
 395   }
 396   if (code_blob_type_accepts_allocable(type)) {
 397     _allocable_heaps->insert_sorted<code_heap_compare>(heap);
 398   }
 399 }
 400 
 401 void CodeCache::add_heap(ReservedSpace rs, const char* name, int code_blob_type) {
 402   // Check if heap is needed
 403   if (!heap_available(code_blob_type)) {
 404     return;
 405   }
 406 
 407   // Create CodeHeap
 408   CodeHeap* heap = new CodeHeap(name, code_blob_type);
 409   add_heap(heap);
 410 
 411   // Reserve Space
 412   size_t size_initial = MIN2(InitialCodeCacheSize, rs.size());
 413   size_initial = align_up(size_initial, os::vm_page_size());
 414   if (!heap->reserve(rs, size_initial, CodeCacheSegmentSize)) {
 415     vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (" SIZE_FORMAT "K)",
 416                                           heap->name(), size_initial/K));
 417   }
 418 
 419   // Register the CodeHeap
 420   MemoryService::add_code_heap_memory_pool(heap, name);
 421 }
 422 
 423 CodeHeap* CodeCache::get_code_heap_containing(void* start) {
 424   FOR_ALL_HEAPS(heap) {
 425     if ((*heap)->contains(start)) {
 426       return *heap;
 427     }
 428   }
 429   return NULL;
 430 }
 431 
 432 CodeHeap* CodeCache::get_code_heap(const CodeBlob* cb) {




 392   }
 393   if (code_blob_type_accepts_nmethod(type)) {
 394     _nmethod_heaps->insert_sorted<code_heap_compare>(heap);
 395   }
 396   if (code_blob_type_accepts_allocable(type)) {
 397     _allocable_heaps->insert_sorted<code_heap_compare>(heap);
 398   }
 399 }
 400 
 401 void CodeCache::add_heap(ReservedSpace rs, const char* name, int code_blob_type) {
 402   // Check if heap is needed
 403   if (!heap_available(code_blob_type)) {
 404     return;
 405   }
 406 
 407   // Create CodeHeap
 408   CodeHeap* heap = new CodeHeap(name, code_blob_type);
 409   add_heap(heap);
 410 
 411   // Reserve Space
 412   size_t size_initial = MIN2((size_t)InitialCodeCacheSize, rs.size());
 413   size_initial = align_up(size_initial, os::vm_page_size());
 414   if (!heap->reserve(rs, size_initial, CodeCacheSegmentSize)) {
 415     vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (" SIZE_FORMAT "K)",
 416                                           heap->name(), size_initial/K));
 417   }
 418 
 419   // Register the CodeHeap
 420   MemoryService::add_code_heap_memory_pool(heap, name);
 421 }
 422 
 423 CodeHeap* CodeCache::get_code_heap_containing(void* start) {
 424   FOR_ALL_HEAPS(heap) {
 425     if ((*heap)->contains(start)) {
 426       return *heap;
 427     }
 428   }
 429   return NULL;
 430 }
 431 
 432 CodeHeap* CodeCache::get_code_heap(const CodeBlob* cb) {


< prev index next >