< prev index next >

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

Print this page




 202       if (_n_fine_entries == _max_fine_entries) {
 203         prt = delete_region_table();
 204         // There is no need to clear the links to the 'all' list here:
 205         // prt will be reused immediately, i.e. remain in the 'all' list.
 206         prt->init(from_hr, false /* clear_links_to_all_list */);
 207       } else {
 208         prt = PerRegionTable::alloc(from_hr);
 209         link_to_all(prt);
 210       }
 211 
 212       PerRegionTable* first_prt = _fine_grain_regions[ind];
 213       prt->set_collision_list_next(first_prt);
 214       // The assignment into _fine_grain_regions allows the prt to
 215       // start being used concurrently. In addition to
 216       // collision_list_next which must be visible (else concurrent
 217       // parsing of the list, if any, may fail to see other entries),
 218       // the content of the prt must be visible (else for instance
 219       // some mark bits may not yet seem cleared or a 'later' update
 220       // performed by a concurrent thread could be undone when the
 221       // zeroing becomes visible). This requires store ordering.
 222       OrderAccess::release_store(&_fine_grain_regions[ind], prt);
 223       _n_fine_entries++;
 224 
 225       // Transfer from sparse to fine-grain.
 226       SparsePRTEntry *sprt_entry = _sparse_table.get_entry(from_hrm_ind);
 227       assert(sprt_entry != NULL, "There should have been an entry");
 228       for (int i = 0; i < sprt_entry->num_valid_cards(); i++) {
 229         CardIdx_t c = sprt_entry->card(i);
 230         prt->add_card(c);
 231       }
 232       // Now we can delete the sparse entry.
 233       bool res = _sparse_table.delete_entry(from_hrm_ind);
 234       assert(res, "It should have been there.");
 235     }
 236     assert(prt != NULL && prt->hr() == from_hr, "consequence");
 237   }
 238   // Note that we can't assert "prt->hr() == from_hr", because of the
 239   // possibility of concurrent reuse.  But see head comment of
 240   // OtherRegionsTable for why this is OK.
 241   assert(prt != NULL, "Inv");
 242 




 202       if (_n_fine_entries == _max_fine_entries) {
 203         prt = delete_region_table();
 204         // There is no need to clear the links to the 'all' list here:
 205         // prt will be reused immediately, i.e. remain in the 'all' list.
 206         prt->init(from_hr, false /* clear_links_to_all_list */);
 207       } else {
 208         prt = PerRegionTable::alloc(from_hr);
 209         link_to_all(prt);
 210       }
 211 
 212       PerRegionTable* first_prt = _fine_grain_regions[ind];
 213       prt->set_collision_list_next(first_prt);
 214       // The assignment into _fine_grain_regions allows the prt to
 215       // start being used concurrently. In addition to
 216       // collision_list_next which must be visible (else concurrent
 217       // parsing of the list, if any, may fail to see other entries),
 218       // the content of the prt must be visible (else for instance
 219       // some mark bits may not yet seem cleared or a 'later' update
 220       // performed by a concurrent thread could be undone when the
 221       // zeroing becomes visible). This requires store ordering.
 222       Atomic::release_store(&_fine_grain_regions[ind], prt);
 223       _n_fine_entries++;
 224 
 225       // Transfer from sparse to fine-grain.
 226       SparsePRTEntry *sprt_entry = _sparse_table.get_entry(from_hrm_ind);
 227       assert(sprt_entry != NULL, "There should have been an entry");
 228       for (int i = 0; i < sprt_entry->num_valid_cards(); i++) {
 229         CardIdx_t c = sprt_entry->card(i);
 230         prt->add_card(c);
 231       }
 232       // Now we can delete the sparse entry.
 233       bool res = _sparse_table.delete_entry(from_hrm_ind);
 234       assert(res, "It should have been there.");
 235     }
 236     assert(prt != NULL && prt->hr() == from_hr, "consequence");
 237   }
 238   // Note that we can't assert "prt->hr() == from_hr", because of the
 239   // possibility of concurrent reuse.  But see head comment of
 240   // OtherRegionsTable for why this is OK.
 241   assert(prt != NULL, "Inv");
 242 


< prev index next >