hotspot/src/share/vm/gc_interface/collectedHeap.cpp
changeset 12229 c34a85c8f5aa
parent 11788 bef6166c683c
child 12236 51d6463cfd9d
equal deleted inserted replaced
12228:15ffdb8224fe 12229:c34a85c8f5aa
    83 
    83 
    84 {
    84 {
    85   const size_t max_len = size_t(arrayOopDesc::max_array_length(T_INT));
    85   const size_t max_len = size_t(arrayOopDesc::max_array_length(T_INT));
    86   const size_t elements_per_word = HeapWordSize / sizeof(jint);
    86   const size_t elements_per_word = HeapWordSize / sizeof(jint);
    87   _filler_array_max_size = align_object_size(filler_array_hdr_size() +
    87   _filler_array_max_size = align_object_size(filler_array_hdr_size() +
    88                                              max_len * elements_per_word);
    88                                              max_len / elements_per_word);
    89 
    89 
    90   _barrier_set = NULL;
    90   _barrier_set = NULL;
    91   _is_gc_active = false;
    91   _is_gc_active = false;
    92   _total_collections = _total_full_collections = 0;
    92   _total_collections = _total_full_collections = 0;
    93   _gc_cause = _gc_lastcause = GCCause::_no_gc;
    93   _gc_cause = _gc_lastcause = GCCause::_no_gc;
   301 
   301 
   302 size_t CollectedHeap::filler_array_min_size() {
   302 size_t CollectedHeap::filler_array_min_size() {
   303   return align_object_size(filler_array_hdr_size()); // align to MinObjAlignment
   303   return align_object_size(filler_array_hdr_size()); // align to MinObjAlignment
   304 }
   304 }
   305 
   305 
   306 size_t CollectedHeap::filler_array_max_size() {
       
   307   return _filler_array_max_size;
       
   308 }
       
   309 
       
   310 #ifdef ASSERT
   306 #ifdef ASSERT
   311 void CollectedHeap::fill_args_check(HeapWord* start, size_t words)
   307 void CollectedHeap::fill_args_check(HeapWord* start, size_t words)
   312 {
   308 {
   313   assert(words >= min_fill_size(), "too small to fill");
   309   assert(words >= min_fill_size(), "too small to fill");
   314   assert(words % MinObjAlignment == 0, "unaligned size");
   310   assert(words % MinObjAlignment == 0, "unaligned size");
   331   assert(words >= filler_array_min_size(), "too small for an array");
   327   assert(words >= filler_array_min_size(), "too small for an array");
   332   assert(words <= filler_array_max_size(), "too big for a single object");
   328   assert(words <= filler_array_max_size(), "too big for a single object");
   333 
   329 
   334   const size_t payload_size = words - filler_array_hdr_size();
   330   const size_t payload_size = words - filler_array_hdr_size();
   335   const size_t len = payload_size * HeapWordSize / sizeof(jint);
   331   const size_t len = payload_size * HeapWordSize / sizeof(jint);
       
   332   assert((int)len >= 0, err_msg("size too large " SIZE_FORMAT " becomes %d", words, (int)len));
   336 
   333 
   337   // Set the length first for concurrent GC.
   334   // Set the length first for concurrent GC.
   338   ((arrayOop)start)->set_length((int)len);
   335   ((arrayOop)start)->set_length((int)len);
   339   post_allocation_setup_common(Universe::intArrayKlassObj(), start, words);
   336   post_allocation_setup_common(Universe::intArrayKlassObj(), start, words);
   340   DEBUG_ONLY(zap_filler_array(start, words, zap);)
   337   DEBUG_ONLY(zap_filler_array(start, words, zap);)