< prev index next >

src/hotspot/share/gc/shared/genOopClosures.hpp

Print this page




  87   virtual void do_cld(ClassLoaderData* cld) { ShouldNotReachHere(); }
  88 };
  89 
  90 // Super class for scan closures. It contains code to dirty scanned class loader data.
  91 class OopsInClassLoaderDataOrGenClosure: public BasicOopsInGenClosure {
  92   ClassLoaderData* _scanned_cld;
  93  public:
  94   OopsInClassLoaderDataOrGenClosure(Generation* g) : BasicOopsInGenClosure(g), _scanned_cld(NULL) {}
  95   void set_scanned_cld(ClassLoaderData* cld) {
  96     assert(cld == NULL || _scanned_cld == NULL, "Must be");
  97     _scanned_cld = cld;
  98   }
  99   bool is_scanning_a_cld() { return _scanned_cld != NULL; }
 100   void do_cld_barrier();
 101 };
 102 
 103 #if INCLUDE_SERIALGC
 104 
 105 // Closure for scanning DefNewGeneration.
 106 //
 107 // This closure will perform barrier store calls for ALL
 108 // pointers in scanned oops.
 109 class ScanClosure: public OopsInClassLoaderDataOrGenClosure {
 110  private:
 111   DefNewGeneration* _g;
 112   HeapWord*         _boundary;
 113   bool              _gc_barrier;
 114   template <class T> inline void do_oop_work(T* p);
 115  public:
 116   ScanClosure(DefNewGeneration* g, bool gc_barrier);
 117   virtual void do_oop(oop* p);
 118   virtual void do_oop(narrowOop* p);
 119 };
 120 
 121 // Closure for scanning DefNewGeneration.
 122 //
 123 // This closure only performs barrier store calls on
 124 // pointers into the DefNewGeneration. This is less
 125 // precise, but faster, than a ScanClosure
 126 class FastScanClosure: public OopsInClassLoaderDataOrGenClosure {
 127  protected:
 128   DefNewGeneration* _g;
 129   HeapWord*         _boundary;
 130   bool              _gc_barrier;
 131   template <class T> inline void do_oop_work(T* p);
 132  public:
 133   FastScanClosure(DefNewGeneration* g, bool gc_barrier);
 134   virtual void do_oop(oop* p);
 135   virtual void do_oop(narrowOop* p);
 136 };
 137 
 138 #endif // INCLUDE_SERIALGC
 139 
 140 class CLDScanClosure: public CLDClosure {
 141   OopsInClassLoaderDataOrGenClosure*   _scavenge_closure;
 142   // true if the the modified oops state should be saved.
 143   bool                                 _accumulate_modified_oops;
 144  public:
 145   CLDScanClosure(OopsInClassLoaderDataOrGenClosure* scavenge_closure,


 151 class FilteringClosure: public OopIterateClosure {
 152  private:
 153   HeapWord*   _boundary;
 154   OopIterateClosure* _cl;
 155  protected:
 156   template <class T> inline void do_oop_work(T* p);
 157  public:
 158   FilteringClosure(HeapWord* boundary, OopIterateClosure* cl) :
 159     OopIterateClosure(cl->ref_discoverer()), _boundary(boundary),
 160     _cl(cl) {}
 161   virtual void do_oop(oop* p);
 162   virtual void do_oop(narrowOop* p);
 163   virtual bool do_metadata()            { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; }
 164   virtual void do_klass(Klass*)         { ShouldNotReachHere(); }
 165   virtual void do_cld(ClassLoaderData*) { ShouldNotReachHere(); }
 166 };
 167 
 168 #if INCLUDE_SERIALGC
 169 
 170 // Closure for scanning DefNewGeneration's weak references.
 171 // NOTE: very much like ScanClosure but not derived from
 172 //  OopsInGenClosure -- weak references are processed all
 173 //  at once, with no notion of which generation they were in.
 174 class ScanWeakRefClosure: public OopClosure {
 175  protected:
 176   DefNewGeneration* _g;
 177   HeapWord*         _boundary;
 178   template <class T> inline void do_oop_work(T* p);
 179  public:
 180   ScanWeakRefClosure(DefNewGeneration* g);
 181   virtual void do_oop(oop* p);
 182   virtual void do_oop(narrowOop* p);
 183 };
 184 
 185 #endif // INCLUDE_SERIALGC
 186 
 187 #endif // SHARE_GC_SHARED_GENOOPCLOSURES_HPP


  87   virtual void do_cld(ClassLoaderData* cld) { ShouldNotReachHere(); }
  88 };
  89 
  90 // Super class for scan closures. It contains code to dirty scanned class loader data.
  91 class OopsInClassLoaderDataOrGenClosure: public BasicOopsInGenClosure {
  92   ClassLoaderData* _scanned_cld;
  93  public:
  94   OopsInClassLoaderDataOrGenClosure(Generation* g) : BasicOopsInGenClosure(g), _scanned_cld(NULL) {}
  95   void set_scanned_cld(ClassLoaderData* cld) {
  96     assert(cld == NULL || _scanned_cld == NULL, "Must be");
  97     _scanned_cld = cld;
  98   }
  99   bool is_scanning_a_cld() { return _scanned_cld != NULL; }
 100   void do_cld_barrier();
 101 };
 102 
 103 #if INCLUDE_SERIALGC
 104 
 105 // Closure for scanning DefNewGeneration.
 106 //
















 107 // This closure only performs barrier store calls on
 108 // pointers into the DefNewGeneration.

 109 class FastScanClosure: public OopsInClassLoaderDataOrGenClosure {
 110  protected:
 111   DefNewGeneration* _g;
 112   HeapWord*         _boundary;
 113   bool              _gc_barrier;
 114   template <class T> inline void do_oop_work(T* p);
 115  public:
 116   FastScanClosure(DefNewGeneration* g, bool gc_barrier);
 117   virtual void do_oop(oop* p);
 118   virtual void do_oop(narrowOop* p);
 119 };
 120 
 121 #endif // INCLUDE_SERIALGC
 122 
 123 class CLDScanClosure: public CLDClosure {
 124   OopsInClassLoaderDataOrGenClosure*   _scavenge_closure;
 125   // true if the the modified oops state should be saved.
 126   bool                                 _accumulate_modified_oops;
 127  public:
 128   CLDScanClosure(OopsInClassLoaderDataOrGenClosure* scavenge_closure,


 134 class FilteringClosure: public OopIterateClosure {
 135  private:
 136   HeapWord*   _boundary;
 137   OopIterateClosure* _cl;
 138  protected:
 139   template <class T> inline void do_oop_work(T* p);
 140  public:
 141   FilteringClosure(HeapWord* boundary, OopIterateClosure* cl) :
 142     OopIterateClosure(cl->ref_discoverer()), _boundary(boundary),
 143     _cl(cl) {}
 144   virtual void do_oop(oop* p);
 145   virtual void do_oop(narrowOop* p);
 146   virtual bool do_metadata()            { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; }
 147   virtual void do_klass(Klass*)         { ShouldNotReachHere(); }
 148   virtual void do_cld(ClassLoaderData*) { ShouldNotReachHere(); }
 149 };
 150 
 151 #if INCLUDE_SERIALGC
 152 
 153 // Closure for scanning DefNewGeneration's weak references.
 154 //  -- weak references are processed all at once,
 155 //  with no notion of which generation they were in.

 156 class ScanWeakRefClosure: public OopClosure {
 157  protected:
 158   DefNewGeneration* _g;
 159   HeapWord*         _boundary;
 160   template <class T> inline void do_oop_work(T* p);
 161  public:
 162   ScanWeakRefClosure(DefNewGeneration* g);
 163   virtual void do_oop(oop* p);
 164   virtual void do_oop(narrowOop* p);
 165 };
 166 
 167 #endif // INCLUDE_SERIALGC
 168 
 169 #endif // SHARE_GC_SHARED_GENOOPCLOSURES_HPP
< prev index next >