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