@@ -79,51 +79,6 @@ void CardTableRS::at_younger_refs_iterate() {
7979}
8080
8181inline bool ClearNoncleanCardWrapper::clear_card (CardValue* entry) {
82- if (_is_par) {
83- return clear_card_parallel (entry);
84- } else {
85- return clear_card_serial (entry);
86- }
87- }
88-
89- inline bool ClearNoncleanCardWrapper::clear_card_parallel (CardValue* entry) {
90- while (true ) {
91- // In the parallel case, we may have to do this several times.
92- CardValue entry_val = *entry;
93- assert (entry_val != CardTableRS::clean_card_val (),
94- " We shouldn't be looking at clean cards, and this should "
95- " be the only place they get cleaned." );
96- if (CardTableRS::card_is_dirty_wrt_gen_iter (entry_val)
97- || _ct->is_prev_youngergen_card_val (entry_val)) {
98- CardValue res =
99- Atomic::cmpxchg (entry, entry_val, CardTableRS::clean_card_val ());
100- if (res == entry_val) {
101- break ;
102- } else {
103- assert (res == CardTableRS::cur_youngergen_and_prev_nonclean_card,
104- " The CAS above should only fail if another thread did "
105- " a GC write barrier." );
106- }
107- } else if (entry_val ==
108- CardTableRS::cur_youngergen_and_prev_nonclean_card) {
109- // Parallelism shouldn't matter in this case. Only the thread
110- // assigned to scan the card should change this value.
111- *entry = _ct->cur_youngergen_card_val ();
112- break ;
113- } else {
114- assert (entry_val == _ct->cur_youngergen_card_val (),
115- " Should be the only possibility." );
116- // In this case, the card was clean before, and become
117- // cur_youngergen only because of processing of a promoted object.
118- // We don't have to look at the card.
119- return false ;
120- }
121- }
122- return true ;
123- }
124-
125-
126- inline bool ClearNoncleanCardWrapper::clear_card_serial (CardValue* entry) {
12782 CardValue entry_val = *entry;
12883 assert (entry_val != CardTableRS::clean_card_val (),
12984 " We shouldn't be looking at clean cards, and this should "
@@ -135,8 +90,8 @@ inline bool ClearNoncleanCardWrapper::clear_card_serial(CardValue* entry) {
13590}
13691
13792ClearNoncleanCardWrapper::ClearNoncleanCardWrapper (
138- DirtyCardToOopClosure* dirty_card_closure, CardTableRS* ct, bool is_par ) :
139- _dirty_card_closure(dirty_card_closure), _ct(ct), _is_par(is_par) {
93+ DirtyCardToOopClosure* dirty_card_closure, CardTableRS* ct) :
94+ _dirty_card_closure(dirty_card_closure), _ct(ct) {
14095}
14196
14297bool ClearNoncleanCardWrapper::is_word_aligned (CardTable::CardValue* entry) {
@@ -203,12 +158,11 @@ void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) {
203158
204159void CardTableRS::younger_refs_in_space_iterate (Space* sp,
205160 HeapWord* gen_boundary,
206- OopIterateClosure* cl,
207- uint n_threads) {
161+ OopIterateClosure* cl) {
208162 verify_used_region_at_save_marks (sp);
209163
210164 const MemRegion urasm = sp->used_region_at_save_marks ();
211- non_clean_card_iterate_possibly_parallel (sp, gen_boundary, urasm, cl, this , n_threads );
165+ non_clean_card_iterate (sp, gen_boundary, urasm, cl, this );
212166}
213167
214168#ifdef ASSERT
@@ -580,35 +534,21 @@ bool CardTableRS::card_may_have_been_dirty(CardValue cv) {
580534 CardTableRS::youngergen_may_have_been_dirty (cv));
581535}
582536
583- void CardTableRS::non_clean_card_iterate_possibly_parallel (
584- Space* sp,
585- HeapWord* gen_boundary,
586- MemRegion mr,
587- OopIterateClosure* cl,
588- CardTableRS* ct,
589- uint n_threads)
537+ void CardTableRS::non_clean_card_iterate (Space* sp,
538+ HeapWord* gen_boundary,
539+ MemRegion mr,
540+ OopIterateClosure* cl,
541+ CardTableRS* ct)
590542{
591- if (!mr.is_empty ()) {
592- if (n_threads > 0 ) {
593- non_clean_card_iterate_parallel_work (sp, mr, cl, ct, n_threads);
594- } else {
595- // clear_cl finds contiguous dirty ranges of cards to process and clear.
596-
597- // This is the single-threaded version used by DefNew.
598- const bool parallel = false ;
599-
600- DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl (cl, precision (), gen_boundary, parallel);
601- ClearNoncleanCardWrapper clear_cl (dcto_cl, ct, parallel);
602-
603- clear_cl.do_MemRegion (mr);
604- }
543+ if (mr.is_empty ()) {
544+ return ;
605545 }
606- }
546+ // clear_cl finds contiguous dirty ranges of cards to process and clear.
547+
548+ DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl (cl, precision (), gen_boundary);
549+ ClearNoncleanCardWrapper clear_cl (dcto_cl, ct);
607550
608- void CardTableRS::non_clean_card_iterate_parallel_work (Space* sp, MemRegion mr,
609- OopIterateClosure* cl, CardTableRS* ct,
610- uint n_threads) {
611- fatal (" Parallel gc not supported here." );
551+ clear_cl.do_MemRegion (mr);
612552}
613553
614554bool CardTableRS::is_in_young (oop obj) const {
0 commit comments