453 Atomic::cmpxchg(new_val, &_byte_map[card_index], val); |
453 Atomic::cmpxchg(new_val, &_byte_map[card_index], val); |
454 } |
454 } |
455 return true; |
455 return true; |
456 } |
456 } |
457 |
457 |
458 |
|
459 void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp, |
458 void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp, |
460 MemRegion mr, |
459 MemRegion mr, |
461 DirtyCardToOopClosure* dcto_cl, |
460 OopsInGenClosure* cl, |
462 ClearNoncleanCardWrapper* cl) { |
461 CardTableRS* ct) { |
463 if (!mr.is_empty()) { |
462 if (!mr.is_empty()) { |
464 int n_threads = SharedHeap::heap()->n_par_threads(); |
463 int n_threads = SharedHeap::heap()->n_par_threads(); |
465 if (n_threads > 0) { |
464 if (n_threads > 0) { |
466 #ifndef SERIALGC |
465 #ifndef SERIALGC |
467 non_clean_card_iterate_parallel_work(sp, mr, dcto_cl, cl, n_threads); |
466 non_clean_card_iterate_parallel_work(sp, mr, cl, ct, n_threads); |
468 #else // SERIALGC |
467 #else // SERIALGC |
469 fatal("Parallel gc not supported here."); |
468 fatal("Parallel gc not supported here."); |
470 #endif // SERIALGC |
469 #endif // SERIALGC |
471 } else { |
470 } else { |
472 // We do not call the non_clean_card_iterate_serial() version below because |
471 // We do not call the non_clean_card_iterate_serial() version below because |
473 // we want to clear the cards (which non_clean_card_iterate_serial() does not |
472 // we want to clear the cards (which non_clean_card_iterate_serial() does not |
474 // do for us), and the ClearNoncleanCardWrapper closure itself does the work |
473 // do for us): clear_cl here does the work of finding contiguous dirty ranges |
475 // of finding contiguous dirty ranges of cards to process (and clear). |
474 // of cards to process and clear. |
476 cl->do_MemRegion(mr); |
475 |
|
476 DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(), |
|
477 cl->gen_boundary()); |
|
478 ClearNoncleanCardWrapper clear_cl(dcto_cl, ct); |
|
479 |
|
480 clear_cl.do_MemRegion(mr); |
477 } |
481 } |
478 } |
482 } |
479 } |
483 } |
480 |
484 |
481 // The iterator itself is not MT-aware, but |
485 // The iterator itself is not MT-aware, but |