comparison src/share/vm/memory/cardTableRS.cpp @ 3293:1f4413413144

7039089: G1: changeset for 7037276 broke heap verification, and related cleanups Summary: In G1 heap verification, we no longer scan perm to G1-collected heap refs as part of process_strong_roots() but rather in a separate explicit oop iteration over the perm gen. This preserves the original perm card-marks. Added a new assertion in younger_refs_iterate() to catch a simple subcase where the user may have forgotten a prior save_marks() call, as happened in the case of G1's attempt to iterate perm to G1 refs when verifying the heap before exit. The assert was deliberately weakened for ParNew+CMS and will be fixed for that combination in a future CR. Also made some (non-G1) cleanups related to code and comments obsoleted by the migration of Symbols to the native heap. Reviewed-by: iveresov, jmasa, tonyp
author ysr
date Tue, 26 Apr 2011 21:17:24 -0700
parents c48ad6ab8bdf
children fc2b798ab316
comparison
equal deleted inserted replaced
3292:c303b3532d4a 3293:1f4413413144
248 OopsInGenClosure* cl) { 248 OopsInGenClosure* cl) {
249 DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, _ct_bs->precision(), 249 DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, _ct_bs->precision(),
250 cl->gen_boundary()); 250 cl->gen_boundary());
251 ClearNoncleanCardWrapper clear_cl(dcto_cl, this); 251 ClearNoncleanCardWrapper clear_cl(dcto_cl, this);
252 252
253 _ct_bs->non_clean_card_iterate_possibly_parallel(sp, sp->used_region_at_save_marks(), 253 const MemRegion urasm = sp->used_region_at_save_marks();
254 #ifdef ASSERT
255 // Convert the assertion check to a warning if we are running
256 // CMS+ParNew until related bug is fixed.
257 MemRegion ur = sp->used_region();
258 assert(ur.contains(urasm) || (UseConcMarkSweepGC && UseParNewGC),
259 err_msg("Did you forget to call save_marks()? "
260 "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
261 "[" PTR_FORMAT ", " PTR_FORMAT ")",
262 urasm.start(), urasm.end(), ur.start(), ur.end()));
263 // In the case of CMS+ParNew, issue a warning
264 if (!ur.contains(urasm)) {
265 assert(UseConcMarkSweepGC && UseParNewGC, "Tautology: see assert above");
266 warning("CMS+ParNew: Did you forget to call save_marks()? "
267 "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
268 "[" PTR_FORMAT ", " PTR_FORMAT ")",
269 urasm.start(), urasm.end(), ur.start(), ur.end());
270 MemRegion ur2 = sp->used_region();
271 MemRegion urasm2 = sp->used_region_at_save_marks();
272 if (!ur.equals(ur2)) {
273 warning("CMS+ParNew: Flickering used_region()!!");
274 }
275 if (!urasm.equals(urasm2)) {
276 warning("CMS+ParNew: Flickering used_region_at_save_marks()!!");
277 }
278 }
279 #endif
280 _ct_bs->non_clean_card_iterate_possibly_parallel(sp, urasm,
254 dcto_cl, &clear_cl); 281 dcto_cl, &clear_cl);
255 } 282 }
256 283
257 void CardTableRS::clear_into_younger(Generation* gen, bool clear_perm) { 284 void CardTableRS::clear_into_younger(Generation* gen, bool clear_perm) {
258 GenCollectedHeap* gch = GenCollectedHeap::heap(); 285 GenCollectedHeap* gch = GenCollectedHeap::heap();