Skip to content

Commit 86115c2

Browse files
committedSep 19, 2023
8316420: Serial: Remove unused GenCollectedHeap::oop_iterate
Reviewed-by: stefank, tschatzl
1 parent d038571 commit 86115c2

File tree

6 files changed

+0
-46
lines changed

6 files changed

+0
-46
lines changed
 

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

-5
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,6 @@ bool GenCollectedHeap::is_in_partial_collection(const void* p) {
832832
}
833833
#endif
834834

835-
void GenCollectedHeap::oop_iterate(OopIterateClosure* cl) {
836-
_young_gen->oop_iterate(cl);
837-
_old_gen->oop_iterate(cl);
838-
}
839-
840835
void GenCollectedHeap::object_iterate(ObjectClosure* cl) {
841836
_young_gen->object_iterate(cl);
842837
_old_gen->object_iterate(cl);

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

-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ class GenCollectedHeap : public CollectedHeap {
195195
void prune_scavengable_nmethods();
196196

197197
// Iteration functions.
198-
void oop_iterate(OopIterateClosure* cl);
199198
void object_iterate(ObjectClosure* cl) override;
200199

201200
// A CollectedHeap is divided into a dense sequence of "blocks"; that is,

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

-15
Original file line numberDiff line numberDiff line change
@@ -233,21 +233,6 @@ bool Generation::block_is_obj(const HeapWord* p) const {
233233
return blk.is_obj;
234234
}
235235

236-
class GenerationOopIterateClosure : public SpaceClosure {
237-
public:
238-
OopIterateClosure* _cl;
239-
virtual void do_space(Space* s) {
240-
s->oop_iterate(_cl);
241-
}
242-
GenerationOopIterateClosure(OopIterateClosure* cl) :
243-
_cl(cl) {}
244-
};
245-
246-
void Generation::oop_iterate(OopIterateClosure* cl) {
247-
GenerationOopIterateClosure blk(cl);
248-
space_iterate(&blk);
249-
}
250-
251236
class GenerationObjIterateClosure : public SpaceClosure {
252237
private:
253238
ObjectClosure* _cl;

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

-4
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,6 @@ class Generation: public CHeapObj<mtGC> {
322322

323323
// Iteration.
324324

325-
// Iterate over all the ref-containing fields of all objects in the
326-
// generation, calling "cl.do_oop" on each.
327-
virtual void oop_iterate(OopIterateClosure* cl);
328-
329325
// Iterate over all objects in the generation, calling "cl.do_object" on
330326
// each.
331327
virtual void object_iterate(ObjectClosure* cl);

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

-15
Original file line numberDiff line numberDiff line change
@@ -518,26 +518,11 @@ void ContiguousSpace::verify() const {
518518
}
519519
}
520520

521-
void Space::oop_iterate(OopIterateClosure* blk) {
522-
ObjectToOopClosure blk2(blk);
523-
object_iterate(&blk2);
524-
}
525-
526521
bool Space::obj_is_alive(const HeapWord* p) const {
527522
assert (block_is_obj(p), "The address should point to an object");
528523
return true;
529524
}
530525

531-
void ContiguousSpace::oop_iterate(OopIterateClosure* blk) {
532-
if (is_empty()) return;
533-
HeapWord* obj_addr = bottom();
534-
HeapWord* t = top();
535-
// Could call objects iterate, but this is easier.
536-
while (obj_addr < t) {
537-
obj_addr += cast_to_oop(obj_addr)->oop_iterate_size(blk);
538-
}
539-
}
540-
541526
void ContiguousSpace::object_iterate(ObjectClosure* blk) {
542527
if (is_empty()) return;
543528
object_iterate_from(bottom(), blk);

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

-6
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ class Space: public CHeapObj<mtGC> {
163163
virtual size_t used() const = 0;
164164
virtual size_t free() const = 0;
165165

166-
// Iterate over all the ref-containing fields of all objects in the
167-
// space, calling "cl.do_oop" on each. Fields in objects allocated by
168-
// applications of the closure are not included in the iteration.
169-
virtual void oop_iterate(OopIterateClosure* cl);
170-
171166
// Iterate over all objects in the space, calling "cl.do_object" on
172167
// each. Objects allocated by applications of the closure are not
173168
// included in the iteration.
@@ -444,7 +439,6 @@ class ContiguousSpace: public Space {
444439
HeapWord* par_allocate(size_t word_size) override;
445440

446441
// Iteration
447-
void oop_iterate(OopIterateClosure* cl) override;
448442
void object_iterate(ObjectClosure* blk) override;
449443

450444
// Compaction support

0 commit comments

Comments
 (0)
Please sign in to comment.