< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp

Print this page
rev 59534 : 8245961: Shenandoah: move some root marking to concurrent phase


 233 
 234   void always_strong_cld_do(CLDClosure* clds, uint worker_id);
 235   void cld_do(CLDClosure* clds, uint worker_id);
 236 };
 237 
 238 class ShenandoahRootProcessor : public StackObj {
 239 private:
 240   ShenandoahHeap* const               _heap;
 241   const ShenandoahPhaseTimings::Phase _phase;
 242   const ShenandoahGCWorkerPhase       _worker_phase;
 243 public:
 244   ShenandoahRootProcessor(ShenandoahPhaseTimings::Phase phase);
 245 
 246   ShenandoahHeap* heap() const { return _heap; }
 247 };
 248 
 249 class ShenandoahRootScanner : public ShenandoahRootProcessor {
 250 private:
 251   ShenandoahSerialRoots                                     _serial_roots;
 252   ShenandoahThreadRoots                                     _thread_roots;
 253   ShenandoahCodeCacheRoots                                  _code_roots;
 254   ShenandoahVMRoots<false /*concurrent*/ >                  _vm_roots;
 255   ShenandoahStringDedupRoots                                _dedup_roots;
 256   ShenandoahClassLoaderDataRoots<false /*concurrent*/, false /*single threaded*/>
 257                                                             _cld_roots;
 258 public:
 259   ShenandoahRootScanner(uint n_workers, ShenandoahPhaseTimings::Phase phase);

 260 
 261   // Apply oops, clds and blobs to all strongly reachable roots in the system,
 262   // during class unloading cycle
 263   void strong_roots_do(uint worker_id, OopClosure* cl);
 264   void strong_roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc = NULL);
 265 
 266   // Apply oops, clds and blobs to all strongly reachable roots and weakly reachable
 267   // roots when class unloading is disabled during this cycle
 268   void roots_do(uint worker_id, OopClosure* cl);
 269   void roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc = NULL);
 270 };

















 271 
 272 // This scanner is only for SH::object_iteration() and only supports single-threaded
 273 // root scanning
 274 class ShenandoahHeapIterationRootScanner : public ShenandoahRootProcessor {
 275 private:
 276   ShenandoahSerialRoots                                    _serial_roots;
 277   ShenandoahThreadRoots                                    _thread_roots;
 278   ShenandoahVMRoots<false /*concurrent*/>                  _vm_roots;
 279   ShenandoahClassLoaderDataRoots<false /*concurrent*/, true /*single threaded*/>
 280                                                            _cld_roots;
 281   ShenandoahSerialWeakRoots                                _serial_weak_roots;
 282   ShenandoahWeakRoots<false /*concurrent*/>                _weak_roots;
 283   ShenandoahConcurrentStringDedupRoots                     _dedup_roots;
 284   ShenandoahCodeCacheRoots                                 _code_roots;
 285 
 286 public:
 287   ShenandoahHeapIterationRootScanner();
 288 
 289   void roots_do(OopClosure* cl);
 290 };




 233 
 234   void always_strong_cld_do(CLDClosure* clds, uint worker_id);
 235   void cld_do(CLDClosure* clds, uint worker_id);
 236 };
 237 
 238 class ShenandoahRootProcessor : public StackObj {
 239 private:
 240   ShenandoahHeap* const               _heap;
 241   const ShenandoahPhaseTimings::Phase _phase;
 242   const ShenandoahGCWorkerPhase       _worker_phase;
 243 public:
 244   ShenandoahRootProcessor(ShenandoahPhaseTimings::Phase phase);
 245 
 246   ShenandoahHeap* heap() const { return _heap; }
 247 };
 248 
 249 class ShenandoahRootScanner : public ShenandoahRootProcessor {
 250 private:
 251   ShenandoahSerialRoots                                     _serial_roots;
 252   ShenandoahThreadRoots                                     _thread_roots;


 253   ShenandoahStringDedupRoots                                _dedup_roots;
 254 

 255 public:
 256   ShenandoahRootScanner(uint n_workers, ShenandoahPhaseTimings::Phase phase);
 257   ~ShenandoahRootScanner();
 258 
 259   // Apply oops, clds and blobs to all strongly reachable roots in the system,
 260   // during class unloading cycle
 261   void strong_roots_do(uint worker_id, OopClosure* cl);
 262   void strong_roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc = NULL);
 263 
 264   // Apply oops, clds and blobs to all strongly reachable roots and weakly reachable
 265   // roots when class unloading is disabled during this cycle
 266   void roots_do(uint worker_id, OopClosure* cl);
 267   void roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc = NULL);
 268 };
 269 
 270 template <bool CONCURRENT, bool SINGLE_THREADED>
 271 class ShenandoahConcurrentRootScanner {
 272 private:
 273   ShenandoahVMRoots<CONCURRENT>            _vm_roots;
 274   ShenandoahClassLoaderDataRoots<CONCURRENT, SINGLE_THREADED>
 275                                            _cld_roots;
 276   ShenandoahNMethodTableSnapshot*          _codecache_snapshot;
 277   ShenandoahPhaseTimings::Phase            _phase;
 278 
 279 public:
 280   ShenandoahConcurrentRootScanner(ShenandoahPhaseTimings::Phase phase);
 281   ~ShenandoahConcurrentRootScanner();
 282 
 283   void oops_do(OopClosure* oops, uint worker_id);
 284 };
 285 
 286 
 287 // This scanner is only for SH::object_iteration() and only supports single-threaded
 288 // root scanning
 289 class ShenandoahHeapIterationRootScanner : public ShenandoahRootProcessor {
 290 private:
 291   ShenandoahSerialRoots                                    _serial_roots;
 292   ShenandoahThreadRoots                                    _thread_roots;
 293   ShenandoahVMRoots<false /*concurrent*/>                  _vm_roots;
 294   ShenandoahClassLoaderDataRoots<false /*concurrent*/, true /*single threaded*/>
 295                                                            _cld_roots;
 296   ShenandoahSerialWeakRoots                                _serial_weak_roots;
 297   ShenandoahWeakRoots<false /*concurrent*/>                _weak_roots;
 298   ShenandoahConcurrentStringDedupRoots                     _dedup_roots;
 299   ShenandoahCodeCacheRoots                                 _code_roots;
 300 
 301 public:
 302   ShenandoahHeapIterationRootScanner();
 303 
 304   void roots_do(OopClosure* cl);
 305 };


< prev index next >