Skip to content

Commit

Permalink
8316420: Serial: Remove unused GenCollectedHeap::oop_iterate
Browse files Browse the repository at this point in the history
Reviewed-by: stefank, tschatzl
  • Loading branch information
albertnetymk committed Sep 19, 2023
1 parent d038571 commit 86115c2
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 46 deletions.
5 changes: 0 additions & 5 deletions src/hotspot/share/gc/shared/genCollectedHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
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 @@ -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,
Expand Down
15 changes: 0 additions & 15 deletions src/hotspot/share/gc/shared/generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
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 @@ -322,10 +322,6 @@ class Generation: public CHeapObj<mtGC> {

// 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);
Expand Down
15 changes: 0 additions & 15 deletions src/hotspot/share/gc/shared/space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/share/gc/shared/space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ class Space: public CHeapObj<mtGC> {
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.
Expand Down Expand Up @@ -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
Expand Down

1 comment on commit 86115c2

@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.