From 216775ff22e98dadac9ecd9d2cd756d136fd3bd0 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 13 Dec 2022 14:28:40 +0000 Subject: [PATCH] 8298144: Remove Space::new_dcto_cl Reviewed-by: stefank, tschatzl --- src/hotspot/share/gc/shared/cardTableRS.cpp | 4 ++-- src/hotspot/share/gc/shared/cardTableRS.hpp | 6 +++--- src/hotspot/share/gc/shared/space.cpp | 6 ------ src/hotspot/share/gc/shared/space.hpp | 11 +---------- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/hotspot/share/gc/shared/cardTableRS.cpp b/src/hotspot/share/gc/shared/cardTableRS.cpp index bff99c179e0..00a4c93c960 100644 --- a/src/hotspot/share/gc/shared/cardTableRS.cpp +++ b/src/hotspot/share/gc/shared/cardTableRS.cpp @@ -111,7 +111,7 @@ void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) { } } -void CardTableRS::younger_refs_in_space_iterate(Space* sp, +void CardTableRS::younger_refs_in_space_iterate(ContiguousSpace* sp, HeapWord* gen_boundary, OopIterateClosure* cl) { verify_used_region_at_save_marks(sp); @@ -440,7 +440,7 @@ void CardTableRS::initialize() { CardTable::initialize(); } -void CardTableRS::non_clean_card_iterate(Space* sp, +void CardTableRS::non_clean_card_iterate(ContiguousSpace* sp, HeapWord* gen_boundary, MemRegion mr, OopIterateClosure* cl, diff --git a/src/hotspot/share/gc/shared/cardTableRS.hpp b/src/hotspot/share/gc/shared/cardTableRS.hpp index 4a7135c02b7..0e49d496b2d 100644 --- a/src/hotspot/share/gc/shared/cardTableRS.hpp +++ b/src/hotspot/share/gc/shared/cardTableRS.hpp @@ -29,10 +29,10 @@ #include "memory/memRegion.hpp" #include "oops/oop.hpp" +class ContiguousSpace; class DirtyCardToOopClosure; class Generation; class Space; - // This RemSet uses a card table both as shared data structure // for a mod ref barrier set and for the rem set information. @@ -47,7 +47,7 @@ class CardTableRS : public CardTable { public: CardTableRS(MemRegion whole_heap); - void younger_refs_in_space_iterate(Space* sp, HeapWord* gen_boundary, OopIterateClosure* cl); + void younger_refs_in_space_iterate(ContiguousSpace* sp, HeapWord* gen_boundary, OopIterateClosure* cl); virtual void verify_used_region_at_save_marks(Space* sp) const NOT_DEBUG_RETURN; @@ -70,7 +70,7 @@ public: // 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. Clears the dirty cards as they are processed. - void non_clean_card_iterate(Space* sp, + void non_clean_card_iterate(ContiguousSpace* sp, HeapWord* gen_boundary, MemRegion mr, OopIterateClosure* cl, diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index 84925eb499d..43f06dd0b90 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -161,12 +161,6 @@ void DirtyCardToOopClosure::do_MemRegion(MemRegion mr) { _min_done = bottom; } -DirtyCardToOopClosure* Space::new_dcto_cl(OopIterateClosure* cl, - CardTable::PrecisionStyle precision, - HeapWord* boundary) { - return new DirtyCardToOopClosure(this, cl, precision, boundary); -} - HeapWord* ContiguousSpaceDCTOC::get_actual_top(HeapWord* top, HeapWord* top_obj) { if (top_obj != NULL && top_obj < (_sp->toContiguousSpace())->top()) { diff --git a/src/hotspot/share/gc/shared/space.hpp b/src/hotspot/share/gc/shared/space.hpp index 211dc51125c..b673f3acfd1 100644 --- a/src/hotspot/share/gc/shared/space.hpp +++ b/src/hotspot/share/gc/shared/space.hpp @@ -173,14 +173,6 @@ class Space: public CHeapObj { // included in the iteration. virtual void object_iterate(ObjectClosure* blk) = 0; - // Create and return a new dirty card to oop closure. Can be - // overridden to return the appropriate type of closure - // depending on the type of space in which the closure will - // operate. ResourceArea allocated. - virtual DirtyCardToOopClosure* new_dcto_cl(OopIterateClosure* cl, - CardTable::PrecisionStyle precision, - HeapWord* boundary); - // If "p" is in the space, returns the address of the start of the // "block" that contains "p". We say "block" instead of "object" since // some heaps may not pack objects densely; a chunk may either be an @@ -474,10 +466,9 @@ class ContiguousSpace: public CompactibleSpace { set_top(compaction_top()); } - // Override. DirtyCardToOopClosure* new_dcto_cl(OopIterateClosure* cl, CardTable::PrecisionStyle precision, - HeapWord* boundary) override; + HeapWord* boundary); // Apply "blk->do_oop" to the addresses of all reference fields in objects // starting with the _saved_mark_word, which was noted during a generation's