< prev index next >

src/hotspot/share/gc/cms/cmsOopClosures.hpp

Print this page




  31 
  32 /////////////////////////////////////////////////////////////////
  33 // Closures used by ConcurrentMarkSweepGeneration's collector
  34 /////////////////////////////////////////////////////////////////
  35 class ConcurrentMarkSweepGeneration;
  36 class CMSBitMap;
  37 class CMSMarkStack;
  38 class CMSCollector;
  39 class MarkFromRootsClosure;
  40 class ParMarkFromRootsClosure;
  41 
  42 // Decode the oop and call do_oop on it.
  43 #define DO_OOP_WORK_DEFN                             \
  44   void do_oop(oop obj);                              \
  45   template <class T> inline void do_oop_work(T* p);
  46 
  47 // TODO: This duplication of the MetadataAwareOopClosure class is only needed
  48 //       because some CMS OopClosures derive from OopsInGenClosure. It would be
  49 //       good to get rid of them completely.
  50 class MetadataAwareOopsInGenClosure: public OopsInGenClosure {
  51   KlassToOopClosure _klass_closure;
  52  public:
  53   MetadataAwareOopsInGenClosure() {
  54     _klass_closure.initialize(this);
  55   }
  56 
  57   virtual bool do_metadata()    { return do_metadata_nv(); }
  58   inline  bool do_metadata_nv() { return true; }
  59 
  60   virtual void do_klass(Klass* k);
  61   void do_klass_nv(Klass* k);
  62 
  63   virtual void do_cld(ClassLoaderData* cld) { do_cld_nv(cld); }
  64   void do_cld_nv(ClassLoaderData* cld);
  65 };
  66 
  67 class MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure {
  68  private:
  69   const MemRegion _span;
  70   CMSBitMap*      _bitMap;
  71  protected:
  72   DO_OOP_WORK_DEFN
  73  public:
  74   MarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap);
  75   virtual void do_oop(oop* p);
  76   virtual void do_oop(narrowOop* p);




  31 
  32 /////////////////////////////////////////////////////////////////
  33 // Closures used by ConcurrentMarkSweepGeneration's collector
  34 /////////////////////////////////////////////////////////////////
  35 class ConcurrentMarkSweepGeneration;
  36 class CMSBitMap;
  37 class CMSMarkStack;
  38 class CMSCollector;
  39 class MarkFromRootsClosure;
  40 class ParMarkFromRootsClosure;
  41 
  42 // Decode the oop and call do_oop on it.
  43 #define DO_OOP_WORK_DEFN                             \
  44   void do_oop(oop obj);                              \
  45   template <class T> inline void do_oop_work(T* p);
  46 
  47 // TODO: This duplication of the MetadataAwareOopClosure class is only needed
  48 //       because some CMS OopClosures derive from OopsInGenClosure. It would be
  49 //       good to get rid of them completely.
  50 class MetadataAwareOopsInGenClosure: public OopsInGenClosure {

  51  public:




  52   virtual bool do_metadata()    { return do_metadata_nv(); }
  53   inline  bool do_metadata_nv() { return true; }
  54 
  55   virtual void do_klass(Klass* k);
  56   void do_klass_nv(Klass* k);
  57 
  58   virtual void do_cld(ClassLoaderData* cld) { do_cld_nv(cld); }
  59   void do_cld_nv(ClassLoaderData* cld);
  60 };
  61 
  62 class MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure {
  63  private:
  64   const MemRegion _span;
  65   CMSBitMap*      _bitMap;
  66  protected:
  67   DO_OOP_WORK_DEFN
  68  public:
  69   MarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap);
  70   virtual void do_oop(oop* p);
  71   virtual void do_oop(narrowOop* p);


< prev index next >