Skip to content

Commit

Permalink
8316357: Serial: Remove unused GenCollectedHeap::space_containing
Browse files Browse the repository at this point in the history
Reviewed-by: tschatzl
  • Loading branch information
albertnetymk committed Sep 18, 2023
1 parent 3828dc9 commit ecce2af
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 22 deletions.
10 changes: 0 additions & 10 deletions src/hotspot/share/gc/shared/genCollectedHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/gc/shared/genCollectedHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ class GenCollectedHeap : public CollectedHeap {
// 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
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/share/gc/shared/generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/shared/generation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,6 @@ class Generation: public CHeapObj<mtGC> {
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;

Expand Down

1 comment on commit ecce2af

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.