8076241: Remove unused methods mod_card_iterate() and non_clean_card_iterate_serial()
Reviewed-by: kbarrett, pliden, stefank
--- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Tue Mar 31 11:27:20 2015 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Tue Mar 31 11:29:21 2015 +0200
@@ -151,8 +151,7 @@
// result of the dirty card iteration below.
OrderAccess::storestore();
- // We do not call the non_clean_card_iterate_serial() version because
- // we want to clear the cards: clear_cl here does the work of finding
+ // We want to clear the cards: clear_cl here does the work of finding
// contiguous dirty ranges of cards to process and clear.
clear_cl.do_MemRegion(chunk_mr);
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp Tue Mar 31 11:27:20 2015 +0200
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp Tue Mar 31 11:29:21 2015 +0200
@@ -470,13 +470,9 @@
fatal("Parallel gc not supported here.");
#endif // INCLUDE_ALL_GCS
} else {
- // We do not call the non_clean_card_iterate_serial() version below because
- // we want to clear the cards (which non_clean_card_iterate_serial() does not
- // do for us): clear_cl here does the work of finding contiguous dirty ranges
- // of cards to process and clear.
+ // clear_cl finds contiguous dirty ranges of cards to process and clear.
- DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(),
- cl->gen_boundary());
+ DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(), cl->gen_boundary());
ClearNoncleanCardWrapper clear_cl(dcto_cl, ct);
clear_cl.do_MemRegion(mr);
@@ -484,46 +480,6 @@
}
}
-// The iterator itself is not MT-aware, but
-// MT-aware callers and closures can use this to
-// accomplish dirty card iteration in parallel. The
-// iterator itself does not clear the dirty cards, or
-// change their values in any manner.
-void CardTableModRefBS::non_clean_card_iterate_serial(MemRegion mr,
- MemRegionClosure* cl) {
- bool is_par = (SharedHeap::heap()->n_par_threads() > 0);
- assert(!is_par ||
- (SharedHeap::heap()->n_par_threads() ==
- SharedHeap::heap()->workers()->active_workers()), "Mismatch");
- for (int i = 0; i < _cur_covered_regions; i++) {
- MemRegion mri = mr.intersection(_covered[i]);
- if (mri.word_size() > 0) {
- jbyte* cur_entry = byte_for(mri.last());
- jbyte* limit = byte_for(mri.start());
- while (cur_entry >= limit) {
- jbyte* next_entry = cur_entry - 1;
- if (*cur_entry != clean_card) {
- size_t non_clean_cards = 1;
- // Should the next card be included in this range of dirty cards.
- while (next_entry >= limit && *next_entry != clean_card) {
- non_clean_cards++;
- cur_entry = next_entry;
- next_entry--;
- }
- // The memory region may not be on a card boundary. So that
- // objects beyond the end of the region are not processed, make
- // cur_cards precise with regard to the end of the memory region.
- MemRegion cur_cards(addr_for(cur_entry),
- non_clean_cards * card_size_in_words);
- MemRegion dirty_region = cur_cards.intersection(mri);
- cl->do_MemRegion(dirty_region);
- }
- cur_entry = next_entry;
- }
- }
- }
-}
-
void CardTableModRefBS::dirty_MemRegion(MemRegion mr) {
assert((HeapWord*)align_size_down((uintptr_t)mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
assert((HeapWord*)align_size_up ((uintptr_t)mr.end(), HeapWordSize) == mr.end(), "Unaligned end" );
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp Tue Mar 31 11:27:20 2015 +0200
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp Tue Mar 31 11:29:21 2015 +0200
@@ -37,7 +37,7 @@
// the head of "o" is dirtied, not necessarily the card containing the
// modified field itself. For object arrays, however, the barrier *is*
// precise; only the card containing the modified element is dirtied.
-// Any MemRegionClosures used to scan dirty cards should take these
+// Closures used to scan dirty cards should take these
// considerations into account.
class Generation;
@@ -176,16 +176,7 @@
// Iterate over the portion of the card-table which covers the given
// region mr in the given space and apply cl to any dirty sub-regions
- // of mr. Dirty cards are _not_ cleared by the iterator method itself,
- // but closures may arrange to do so on their own should they so wish.
- void non_clean_card_iterate_serial(MemRegion mr, MemRegionClosure* cl);
-
- // A variant of the above that will operate in a parallel mode if
- // worker threads are available, and clear the dirty cards as it
- // processes them.
- // XXX ??? MemRegionClosure above vs OopsInGenClosure below XXX
- // XXX some new_dcto_cl's take OopClosure's, plus as above there are
- // some MemRegionClosures. Clean this up everywhere. XXX
+ // of mr. Clears the dirty cards as they are processed.
void non_clean_card_iterate_possibly_parallel(Space* sp, MemRegion mr,
OopsInGenClosure* cl, CardTableRS* ct);
@@ -379,24 +370,6 @@
// *** Card-table-RemSet-specific things.
- // Invoke "cl.do_MemRegion" on a set of MemRegions that collectively
- // includes all the modified cards (expressing each card as a
- // MemRegion). Thus, several modified cards may be lumped into one
- // region. The regions are non-overlapping, and are visited in
- // *decreasing* address order. (This order aids with imprecise card
- // marking, where a dirty card may cause scanning, and summarization
- // marking, of objects that extend onto subsequent cards.)
- void mod_card_iterate(MemRegionClosure* cl) {
- non_clean_card_iterate_serial(_whole_heap, cl);
- }
-
- // Like the "mod_cards_iterate" above, except only invokes the closure
- // for cards within the MemRegion "mr" (which is required to be
- // card-aligned and sized.)
- void mod_card_iterate(MemRegion mr, MemRegionClosure* cl) {
- non_clean_card_iterate_serial(mr, cl);
- }
-
static uintx ct_max_alignment_constraint();
// Apply closure "cl" to the dirty cards containing some part of