< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp

Print this page

 32 #include "gc/shared/gcBehaviours.hpp"
 33 #include "gc/shared/suspendibleThreadSet.hpp"
 34 #include "gc/shenandoah/shenandoahNMethod.inline.hpp"
 35 #include "gc/shenandoah/shenandoahLock.hpp"
 36 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
 37 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
 38 #include "gc/shenandoah/shenandoahUnload.hpp"
 39 #include "gc/shenandoah/shenandoahVerifier.hpp"
 40 #include "memory/iterator.hpp"
 41 #include "memory/metaspaceUtils.hpp"
 42 #include "memory/resourceArea.hpp"
 43 #include "oops/access.inline.hpp"
 44 
 45 class ShenandoahIsUnloadingOopClosure : public OopClosure {
 46 private:
 47   ShenandoahMarkingContext* const _marking_context;
 48   bool                            _is_unloading;
 49 
 50 public:
 51   ShenandoahIsUnloadingOopClosure() :
 52     _marking_context(ShenandoahHeap::heap()->complete_marking_context()),
 53     _is_unloading(false) {
 54   }
 55 
 56   virtual void do_oop(oop* p) {
 57     if (_is_unloading) {
 58       return;
 59     }
 60 
 61     const oop o = RawAccess<>::oop_load(p);
 62     if (!CompressedOops::is_null(o) &&
 63         !_marking_context->is_marked(o)) {
 64       _is_unloading = true;
 65     }
 66   }
 67 
 68   virtual void do_oop(narrowOop* p) {
 69     ShouldNotReachHere();
 70   }
 71 
 72   bool is_unloading() const {

 32 #include "gc/shared/gcBehaviours.hpp"
 33 #include "gc/shared/suspendibleThreadSet.hpp"
 34 #include "gc/shenandoah/shenandoahNMethod.inline.hpp"
 35 #include "gc/shenandoah/shenandoahLock.hpp"
 36 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
 37 #include "gc/shenandoah/shenandoahRootProcessor.hpp"
 38 #include "gc/shenandoah/shenandoahUnload.hpp"
 39 #include "gc/shenandoah/shenandoahVerifier.hpp"
 40 #include "memory/iterator.hpp"
 41 #include "memory/metaspaceUtils.hpp"
 42 #include "memory/resourceArea.hpp"
 43 #include "oops/access.inline.hpp"
 44 
 45 class ShenandoahIsUnloadingOopClosure : public OopClosure {
 46 private:
 47   ShenandoahMarkingContext* const _marking_context;
 48   bool                            _is_unloading;
 49 
 50 public:
 51   ShenandoahIsUnloadingOopClosure() :
 52     _marking_context(ShenandoahHeap::heap()->marking_context()),
 53     _is_unloading(false) {
 54   }
 55 
 56   virtual void do_oop(oop* p) {
 57     if (_is_unloading) {
 58       return;
 59     }
 60 
 61     const oop o = RawAccess<>::oop_load(p);
 62     if (!CompressedOops::is_null(o) &&
 63         !_marking_context->is_marked(o)) {
 64       _is_unloading = true;
 65     }
 66   }
 67 
 68   virtual void do_oop(narrowOop* p) {
 69     ShouldNotReachHere();
 70   }
 71 
 72   bool is_unloading() const {
< prev index next >