src/hotspot/share/gc/g1/g1OopClosures.hpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54934 39814e0a8964
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
    25 #ifndef SHARE_GC_G1_G1OOPCLOSURES_HPP
    25 #ifndef SHARE_GC_G1_G1OOPCLOSURES_HPP
    26 #define SHARE_GC_G1_G1OOPCLOSURES_HPP
    26 #define SHARE_GC_G1_G1OOPCLOSURES_HPP
    27 
    27 
    28 #include "gc/g1/g1HeapRegionAttr.hpp"
    28 #include "gc/g1/g1HeapRegionAttr.hpp"
    29 #include "memory/iterator.hpp"
    29 #include "memory/iterator.hpp"
    30 #include "oops/markOop.hpp"
    30 #include "oops/markWord.hpp"
    31 
    31 
    32 class HeapRegion;
    32 class HeapRegion;
    33 class G1CollectedHeap;
    33 class G1CollectedHeap;
    34 class G1RemSet;
    34 class G1RemSet;
    35 class G1ConcurrentMark;
    35 class G1ConcurrentMark;
   173 };
   173 };
   174 
   174 
   175 class G1CLDScanClosure : public CLDClosure {
   175 class G1CLDScanClosure : public CLDClosure {
   176   G1ParCopyHelper* _closure;
   176   G1ParCopyHelper* _closure;
   177   bool             _process_only_dirty;
   177   bool             _process_only_dirty;
   178   int              _claim;
       
   179   int              _count;
   178   int              _count;
   180 public:
   179 public:
   181   G1CLDScanClosure(G1ParCopyHelper* closure,
   180   G1CLDScanClosure(G1ParCopyHelper* closure, bool process_only_dirty)
   182                    bool process_only_dirty, int claim_value)
   181   : _closure(closure), _process_only_dirty(process_only_dirty), _count(0) {}
   183   : _closure(closure), _process_only_dirty(process_only_dirty), _claim(claim_value), _count(0) {}
       
   184   void do_cld(ClassLoaderData* cld);
   182   void do_cld(ClassLoaderData* cld);
   185 };
   183 };
   186 
   184 
   187 // Closure for iterating over object fields during concurrent marking
   185 // Closure for iterating over object fields during concurrent marking
   188 class G1CMOopClosure : public MetadataVisitingOopIterateClosure {
   186 class G1CMOopClosure : public MetadataVisitingOopIterateClosure {
   209   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
   207   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
   210 };
   208 };
   211 
   209 
   212 class G1ConcurrentRefineOopClosure: public BasicOopIterateClosure {
   210 class G1ConcurrentRefineOopClosure: public BasicOopIterateClosure {
   213   G1CollectedHeap* _g1h;
   211   G1CollectedHeap* _g1h;
   214   uint _worker_i;
   212   uint _worker_id;
   215 
   213 
   216 public:
   214 public:
   217   G1ConcurrentRefineOopClosure(G1CollectedHeap* g1h, uint worker_i) :
   215   G1ConcurrentRefineOopClosure(G1CollectedHeap* g1h, uint worker_id) :
   218     _g1h(g1h),
   216     _g1h(g1h),
   219     _worker_i(worker_i) {
   217     _worker_id(worker_id) {
   220   }
   218   }
   221 
   219 
   222   virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
   220   virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
   223 
   221 
   224   template <class T> void do_oop_work(T* p);
   222   template <class T> void do_oop_work(T* p);