< prev index next >

src/hotspot/share/gc/serial/markSweep.hpp

Print this page

 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_GC_SERIAL_MARKSWEEP_HPP
 26 #define SHARE_GC_SERIAL_MARKSWEEP_HPP
 27 
 28 #include "gc/shared/collectedHeap.hpp"
 29 #include "gc/shared/genOopClosures.hpp"
 30 #include "gc/shared/stringdedup/stringDedup.hpp"
 31 #include "gc/shared/taskqueue.hpp"
 32 #include "memory/iterator.hpp"
 33 #include "oops/markWord.hpp"
 34 #include "oops/oop.hpp"
 35 #include "runtime/timer.hpp"
 36 #include "utilities/growableArray.hpp"
 37 #include "utilities/stack.hpp"
 38 
 39 class ReferenceProcessor;
 40 class DataLayout;


 41 class SerialOldTracer;
 42 class STWGCTimer;
 43 
 44 // MarkSweep takes care of global mark-compact garbage collection for a
 45 // GenCollectedHeap using a four-phase pointer forwarding algorithm.  All
 46 // generations are assumed to support marking; those that can also support
 47 // compaction.
 48 //
 49 // Class unloading will only occur when a full gc is invoked.
 50 
 51 // declared at end
 52 class PreservedMark;
 53 class MarkAndPushClosure;
 54 class AdjustPointerClosure;
 55 
 56 class MarkSweep : AllStatic {
 57   //
 58   // Inline closure decls
 59   //
 60   class FollowRootClosure: public BasicOopIterateClosure {

164   template <class T> static inline void follow_root(T* p);
165 
166   static inline void push_objarray(oop obj, size_t index);
167 
168   static void follow_object(oop obj);
169 
170   static void follow_array(objArrayOop array);
171 
172   static void follow_array_chunk(objArrayOop array, int index);
173 };
174 
175 class MarkAndPushClosure: public OopIterateClosure {
176 public:
177   template <typename T> void do_oop_work(T* p);
178   virtual void do_oop(oop* p);
179   virtual void do_oop(narrowOop* p);
180 
181   virtual bool do_metadata() { return true; }
182   virtual void do_klass(Klass* k);
183   virtual void do_cld(ClassLoaderData* cld);


184 
185   void set_ref_discoverer(ReferenceDiscoverer* rd) {
186     set_ref_discoverer_internal(rd);
187   }
188 };
189 
190 class AdjustPointerClosure: public BasicOopIterateClosure {
191  public:
192   template <typename T> void do_oop_work(T* p);
193   virtual void do_oop(oop* p);
194   virtual void do_oop(narrowOop* p);
195   virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
196 };
197 
198 class PreservedMark {
199 private:
200   oop _obj;
201   markWord _mark;
202 
203 public:

 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_GC_SERIAL_MARKSWEEP_HPP
 26 #define SHARE_GC_SERIAL_MARKSWEEP_HPP
 27 
 28 #include "gc/shared/collectedHeap.hpp"
 29 #include "gc/shared/genOopClosures.hpp"
 30 #include "gc/shared/stringdedup/stringDedup.hpp"
 31 #include "gc/shared/taskqueue.hpp"
 32 #include "memory/iterator.hpp"
 33 #include "oops/markWord.hpp"
 34 #include "oops/oop.hpp"
 35 #include "runtime/timer.hpp"
 36 #include "utilities/growableArray.hpp"
 37 #include "utilities/stack.hpp"
 38 
 39 class ReferenceProcessor;
 40 class DataLayout;
 41 class Method;
 42 class nmethod;
 43 class SerialOldTracer;
 44 class STWGCTimer;
 45 
 46 // MarkSweep takes care of global mark-compact garbage collection for a
 47 // GenCollectedHeap using a four-phase pointer forwarding algorithm.  All
 48 // generations are assumed to support marking; those that can also support
 49 // compaction.
 50 //
 51 // Class unloading will only occur when a full gc is invoked.
 52 
 53 // declared at end
 54 class PreservedMark;
 55 class MarkAndPushClosure;
 56 class AdjustPointerClosure;
 57 
 58 class MarkSweep : AllStatic {
 59   //
 60   // Inline closure decls
 61   //
 62   class FollowRootClosure: public BasicOopIterateClosure {

166   template <class T> static inline void follow_root(T* p);
167 
168   static inline void push_objarray(oop obj, size_t index);
169 
170   static void follow_object(oop obj);
171 
172   static void follow_array(objArrayOop array);
173 
174   static void follow_array_chunk(objArrayOop array, int index);
175 };
176 
177 class MarkAndPushClosure: public OopIterateClosure {
178 public:
179   template <typename T> void do_oop_work(T* p);
180   virtual void do_oop(oop* p);
181   virtual void do_oop(narrowOop* p);
182 
183   virtual bool do_metadata() { return true; }
184   virtual void do_klass(Klass* k);
185   virtual void do_cld(ClassLoaderData* cld);
186   virtual void do_method(Method* m);
187   virtual void do_nmethod(nmethod* nm);
188 
189   void set_ref_discoverer(ReferenceDiscoverer* rd) {
190     set_ref_discoverer_internal(rd);
191   }
192 };
193 
194 class AdjustPointerClosure: public BasicOopIterateClosure {
195  public:
196   template <typename T> void do_oop_work(T* p);
197   virtual void do_oop(oop* p);
198   virtual void do_oop(narrowOop* p);
199   virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
200 };
201 
202 class PreservedMark {
203 private:
204   oop _obj;
205   markWord _mark;
206 
207 public:
< prev index next >