< prev index next >

src/share/vm/gc/g1/g1ParScanThreadState.cpp

Print this page
rev 9080 : imported patch move-code
rev 9081 : imported patch rootclosureset
rev 9083 : imported patch erik-review


  54   // an attempt to eliminate cache contention
  55   size_t real_length = 1 + young_cset_length;
  56   size_t array_length = PADDING_ELEM_NUM +
  57                       real_length +
  58                       PADDING_ELEM_NUM;
  59   _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
  60   if (_surviving_young_words_base == NULL)
  61     vm_exit_out_of_memory(array_length * sizeof(size_t), OOM_MALLOC_ERROR,
  62                           "Not enough space for young surv histo.");
  63   _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM;
  64   memset(_surviving_young_words, 0, real_length * sizeof(size_t));
  65 
  66   _plab_allocator = G1PLABAllocator::create_allocator(_g1h->allocator());
  67 
  68   _dest[InCSetState::NotInCSet]    = InCSetState::NotInCSet;
  69   // The dest for Young is used when the objects are aged enough to
  70   // need to be moved to the next space.
  71   _dest[InCSetState::Young]        = InCSetState::Old;
  72   _dest[InCSetState::Old]          = InCSetState::Old;
  73 
  74   _closures = new_root_closure_set();
  75 }
  76 
  77 G1EvacuationRootClosureSet* G1ParScanThreadState::new_root_closure_set() {
  78   if (_g1h->collector_state()->during_initial_mark_pause()) {
  79     if (ClassUnloadingWithConcurrentMark) {
  80       return new G1InitalMarkClosures<G1MarkPromotedFromRoot>(_g1h, this);
  81     } else {
  82       return new G1InitalMarkClosures<G1MarkFromRoot>(_g1h, this);
  83     }
  84   } else {
  85     return new G1EvacuationClosures(_g1h, this, _g1h->collector_state()->gcs_are_young());
  86   }
  87 }
  88 
  89 // Pass locally gathered statistics to global state.
  90 void G1ParScanThreadState::flush(size_t* surviving_young_words) {
  91   _dcq.flush();
  92   // Update allocation statistics.
  93   _plab_allocator->flush_and_retire_stats();
  94   _g1h->g1_policy()->record_age_table(&_age_table);
  95 
  96   uint length = _g1h->g1_policy()->young_cset_region_length();
  97   for (uint region_index = 0; region_index < length; region_index++) {




  54   // an attempt to eliminate cache contention
  55   size_t real_length = 1 + young_cset_length;
  56   size_t array_length = PADDING_ELEM_NUM +
  57                       real_length +
  58                       PADDING_ELEM_NUM;
  59   _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
  60   if (_surviving_young_words_base == NULL)
  61     vm_exit_out_of_memory(array_length * sizeof(size_t), OOM_MALLOC_ERROR,
  62                           "Not enough space for young surv histo.");
  63   _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM;
  64   memset(_surviving_young_words, 0, real_length * sizeof(size_t));
  65 
  66   _plab_allocator = G1PLABAllocator::create_allocator(_g1h->allocator());
  67 
  68   _dest[InCSetState::NotInCSet]    = InCSetState::NotInCSet;
  69   // The dest for Young is used when the objects are aged enough to
  70   // need to be moved to the next space.
  71   _dest[InCSetState::Young]        = InCSetState::Old;
  72   _dest[InCSetState::Old]          = InCSetState::Old;
  73 
  74   _closures = new_root_closures();
  75 }
  76 
  77 G1EvacuationRootClosures* G1ParScanThreadState::new_root_closures() {
  78   if (_g1h->collector_state()->during_initial_mark_pause()) {
  79     if (ClassUnloadingWithConcurrentMark) {
  80       return new G1InitalMarkClosures<G1MarkPromotedFromRoot>(_g1h, this);
  81     } else {
  82       return new G1InitalMarkClosures<G1MarkFromRoot>(_g1h, this);
  83     }
  84   } else {
  85     return new G1EvacuationClosures(_g1h, this, _g1h->collector_state()->gcs_are_young());
  86   }
  87 }
  88 
  89 // Pass locally gathered statistics to global state.
  90 void G1ParScanThreadState::flush(size_t* surviving_young_words) {
  91   _dcq.flush();
  92   // Update allocation statistics.
  93   _plab_allocator->flush_and_retire_stats();
  94   _g1h->g1_policy()->record_age_table(&_age_table);
  95 
  96   uint length = _g1h->g1_policy()->young_cset_region_length();
  97   for (uint region_index = 0; region_index < length; region_index++) {


< prev index next >