152 if (count < G1ConcRSHotCardLimit) {
153 _card_counts[card_num] =
154 (jubyte)(MIN2((uintx)(_card_counts[card_num] + 1), G1ConcRSHotCardLimit));
155 }
156 }
157 }
158 return count;
159 }
160
161 bool G1CardCounts::is_hot(uint count) {
162 return (count >= G1ConcRSHotCardLimit);
163 }
164
165 void G1CardCounts::clear_region(HeapRegion* hr) {
166 assert(!hr->isHumongous(), "Should have been cleared");
167 if (has_count_table()) {
168 HeapWord* bottom = hr->bottom();
169
170 // We use the last address in hr as hr could be the
171 // last region in the heap. In which case trying to find
172 // the card for hr->end() will be an OOB accesss to the
173 // card table.
174 HeapWord* last = hr->end() - 1;
175 assert(_g1h->g1_committed().contains(last),
176 err_msg("last not in committed: "
177 "last: " PTR_FORMAT ", "
178 "committed: [" PTR_FORMAT ", " PTR_FORMAT ")",
179 last,
180 _g1h->g1_committed().start(),
181 _g1h->g1_committed().end()));
182
183 const jbyte* from_card_ptr = _ct_bs->byte_for_const(bottom);
184 const jbyte* last_card_ptr = _ct_bs->byte_for_const(last);
185
186 #ifdef ASSERT
187 HeapWord* start_addr = _ct_bs->addr_for(from_card_ptr);
188 assert(start_addr == hr->bottom(), "alignment");
189 HeapWord* last_addr = _ct_bs->addr_for(last_card_ptr);
190 assert((last_addr + CardTableModRefBS::card_size_in_words) == hr->end(), "alignment");
191 #endif // ASSERT
192
|
152 if (count < G1ConcRSHotCardLimit) {
153 _card_counts[card_num] =
154 (jubyte)(MIN2((uintx)(_card_counts[card_num] + 1), G1ConcRSHotCardLimit));
155 }
156 }
157 }
158 return count;
159 }
160
161 bool G1CardCounts::is_hot(uint count) {
162 return (count >= G1ConcRSHotCardLimit);
163 }
164
165 void G1CardCounts::clear_region(HeapRegion* hr) {
166 assert(!hr->isHumongous(), "Should have been cleared");
167 if (has_count_table()) {
168 HeapWord* bottom = hr->bottom();
169
170 // We use the last address in hr as hr could be the
171 // last region in the heap. In which case trying to find
172 // the card for hr->end() will be an OOB access to the
173 // card table.
174 HeapWord* last = hr->end() - 1;
175 assert(_g1h->g1_committed().contains(last),
176 err_msg("last not in committed: "
177 "last: " PTR_FORMAT ", "
178 "committed: [" PTR_FORMAT ", " PTR_FORMAT ")",
179 last,
180 _g1h->g1_committed().start(),
181 _g1h->g1_committed().end()));
182
183 const jbyte* from_card_ptr = _ct_bs->byte_for_const(bottom);
184 const jbyte* last_card_ptr = _ct_bs->byte_for_const(last);
185
186 #ifdef ASSERT
187 HeapWord* start_addr = _ct_bs->addr_for(from_card_ptr);
188 assert(start_addr == hr->bottom(), "alignment");
189 HeapWord* last_addr = _ct_bs->addr_for(last_card_ptr);
190 assert((last_addr + CardTableModRefBS::card_size_in_words) == hr->end(), "alignment");
191 #endif // ASSERT
192
|