comparison src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp @ 3986:65a8ff39a6da

7095194: G1: HeapRegion::GrainBytes, GrainWords, and CardsPerRegion should be size_t Summary: Declare GrainBytes, GrainWords, and CardsPerRegion as size_t. Reviewed-by: jcoomes, tonyp, jmasa
author johnc
date Wed, 05 Oct 2011 08:44:10 -0700
parents f44782f04dd4
children 5e5d4821bf07
comparison
equal deleted inserted replaced
3985:c63b928b212b 3986:65a8ff39a6da
146 if (loc_hr->is_in_reserved(from)) { 146 if (loc_hr->is_in_reserved(from)) {
147 size_t hw_offset = pointer_delta((HeapWord*)from, loc_hr->bottom()); 147 size_t hw_offset = pointer_delta((HeapWord*)from, loc_hr->bottom());
148 CardIdx_t from_card = (CardIdx_t) 148 CardIdx_t from_card = (CardIdx_t)
149 hw_offset >> (CardTableModRefBS::card_shift - LogHeapWordSize); 149 hw_offset >> (CardTableModRefBS::card_shift - LogHeapWordSize);
150 150
151 assert(0 <= from_card && from_card < HeapRegion::CardsPerRegion, 151 assert(0 <= from_card && (size_t)from_card < HeapRegion::CardsPerRegion,
152 "Must be in range."); 152 "Must be in range.");
153 add_card_work(from_card, par); 153 add_card_work(from_card, par);
154 } 154 }
155 } 155 }
156 156
637 637
638 uintptr_t from_hr_bot_card_index = 638 uintptr_t from_hr_bot_card_index =
639 uintptr_t(from_hr->bottom()) 639 uintptr_t(from_hr->bottom())
640 >> CardTableModRefBS::card_shift; 640 >> CardTableModRefBS::card_shift;
641 CardIdx_t card_index = from_card - from_hr_bot_card_index; 641 CardIdx_t card_index = from_card - from_hr_bot_card_index;
642 assert(0 <= card_index && card_index < HeapRegion::CardsPerRegion, 642 assert(0 <= card_index && (size_t)card_index < HeapRegion::CardsPerRegion,
643 "Must be in range."); 643 "Must be in range.");
644 if (G1HRRSUseSparseTable && 644 if (G1HRRSUseSparseTable &&
645 _sparse_table.add_card(from_hrs_ind, card_index)) { 645 _sparse_table.add_card(from_hrs_ind, card_index)) {
646 if (G1RecordHRRSOops) { 646 if (G1RecordHRRSOops) {
647 HeapRegionRemSet::record(hr(), from); 647 HeapRegionRemSet::record(hr(), from);
1064 (uintptr_t(from) >> CardTableModRefBS::card_shift); 1064 (uintptr_t(from) >> CardTableModRefBS::card_shift);
1065 uintptr_t hr_bot_card_index = 1065 uintptr_t hr_bot_card_index =
1066 uintptr_t(hr->bottom()) >> CardTableModRefBS::card_shift; 1066 uintptr_t(hr->bottom()) >> CardTableModRefBS::card_shift;
1067 assert(from_card >= hr_bot_card_index, "Inv"); 1067 assert(from_card >= hr_bot_card_index, "Inv");
1068 CardIdx_t card_index = from_card - hr_bot_card_index; 1068 CardIdx_t card_index = from_card - hr_bot_card_index;
1069 assert(0 <= card_index && card_index < HeapRegion::CardsPerRegion, 1069 assert(0 <= card_index && (size_t)card_index < HeapRegion::CardsPerRegion,
1070 "Must be in range."); 1070 "Must be in range.");
1071 return _sparse_table.contains_card(hr_ind, card_index); 1071 return _sparse_table.contains_card(hr_ind, card_index);
1072 } 1072 }
1073 1073
1074 1074
1189 _bosa = _hrrs->bosa(); 1189 _bosa = _hrrs->bosa();
1190 1190
1191 _is = Sparse; 1191 _is = Sparse;
1192 // Set these values so that we increment to the first region. 1192 // Set these values so that we increment to the first region.
1193 _coarse_cur_region_index = -1; 1193 _coarse_cur_region_index = -1;
1194 _coarse_cur_region_cur_card = (HeapRegion::CardsPerRegion-1);; 1194 _coarse_cur_region_cur_card = (HeapRegion::CardsPerRegion-1);
1195 1195
1196 _cur_region_cur_card = 0; 1196 _cur_region_cur_card = 0;
1197 1197
1198 _fine_array_index = -1; 1198 _fine_array_index = -1;
1199 _fine_cur_prt = NULL; 1199 _fine_cur_prt = NULL;
1268 } 1268 }
1269 1269
1270 bool HeapRegionRemSetIterator::fine_has_next() { 1270 bool HeapRegionRemSetIterator::fine_has_next() {
1271 return 1271 return
1272 _fine_cur_prt != NULL && 1272 _fine_cur_prt != NULL &&
1273 _cur_region_cur_card < (size_t) HeapRegion::CardsPerRegion; 1273 _cur_region_cur_card < HeapRegion::CardsPerRegion;
1274 } 1274 }
1275 1275
1276 bool HeapRegionRemSetIterator::has_next(size_t& card_index) { 1276 bool HeapRegionRemSetIterator::has_next(size_t& card_index) {
1277 switch (_is) { 1277 switch (_is) {
1278 case Sparse: 1278 case Sparse: