hotspot/src/share/vm/memory/cardTableModRefBS.cpp
changeset 18069 e6d4971c8650
parent 17376 4ee999c3c007
child 18073 f02460441ddc
equal deleted inserted replaced
18025:b7bcf7497f93 18069:e6d4971c8650
   108   assert(byte_for(high_bound-1) <= &_byte_map[_last_valid_index], "Checking end of map");
   108   assert(byte_for(high_bound-1) <= &_byte_map[_last_valid_index], "Checking end of map");
   109 
   109 
   110   jbyte* guard_card = &_byte_map[_guard_index];
   110   jbyte* guard_card = &_byte_map[_guard_index];
   111   uintptr_t guard_page = align_size_down((uintptr_t)guard_card, _page_size);
   111   uintptr_t guard_page = align_size_down((uintptr_t)guard_card, _page_size);
   112   _guard_region = MemRegion((HeapWord*)guard_page, _page_size);
   112   _guard_region = MemRegion((HeapWord*)guard_page, _page_size);
   113   if (!os::commit_memory((char*)guard_page, _page_size, _page_size)) {
   113   os::commit_memory_or_exit((char*)guard_page, _page_size, _page_size,
   114     // Do better than this for Merlin
   114                             !ExecMem, "card table last card");
   115     vm_exit_out_of_memory(_page_size, OOM_MMAP_ERROR, "card table last card");
       
   116   }
       
   117 
       
   118   *guard_card = last_card;
   115   *guard_card = last_card;
   119 
   116 
   120    _lowest_non_clean =
   117    _lowest_non_clean =
   121     NEW_C_HEAP_ARRAY(CardArr, max_covered_regions, mtGC);
   118     NEW_C_HEAP_ARRAY(CardArr, max_covered_regions, mtGC);
   122   _lowest_non_clean_chunk_size =
   119   _lowest_non_clean_chunk_size =
   310       // Must commit new pages.
   307       // Must commit new pages.
   311       MemRegion const new_committed =
   308       MemRegion const new_committed =
   312         MemRegion(cur_committed.end(), new_end_for_commit);
   309         MemRegion(cur_committed.end(), new_end_for_commit);
   313 
   310 
   314       assert(!new_committed.is_empty(), "Region should not be empty here");
   311       assert(!new_committed.is_empty(), "Region should not be empty here");
   315       if (!os::commit_memory((char*)new_committed.start(),
   312       os::commit_memory_or_exit((char*)new_committed.start(),
   316                              new_committed.byte_size(), _page_size)) {
   313                                 new_committed.byte_size(), _page_size,
   317         // Do better than this for Merlin
   314                                 !ExecMem, "card table expansion");
   318         vm_exit_out_of_memory(new_committed.byte_size(), OOM_MMAP_ERROR,
       
   319                 "card table expansion");
       
   320       }
       
   321     // Use new_end_aligned (as opposed to new_end_for_commit) because
   315     // Use new_end_aligned (as opposed to new_end_for_commit) because
   322     // the cur_committed region may include the guard region.
   316     // the cur_committed region may include the guard region.
   323     } else if (new_end_aligned < cur_committed.end()) {
   317     } else if (new_end_aligned < cur_committed.end()) {
   324       // Must uncommit pages.
   318       // Must uncommit pages.
   325       MemRegion const uncommit_region =
   319       MemRegion const uncommit_region =