From 86115c2a2e9912c5cd5861e4fa16ac09dee24f6d Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 19 Sep 2023 08:25:52 +0000 Subject: [PATCH] 8316420: Serial: Remove unused GenCollectedHeap::oop_iterate Reviewed-by: stefank, tschatzl --- src/hotspot/share/gc/shared/genCollectedHeap.cpp | 5 ----- src/hotspot/share/gc/shared/genCollectedHeap.hpp | 1 - src/hotspot/share/gc/shared/generation.cpp | 15 --------------- src/hotspot/share/gc/shared/generation.hpp | 4 ---- src/hotspot/share/gc/shared/space.cpp | 15 --------------- src/hotspot/share/gc/shared/space.hpp | 6 ------ 6 files changed, 46 deletions(-) diff --git a/src/hotspot/share/gc/shared/genCollectedHeap.cpp b/src/hotspot/share/gc/shared/genCollectedHeap.cpp index 88feee798c7..5924477e452 100644 --- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp +++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp @@ -832,11 +832,6 @@ bool GenCollectedHeap::is_in_partial_collection(const void* p) { } #endif -void GenCollectedHeap::oop_iterate(OopIterateClosure* cl) { - _young_gen->oop_iterate(cl); - _old_gen->oop_iterate(cl); -} - void GenCollectedHeap::object_iterate(ObjectClosure* cl) { _young_gen->object_iterate(cl); _old_gen->object_iterate(cl); diff --git a/src/hotspot/share/gc/shared/genCollectedHeap.hpp b/src/hotspot/share/gc/shared/genCollectedHeap.hpp index f1f3fcf4e08..131a274813d 100644 --- a/src/hotspot/share/gc/shared/genCollectedHeap.hpp +++ b/src/hotspot/share/gc/shared/genCollectedHeap.hpp @@ -195,7 +195,6 @@ public: void prune_scavengable_nmethods(); // Iteration functions. - void oop_iterate(OopIterateClosure* cl); void object_iterate(ObjectClosure* cl) override; // A CollectedHeap is divided into a dense sequence of "blocks"; that is, diff --git a/src/hotspot/share/gc/shared/generation.cpp b/src/hotspot/share/gc/shared/generation.cpp index 1da1d9cab46..5339bd677a0 100644 --- a/src/hotspot/share/gc/shared/generation.cpp +++ b/src/hotspot/share/gc/shared/generation.cpp @@ -233,21 +233,6 @@ bool Generation::block_is_obj(const HeapWord* p) const { return blk.is_obj; } -class GenerationOopIterateClosure : public SpaceClosure { - public: - OopIterateClosure* _cl; - virtual void do_space(Space* s) { - s->oop_iterate(_cl); - } - GenerationOopIterateClosure(OopIterateClosure* cl) : - _cl(cl) {} -}; - -void Generation::oop_iterate(OopIterateClosure* cl) { - GenerationOopIterateClosure blk(cl); - space_iterate(&blk); -} - class GenerationObjIterateClosure : public SpaceClosure { private: ObjectClosure* _cl; diff --git a/src/hotspot/share/gc/shared/generation.hpp b/src/hotspot/share/gc/shared/generation.hpp index eb8b5a19f33..371692bcd8b 100644 --- a/src/hotspot/share/gc/shared/generation.hpp +++ b/src/hotspot/share/gc/shared/generation.hpp @@ -322,10 +322,6 @@ class Generation: public CHeapObj { // Iteration. - // Iterate over all the ref-containing fields of all objects in the - // generation, calling "cl.do_oop" on each. - virtual void oop_iterate(OopIterateClosure* cl); - // Iterate over all objects in the generation, calling "cl.do_object" on // each. virtual void object_iterate(ObjectClosure* cl); diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index 48a1f01b917..e78bc79759c 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -518,26 +518,11 @@ void ContiguousSpace::verify() const { } } -void Space::oop_iterate(OopIterateClosure* blk) { - ObjectToOopClosure blk2(blk); - object_iterate(&blk2); -} - bool Space::obj_is_alive(const HeapWord* p) const { assert (block_is_obj(p), "The address should point to an object"); return true; } -void ContiguousSpace::oop_iterate(OopIterateClosure* blk) { - if (is_empty()) return; - HeapWord* obj_addr = bottom(); - HeapWord* t = top(); - // Could call objects iterate, but this is easier. - while (obj_addr < t) { - obj_addr += cast_to_oop(obj_addr)->oop_iterate_size(blk); - } -} - void ContiguousSpace::object_iterate(ObjectClosure* blk) { if (is_empty()) return; object_iterate_from(bottom(), blk); diff --git a/src/hotspot/share/gc/shared/space.hpp b/src/hotspot/share/gc/shared/space.hpp index 7282b4de2bf..514504c2fe0 100644 --- a/src/hotspot/share/gc/shared/space.hpp +++ b/src/hotspot/share/gc/shared/space.hpp @@ -163,11 +163,6 @@ class Space: public CHeapObj { virtual size_t used() const = 0; virtual size_t free() const = 0; - // Iterate over all the ref-containing fields of all objects in the - // space, calling "cl.do_oop" on each. Fields in objects allocated by - // applications of the closure are not included in the iteration. - virtual void oop_iterate(OopIterateClosure* cl); - // Iterate over all objects in the space, calling "cl.do_object" on // each. Objects allocated by applications of the closure are not // included in the iteration. @@ -444,7 +439,6 @@ private: HeapWord* par_allocate(size_t word_size) override; // Iteration - void oop_iterate(OopIterateClosure* cl) override; void object_iterate(ObjectClosure* blk) override; // Compaction support