266 }
267 // Otherwise, try next entry.
268 _tbl_ind++;
269 }
270 // Otherwise, there were no entry.
271 return false;
272 }
273
274 bool RSHashTable::contains_card(RegionIdx_t region_index, CardIdx_t card_index) const {
275 SparsePRTEntry* e = get_entry(region_index);
276 return (e != NULL && e->contains_card(card_index));
277 }
278
279 size_t RSHashTable::mem_size() const {
280 return sizeof(RSHashTable) +
281 _num_entries * (SparsePRTEntry::size() + sizeof(int));
282 }
283
284 // ----------------------------------------------------------------------
285
286 SparsePRT* SparsePRT::_head_expanded_list = NULL;
287
288 void SparsePRT::add_to_expanded_list(SparsePRT* sprt) {
289 // We could expand multiple times in a pause -- only put on list once.
290 if (sprt->expanded()) return;
291 sprt->set_expanded(true);
292 SparsePRT* hd = _head_expanded_list;
293 while (true) {
294 sprt->_next_expanded = hd;
295 SparsePRT* res =
296 (SparsePRT*)
297 Atomic::cmpxchg_ptr(sprt, &_head_expanded_list, hd);
298 if (res == hd) return;
299 else hd = res;
300 }
301 }
302
303
304 SparsePRT* SparsePRT::get_from_expanded_list() {
305 SparsePRT* hd = _head_expanded_list;
306 while (hd != NULL) {
|
266 }
267 // Otherwise, try next entry.
268 _tbl_ind++;
269 }
270 // Otherwise, there were no entry.
271 return false;
272 }
273
274 bool RSHashTable::contains_card(RegionIdx_t region_index, CardIdx_t card_index) const {
275 SparsePRTEntry* e = get_entry(region_index);
276 return (e != NULL && e->contains_card(card_index));
277 }
278
279 size_t RSHashTable::mem_size() const {
280 return sizeof(RSHashTable) +
281 _num_entries * (SparsePRTEntry::size() + sizeof(int));
282 }
283
284 // ----------------------------------------------------------------------
285
286 SparsePRT* volatile SparsePRT::_head_expanded_list = NULL;
287
288 void SparsePRT::add_to_expanded_list(SparsePRT* sprt) {
289 // We could expand multiple times in a pause -- only put on list once.
290 if (sprt->expanded()) return;
291 sprt->set_expanded(true);
292 SparsePRT* hd = _head_expanded_list;
293 while (true) {
294 sprt->_next_expanded = hd;
295 SparsePRT* res =
296 (SparsePRT*)
297 Atomic::cmpxchg_ptr(sprt, &_head_expanded_list, hd);
298 if (res == hd) return;
299 else hd = res;
300 }
301 }
302
303
304 SparsePRT* SparsePRT::get_from_expanded_list() {
305 SparsePRT* hd = _head_expanded_list;
306 while (hd != NULL) {
|