< prev index next >

src/hotspot/share/gc/parallel/asPSYoungGen.cpp

Print this page
rev 58017 : [mq]: 8238854-remove-superfluous-alloc-checks


  43 
  44 
  45 ASPSYoungGen::ASPSYoungGen(PSVirtualSpace* vs,
  46                            size_t init_byte_size,
  47                            size_t minimum_byte_size,
  48                            size_t byte_size_limit) :
  49   //PSYoungGen(init_byte_size, minimum_byte_size, byte_size_limit),
  50   PSYoungGen(vs->committed_size(), minimum_byte_size, byte_size_limit),
  51   _gen_size_limit(byte_size_limit) {
  52 
  53   assert(vs->committed_size() == init_byte_size, "Cannot replace with");
  54 
  55   _virtual_space = vs;
  56 }
  57 
  58 void ASPSYoungGen::initialize_virtual_space(ReservedSpace rs,
  59                                             size_t alignment) {
  60   assert(_init_gen_size != 0, "Should have a finite size");
  61   _virtual_space = new PSVirtualSpaceHighToLow(rs, alignment);
  62   if (!_virtual_space->expand_by(_init_gen_size)) {
  63     vm_exit_during_initialization("Could not reserve enough space for "
  64                                   "object heap");
  65   }
  66 }
  67 
  68 void ASPSYoungGen::initialize(ReservedSpace rs, size_t alignment) {
  69   initialize_virtual_space(rs, alignment);
  70   initialize_work();
  71 }
  72 
  73 size_t ASPSYoungGen::available_for_expansion() {
  74   size_t current_committed_size = virtual_space()->committed_size();
  75   assert((gen_size_limit() >= current_committed_size),
  76     "generation size limit is wrong");
  77 
  78   size_t result =  gen_size_limit() - current_committed_size;
  79   size_t result_aligned = align_down(result, GenAlignment);
  80   return result_aligned;
  81 }
  82 
  83 // Return the number of bytes the young gen is willing give up.
  84 //




  43 
  44 
  45 ASPSYoungGen::ASPSYoungGen(PSVirtualSpace* vs,
  46                            size_t init_byte_size,
  47                            size_t minimum_byte_size,
  48                            size_t byte_size_limit) :
  49   //PSYoungGen(init_byte_size, minimum_byte_size, byte_size_limit),
  50   PSYoungGen(vs->committed_size(), minimum_byte_size, byte_size_limit),
  51   _gen_size_limit(byte_size_limit) {
  52 
  53   assert(vs->committed_size() == init_byte_size, "Cannot replace with");
  54 
  55   _virtual_space = vs;
  56 }
  57 
  58 void ASPSYoungGen::initialize_virtual_space(ReservedSpace rs,
  59                                             size_t alignment) {
  60   assert(_init_gen_size != 0, "Should have a finite size");
  61   _virtual_space = new PSVirtualSpaceHighToLow(rs, alignment);
  62   if (!_virtual_space->expand_by(_init_gen_size)) {
  63     vm_exit_during_initialization("Could not reserve enough space for object heap");

  64   }
  65 }
  66 
  67 void ASPSYoungGen::initialize(ReservedSpace rs, size_t alignment) {
  68   initialize_virtual_space(rs, alignment);
  69   initialize_work();
  70 }
  71 
  72 size_t ASPSYoungGen::available_for_expansion() {
  73   size_t current_committed_size = virtual_space()->committed_size();
  74   assert((gen_size_limit() >= current_committed_size),
  75     "generation size limit is wrong");
  76 
  77   size_t result =  gen_size_limit() - current_committed_size;
  78   size_t result_aligned = align_down(result, GenAlignment);
  79   return result_aligned;
  80 }
  81 
  82 // Return the number of bytes the young gen is willing give up.
  83 //


< prev index next >