< prev index next >

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

Print this page
rev 9088 : 8139040: Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux.


 546 }
 547 
 548 PerRegionTable*
 549 OtherRegionsTable::find_region_table(size_t ind, HeapRegion* hr) const {
 550   assert(ind < _max_fine_entries, "Preconditions.");
 551   PerRegionTable* prt = _fine_grain_regions[ind];
 552   while (prt != NULL && prt->hr() != hr) {
 553     prt = prt->collision_list_next();
 554   }
 555   // Loop postcondition is the method postcondition.
 556   return prt;
 557 }
 558 
 559 jint OtherRegionsTable::_n_coarsenings = 0;
 560 
 561 PerRegionTable* OtherRegionsTable::delete_region_table() {
 562   assert(_m->owned_by_self(), "Precondition");
 563   assert(_n_fine_entries == _max_fine_entries, "Precondition");
 564   PerRegionTable* max = NULL;
 565   jint max_occ = 0;
 566   PerRegionTable** max_prev;
 567   size_t max_ind;
 568 
 569   size_t i = _fine_eviction_start;
 570   for (size_t k = 0; k < _fine_eviction_sample_size; k++) {
 571     size_t ii = i;
 572     // Make sure we get a non-NULL sample.
 573     while (_fine_grain_regions[ii] == NULL) {
 574       ii++;
 575       if (ii == _max_fine_entries) ii = 0;
 576       guarantee(ii != i, "We must find one.");
 577     }
 578     PerRegionTable** prev = &_fine_grain_regions[ii];
 579     PerRegionTable* cur = *prev;
 580     while (cur != NULL) {
 581       jint cur_occ = cur->occupied();
 582       if (max == NULL || cur_occ > max_occ) {
 583         max = cur;
 584         max_prev = prev;
 585         max_ind = i;
 586         max_occ = cur_occ;


1121     _n_recorded_events++;
1122   }
1123 }
1124 
1125 void HeapRegionRemSet::print_event(outputStream* str, Event evnt) {
1126   switch (evnt) {
1127   case Event_EvacStart:
1128     str->print("Evac Start");
1129     break;
1130   case Event_EvacEnd:
1131     str->print("Evac End");
1132     break;
1133   case Event_RSUpdateEnd:
1134     str->print("RS Update End");
1135     break;
1136   }
1137 }
1138 
1139 void HeapRegionRemSet::print_recorded() {
1140   int cur_evnt = 0;
1141   Event cur_evnt_kind;
1142   int cur_evnt_ind = 0;
1143   if (_n_recorded_events > 0) {
1144     cur_evnt_kind = _recorded_events[cur_evnt];
1145     cur_evnt_ind = _recorded_event_index[cur_evnt];
1146   }
1147 
1148   for (int i = 0; i < _n_recorded; i++) {
1149     while (cur_evnt < _n_recorded_events && i == cur_evnt_ind) {
1150       gclog_or_tty->print("Event: ");
1151       print_event(gclog_or_tty, cur_evnt_kind);
1152       gclog_or_tty->cr();
1153       cur_evnt++;
1154       if (cur_evnt < MaxRecordedEvents) {
1155         cur_evnt_kind = _recorded_events[cur_evnt];
1156         cur_evnt_ind = _recorded_event_index[cur_evnt];
1157       }
1158     }
1159     gclog_or_tty->print("Added card " PTR_FORMAT " to region [" PTR_FORMAT "...]"
1160                         " for ref " PTR_FORMAT ".\n",
1161                         p2i(_recorded_cards[i]), p2i(_recorded_regions[i]->bottom()),




 546 }
 547 
 548 PerRegionTable*
 549 OtherRegionsTable::find_region_table(size_t ind, HeapRegion* hr) const {
 550   assert(ind < _max_fine_entries, "Preconditions.");
 551   PerRegionTable* prt = _fine_grain_regions[ind];
 552   while (prt != NULL && prt->hr() != hr) {
 553     prt = prt->collision_list_next();
 554   }
 555   // Loop postcondition is the method postcondition.
 556   return prt;
 557 }
 558 
 559 jint OtherRegionsTable::_n_coarsenings = 0;
 560 
 561 PerRegionTable* OtherRegionsTable::delete_region_table() {
 562   assert(_m->owned_by_self(), "Precondition");
 563   assert(_n_fine_entries == _max_fine_entries, "Precondition");
 564   PerRegionTable* max = NULL;
 565   jint max_occ = 0;
 566   PerRegionTable** max_prev = NULL;
 567   size_t max_ind;
 568 
 569   size_t i = _fine_eviction_start;
 570   for (size_t k = 0; k < _fine_eviction_sample_size; k++) {
 571     size_t ii = i;
 572     // Make sure we get a non-NULL sample.
 573     while (_fine_grain_regions[ii] == NULL) {
 574       ii++;
 575       if (ii == _max_fine_entries) ii = 0;
 576       guarantee(ii != i, "We must find one.");
 577     }
 578     PerRegionTable** prev = &_fine_grain_regions[ii];
 579     PerRegionTable* cur = *prev;
 580     while (cur != NULL) {
 581       jint cur_occ = cur->occupied();
 582       if (max == NULL || cur_occ > max_occ) {
 583         max = cur;
 584         max_prev = prev;
 585         max_ind = i;
 586         max_occ = cur_occ;


1121     _n_recorded_events++;
1122   }
1123 }
1124 
1125 void HeapRegionRemSet::print_event(outputStream* str, Event evnt) {
1126   switch (evnt) {
1127   case Event_EvacStart:
1128     str->print("Evac Start");
1129     break;
1130   case Event_EvacEnd:
1131     str->print("Evac End");
1132     break;
1133   case Event_RSUpdateEnd:
1134     str->print("RS Update End");
1135     break;
1136   }
1137 }
1138 
1139 void HeapRegionRemSet::print_recorded() {
1140   int cur_evnt = 0;
1141   Event cur_evnt_kind = Event_illegal;
1142   int cur_evnt_ind = 0;
1143   if (_n_recorded_events > 0) {
1144     cur_evnt_kind = _recorded_events[cur_evnt];
1145     cur_evnt_ind = _recorded_event_index[cur_evnt];
1146   }
1147 
1148   for (int i = 0; i < _n_recorded; i++) {
1149     while (cur_evnt < _n_recorded_events && i == cur_evnt_ind) {
1150       gclog_or_tty->print("Event: ");
1151       print_event(gclog_or_tty, cur_evnt_kind);
1152       gclog_or_tty->cr();
1153       cur_evnt++;
1154       if (cur_evnt < MaxRecordedEvents) {
1155         cur_evnt_kind = _recorded_events[cur_evnt];
1156         cur_evnt_ind = _recorded_event_index[cur_evnt];
1157       }
1158     }
1159     gclog_or_tty->print("Added card " PTR_FORMAT " to region [" PTR_FORMAT "...]"
1160                         " for ref " PTR_FORMAT ".\n",
1161                         p2i(_recorded_cards[i]), p2i(_recorded_regions[i]->bottom()),


< prev index next >