< prev index next >

src/hotspot/share/gc/g1/g1Allocator.inline.hpp

Print this page




  82 }
  83 
  84 inline HeapWord* G1PLABAllocator::allocate(G1HeapRegionAttr dest,
  85                                            size_t word_sz,
  86                                            bool* refill_failed) {
  87   HeapWord* const obj = plab_allocate(dest, word_sz);
  88   if (obj != NULL) {
  89     return obj;
  90   }
  91   return allocate_direct_or_new_plab(dest, word_sz, refill_failed);
  92 }
  93 
  94 // Create the maps which is used to identify archive objects.
  95 inline void G1ArchiveAllocator::enable_archive_object_check() {
  96   if (_archive_check_enabled) {
  97     return;
  98   }
  99 
 100   _archive_check_enabled = true;
 101   size_t length = G1CollectedHeap::heap()->max_reserved_capacity();
 102   _closed_archive_region_map.initialize(G1CollectedHeap::heap()->base(),
 103                                         G1CollectedHeap::heap()->base() + length,
 104                                         HeapRegion::GrainBytes);
 105   _open_archive_region_map.initialize(G1CollectedHeap::heap()->base(),
 106                                       G1CollectedHeap::heap()->base() + length,
 107                                       HeapRegion::GrainBytes);
 108 }
 109 
 110 // Set the regions containing the specified address range as archive.
 111 inline void G1ArchiveAllocator::set_range_archive(MemRegion range, bool open) {
 112   assert(_archive_check_enabled, "archive range check not enabled");
 113   log_info(gc, cds)("Mark %s archive regions in map: [" PTR_FORMAT ", " PTR_FORMAT "]",
 114                      open ? "open" : "closed",
 115                      p2i(range.start()),
 116                      p2i(range.last()));
 117   if (open) {
 118     _open_archive_region_map.set_by_address(range, true);
 119   } else {
 120     _closed_archive_region_map.set_by_address(range, true);
 121   }
 122 }
 123 
 124 // Clear the archive regions map containing the specified address range.
 125 inline void G1ArchiveAllocator::clear_range_archive(MemRegion range, bool open) {
 126   assert(_archive_check_enabled, "archive range check not enabled");




  82 }
  83 
  84 inline HeapWord* G1PLABAllocator::allocate(G1HeapRegionAttr dest,
  85                                            size_t word_sz,
  86                                            bool* refill_failed) {
  87   HeapWord* const obj = plab_allocate(dest, word_sz);
  88   if (obj != NULL) {
  89     return obj;
  90   }
  91   return allocate_direct_or_new_plab(dest, word_sz, refill_failed);
  92 }
  93 
  94 // Create the maps which is used to identify archive objects.
  95 inline void G1ArchiveAllocator::enable_archive_object_check() {
  96   if (_archive_check_enabled) {
  97     return;
  98   }
  99 
 100   _archive_check_enabled = true;
 101   size_t length = G1CollectedHeap::heap()->max_reserved_capacity();
 102   _closed_archive_region_map.initialize((HeapWord*)Universe::heap()->base(),
 103                                         (HeapWord*)Universe::heap()->base() + length,
 104                                         HeapRegion::GrainBytes);
 105   _open_archive_region_map.initialize((HeapWord*)Universe::heap()->base(),
 106                                       (HeapWord*)Universe::heap()->base() + length,
 107                                       HeapRegion::GrainBytes);
 108 }
 109 
 110 // Set the regions containing the specified address range as archive.
 111 inline void G1ArchiveAllocator::set_range_archive(MemRegion range, bool open) {
 112   assert(_archive_check_enabled, "archive range check not enabled");
 113   log_info(gc, cds)("Mark %s archive regions in map: [" PTR_FORMAT ", " PTR_FORMAT "]",
 114                      open ? "open" : "closed",
 115                      p2i(range.start()),
 116                      p2i(range.last()));
 117   if (open) {
 118     _open_archive_region_map.set_by_address(range, true);
 119   } else {
 120     _closed_archive_region_map.set_by_address(range, true);
 121   }
 122 }
 123 
 124 // Clear the archive regions map containing the specified address range.
 125 inline void G1ArchiveAllocator::clear_range_archive(MemRegion range, bool open) {
 126   assert(_archive_check_enabled, "archive range check not enabled");


< prev index next >