diff --git a/src/hotspot/share/gc/shared/genCollectedHeap.cpp b/src/hotspot/share/gc/shared/genCollectedHeap.cpp index 341b1bb77bc..88feee798c7 100644 --- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp +++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp @@ -842,16 +842,6 @@ void GenCollectedHeap::object_iterate(ObjectClosure* cl) { _old_gen->object_iterate(cl); } -Space* GenCollectedHeap::space_containing(const void* addr) const { - Space* res = _young_gen->space_containing(addr); - if (res != nullptr) { - return res; - } - res = _old_gen->space_containing(addr); - assert(res != nullptr, "Could not find containing space"); - return res; -} - HeapWord* GenCollectedHeap::block_start(const void* addr) const { assert(is_in_reserved(addr), "block_start of address outside of heap"); if (_young_gen->is_in_reserved(addr)) { diff --git a/src/hotspot/share/gc/shared/genCollectedHeap.hpp b/src/hotspot/share/gc/shared/genCollectedHeap.hpp index a725a936a2c..f1f3fcf4e08 100644 --- a/src/hotspot/share/gc/shared/genCollectedHeap.hpp +++ b/src/hotspot/share/gc/shared/genCollectedHeap.hpp @@ -197,7 +197,6 @@ public: // Iteration functions. void oop_iterate(OopIterateClosure* cl); void object_iterate(ObjectClosure* cl) override; - Space* space_containing(const void* addr) const; // A CollectedHeap is divided into a dense sequence of "blocks"; that is, // each address in the (reserved) heap is a member of exactly diff --git a/src/hotspot/share/gc/shared/generation.cpp b/src/hotspot/share/gc/shared/generation.cpp index b09b609e8d4..1da1d9cab46 100644 --- a/src/hotspot/share/gc/shared/generation.cpp +++ b/src/hotspot/share/gc/shared/generation.cpp @@ -172,13 +172,6 @@ oop Generation::promote(oop obj, size_t obj_size) { return new_obj; } -Space* Generation::space_containing(const void* p) const { - GenerationIsInReservedClosure blk(p); - // Cast away const - ((Generation*)this)->space_iterate(&blk); - return blk.sp; -} - // Some of these are mediocre general implementations. Should be // overridden to get better performance. diff --git a/src/hotspot/share/gc/shared/generation.hpp b/src/hotspot/share/gc/shared/generation.hpp index 6af578e4ab2..eb8b5a19f33 100644 --- a/src/hotspot/share/gc/shared/generation.hpp +++ b/src/hotspot/share/gc/shared/generation.hpp @@ -176,10 +176,6 @@ class Generation: public CHeapObj { return _reserved.contains(p); } - // If some space in the generation contains the given "addr", return a - // pointer to that space, else return "null". - virtual Space* space_containing(const void* addr) const; - // Iteration - do not use for time critical operations virtual void space_iterate(SpaceClosure* blk, bool usedOnly = false) = 0;