< prev index next >

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

Print this page
rev 49524 : imported patch 8200426-g1h-refactoring


  30 #include "gc/g1/g1CollectorState.hpp"
  31 #include "gc/g1/g1ConcurrentMark.inline.hpp"
  32 #include "gc/g1/heapRegionManager.inline.hpp"
  33 #include "gc/g1/heapRegionSet.inline.hpp"
  34 #include "gc/shared/taskqueue.hpp"
  35 #include "runtime/orderAccess.inline.hpp"
  36 
  37 G1EvacStats* G1CollectedHeap::alloc_buffer_stats(InCSetState dest) {
  38   switch (dest.value()) {
  39     case InCSetState::Young:
  40       return &_survivor_evac_stats;
  41     case InCSetState::Old:
  42       return &_old_evac_stats;
  43     default:
  44       ShouldNotReachHere();
  45       return NULL; // Keep some compilers happy
  46   }
  47 }
  48 
  49 size_t G1CollectedHeap::desired_plab_sz(InCSetState dest) {
  50   size_t gclab_word_size = alloc_buffer_stats(dest)->desired_plab_sz(G1CollectedHeap::heap()->workers()->active_workers());
  51   // Prevent humongous PLAB sizes for two reasons:
  52   // * PLABs are allocated using a similar paths as oops, but should
  53   //   never be in a humongous region
  54   // * Allowing humongous PLABs needlessly churns the region free lists
  55   return MIN2(_humongous_object_threshold_in_words, gclab_word_size);
  56 }
  57 
  58 // Inline functions for G1CollectedHeap
  59 
  60 // Return the region with the given index. It assumes the index is valid.
  61 inline HeapRegion* G1CollectedHeap::region_at(uint index) const { return _hrm.at(index); }
  62 
  63 inline HeapRegion* G1CollectedHeap::next_region_in_humongous(HeapRegion* hr) const {
  64   return _hrm.next_region_in_humongous(hr);
  65 }
  66 
  67 inline uint G1CollectedHeap::addr_to_region(HeapWord* addr) const {
  68   assert(is_in_reserved(addr),
  69          "Cannot calculate region index for address " PTR_FORMAT " that is outside of the heap [" PTR_FORMAT ", " PTR_FORMAT ")",
  70          p2i(addr), p2i(reserved_region().start()), p2i(reserved_region().end()));




  30 #include "gc/g1/g1CollectorState.hpp"
  31 #include "gc/g1/g1ConcurrentMark.inline.hpp"
  32 #include "gc/g1/heapRegionManager.inline.hpp"
  33 #include "gc/g1/heapRegionSet.inline.hpp"
  34 #include "gc/shared/taskqueue.hpp"
  35 #include "runtime/orderAccess.inline.hpp"
  36 
  37 G1EvacStats* G1CollectedHeap::alloc_buffer_stats(InCSetState dest) {
  38   switch (dest.value()) {
  39     case InCSetState::Young:
  40       return &_survivor_evac_stats;
  41     case InCSetState::Old:
  42       return &_old_evac_stats;
  43     default:
  44       ShouldNotReachHere();
  45       return NULL; // Keep some compilers happy
  46   }
  47 }
  48 
  49 size_t G1CollectedHeap::desired_plab_sz(InCSetState dest) {
  50   size_t gclab_word_size = alloc_buffer_stats(dest)->desired_plab_sz(workers()->active_workers());
  51   // Prevent humongous PLAB sizes for two reasons:
  52   // * PLABs are allocated using a similar paths as oops, but should
  53   //   never be in a humongous region
  54   // * Allowing humongous PLABs needlessly churns the region free lists
  55   return MIN2(_humongous_object_threshold_in_words, gclab_word_size);
  56 }
  57 
  58 // Inline functions for G1CollectedHeap
  59 
  60 // Return the region with the given index. It assumes the index is valid.
  61 inline HeapRegion* G1CollectedHeap::region_at(uint index) const { return _hrm.at(index); }
  62 
  63 inline HeapRegion* G1CollectedHeap::next_region_in_humongous(HeapRegion* hr) const {
  64   return _hrm.next_region_in_humongous(hr);
  65 }
  66 
  67 inline uint G1CollectedHeap::addr_to_region(HeapWord* addr) const {
  68   assert(is_in_reserved(addr),
  69          "Cannot calculate region index for address " PTR_FORMAT " that is outside of the heap [" PTR_FORMAT ", " PTR_FORMAT ")",
  70          p2i(addr), p2i(reserved_region().start()), p2i(reserved_region().end()));


< prev index next >