Skip to content

Commit ecce2af

Browse files
committedSep 18, 2023
8316357: Serial: Remove unused GenCollectedHeap::space_containing
Reviewed-by: tschatzl
1 parent 3828dc9 commit ecce2af

File tree

4 files changed

+0
-22
lines changed

4 files changed

+0
-22
lines changed
 

‎src/hotspot/share/gc/shared/genCollectedHeap.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -842,16 +842,6 @@ void GenCollectedHeap::object_iterate(ObjectClosure* cl) {
842842
_old_gen->object_iterate(cl);
843843
}
844844

845-
Space* GenCollectedHeap::space_containing(const void* addr) const {
846-
Space* res = _young_gen->space_containing(addr);
847-
if (res != nullptr) {
848-
return res;
849-
}
850-
res = _old_gen->space_containing(addr);
851-
assert(res != nullptr, "Could not find containing space");
852-
return res;
853-
}
854-
855845
HeapWord* GenCollectedHeap::block_start(const void* addr) const {
856846
assert(is_in_reserved(addr), "block_start of address outside of heap");
857847
if (_young_gen->is_in_reserved(addr)) {

‎src/hotspot/share/gc/shared/genCollectedHeap.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ class GenCollectedHeap : public CollectedHeap {
197197
// Iteration functions.
198198
void oop_iterate(OopIterateClosure* cl);
199199
void object_iterate(ObjectClosure* cl) override;
200-
Space* space_containing(const void* addr) const;
201200

202201
// A CollectedHeap is divided into a dense sequence of "blocks"; that is,
203202
// each address in the (reserved) heap is a member of exactly

‎src/hotspot/share/gc/shared/generation.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,6 @@ oop Generation::promote(oop obj, size_t obj_size) {
172172
return new_obj;
173173
}
174174

175-
Space* Generation::space_containing(const void* p) const {
176-
GenerationIsInReservedClosure blk(p);
177-
// Cast away const
178-
((Generation*)this)->space_iterate(&blk);
179-
return blk.sp;
180-
}
181-
182175
// Some of these are mediocre general implementations. Should be
183176
// overridden to get better performance.
184177

‎src/hotspot/share/gc/shared/generation.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@ class Generation: public CHeapObj<mtGC> {
176176
return _reserved.contains(p);
177177
}
178178

179-
// If some space in the generation contains the given "addr", return a
180-
// pointer to that space, else return "null".
181-
virtual Space* space_containing(const void* addr) const;
182-
183179
// Iteration - do not use for time critical operations
184180
virtual void space_iterate(SpaceClosure* blk, bool usedOnly = false) = 0;
185181

0 commit comments

Comments
 (0)
Please sign in to comment.