diff --git a/src/hotspot/share/gc/serial/markSweep.cpp b/src/hotspot/share/gc/serial/markSweep.cpp index f175c159910..5647de2748e 100644 --- a/src/hotspot/share/gc/serial/markSweep.cpp +++ b/src/hotspot/share/gc/serial/markSweep.cpp @@ -76,7 +76,7 @@ void MarkSweep::push_objarray(oop obj, size_t index) { } void MarkSweep::follow_array(objArrayOop array) { - MarkSweep::follow_klass(array->klass()); + mark_and_push_closure.do_klass(array->klass()); // Don't push empty arrays to avoid unnecessary work. if (array->length() > 0) { MarkSweep::push_objarray(array, 0); @@ -203,11 +203,6 @@ template void MarkSweep::mark_and_push(T* p) { } } -void MarkSweep::follow_klass(Klass* klass) { - oop op = klass->class_loader_data()->holder_no_keepalive(); - MarkSweep::mark_and_push(&op); -} - template void MarkAndPushClosure::do_oop_work(T* p) { MarkSweep::mark_and_push(p); } void MarkAndPushClosure::do_oop( oop* p) { do_oop_work(p); } diff --git a/src/hotspot/share/gc/serial/markSweep.hpp b/src/hotspot/share/gc/serial/markSweep.hpp index 32ae63c12f5..3c6a29e6902 100644 --- a/src/hotspot/share/gc/serial/markSweep.hpp +++ b/src/hotspot/share/gc/serial/markSweep.hpp @@ -148,8 +148,6 @@ class MarkSweep : AllStatic { static void follow_stack(); // Empty marking stack. - static void follow_klass(Klass* klass); - template static inline void adjust_pointer(T* p); // Check mark and maybe push on marking stack