diff --git a/src/hotspot/share/gc/serial/markSweep.cpp b/src/hotspot/share/gc/serial/markSweep.cpp index e9667d4e346..717d931b929 100644 --- a/src/hotspot/share/gc/serial/markSweep.cpp +++ b/src/hotspot/share/gc/serial/markSweep.cpp @@ -61,7 +61,7 @@ StringDedup::Requests* MarkSweep::_string_dedup_requests = NULL; MarkSweep::FollowRootClosure MarkSweep::follow_root_closure; -MarkAndPushClosure MarkSweep::mark_and_push_closure; +MarkAndPushClosure MarkSweep::mark_and_push_closure(ClassLoaderData::_claim_stw_fullgc_mark); CLDToOopClosure MarkSweep::follow_cld_closure(&mark_and_push_closure, ClassLoaderData::_claim_stw_fullgc_mark); CLDToOopClosure MarkSweep::adjust_cld_closure(&adjust_pointer_closure, ClassLoaderData::_claim_stw_fullgc_adjust); diff --git a/src/hotspot/share/gc/serial/markSweep.hpp b/src/hotspot/share/gc/serial/markSweep.hpp index 17e4692ce73..32ae63c12f5 100644 --- a/src/hotspot/share/gc/serial/markSweep.hpp +++ b/src/hotspot/share/gc/serial/markSweep.hpp @@ -38,8 +38,6 @@ class ReferenceProcessor; class DataLayout; -class Method; -class nmethod; class SerialOldTracer; class STWGCTimer; @@ -152,8 +150,6 @@ class MarkSweep : AllStatic { static void follow_klass(Klass* klass); - static void follow_cld(ClassLoaderData* cld); - template static inline void adjust_pointer(T* p); // Check mark and maybe push on marking stack @@ -174,17 +170,13 @@ class MarkSweep : AllStatic { static void follow_array_chunk(objArrayOop array, int index); }; -class MarkAndPushClosure: public OopIterateClosure { +class MarkAndPushClosure: public ClaimMetadataVisitingOopIterateClosure { public: - template void do_oop_work(T* p); - virtual void do_oop(oop* p); - virtual void do_oop(narrowOop* p); + MarkAndPushClosure(int claim) : ClaimMetadataVisitingOopIterateClosure(claim) {} - virtual bool do_metadata() { return true; } - virtual void do_klass(Klass* k); - virtual void do_cld(ClassLoaderData* cld); - virtual void do_method(Method* m); - virtual void do_nmethod(nmethod* nm); + template void do_oop_work(T* p); + virtual void do_oop( oop* p); + virtual void do_oop(narrowOop* p); void set_ref_discoverer(ReferenceDiscoverer* rd) { set_ref_discoverer_internal(rd); diff --git a/src/hotspot/share/gc/serial/markSweep.inline.hpp b/src/hotspot/share/gc/serial/markSweep.inline.hpp index 71a61c7263b..0f4a12af0f9 100644 --- a/src/hotspot/share/gc/serial/markSweep.inline.hpp +++ b/src/hotspot/share/gc/serial/markSweep.inline.hpp @@ -29,14 +29,12 @@ #include "classfile/classLoaderData.inline.hpp" #include "classfile/javaClasses.inline.hpp" -#include "code/nmethod.hpp" #include "gc/shared/continuationGCSupport.inline.hpp" #include "gc/serial/serialStringDedup.hpp" #include "memory/universe.hpp" #include "oops/markWord.hpp" #include "oops/access.inline.hpp" #include "oops/compressedOops.inline.hpp" -#include "oops/method.hpp" #include "oops/oop.inline.hpp" #include "utilities/align.hpp" #include "utilities/stack.inline.hpp" @@ -76,18 +74,10 @@ inline void MarkSweep::follow_klass(Klass* klass) { MarkSweep::mark_and_push(&op); } -inline void MarkSweep::follow_cld(ClassLoaderData* cld) { - MarkSweep::follow_cld_closure.do_cld(cld); -} - template inline void MarkAndPushClosure::do_oop_work(T* p) { MarkSweep::mark_and_push(p); } -inline void MarkAndPushClosure::do_oop(oop* p) { do_oop_work(p); } +inline void MarkAndPushClosure::do_oop( oop* p) { do_oop_work(p); } inline void MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_work(p); } -inline void MarkAndPushClosure::do_klass(Klass* k) { MarkSweep::follow_klass(k); } -inline void MarkAndPushClosure::do_cld(ClassLoaderData* cld) { MarkSweep::follow_cld(cld); } -inline void MarkAndPushClosure::do_method(Method* m) { m->record_gc_epoch(); } -inline void MarkAndPushClosure::do_nmethod(nmethod* nm) { nm->follow_nmethod(this); } template inline void MarkSweep::adjust_pointer(T* p) { T heap_oop = RawAccess<>::oop_load(p);