diff --git a/src/hotspot/share/gc/shared/genCollectedHeap.cpp b/src/hotspot/share/gc/shared/genCollectedHeap.cpp index 88feee798c730..5924477e45208 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 f1f3fcf4e08c3..131a274813df3 100644 --- a/src/hotspot/share/gc/shared/genCollectedHeap.hpp +++ b/src/hotspot/share/gc/shared/genCollectedHeap.hpp @@ -195,7 +195,6 @@ class GenCollectedHeap : public CollectedHeap { 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 1da1d9cab468d..5339bd677a09c 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 eb8b5a19f3340..371692bcd8b62 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 48a1f01b917ac..e78bc79759c53 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 7282b4de2bfae..514504c2fe0c1 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 @@ class ContiguousSpace: public Space { HeapWord* par_allocate(size_t word_size) override; // Iteration - void oop_iterate(OopIterateClosure* cl) override; void object_iterate(ObjectClosure* blk) override; // Compaction support