41 // ========= Super
42 //
43
44 class ShenandoahSuperClosure : public MetadataVisitingOopIterateClosure {
45 protected:
46 ShenandoahHeap* const _heap;
47
48 public:
49 inline ShenandoahSuperClosure();
50 inline ShenandoahSuperClosure(ShenandoahReferenceProcessor* rp);
51 inline void do_nmethod(nmethod* nm);
52 };
53
54 //
55 // ========= Marking
56 //
57
58 class ShenandoahMarkRefsSuperClosure : public ShenandoahSuperClosure {
59 private:
60 ShenandoahObjToScanQueue* _queue;
61 ShenandoahMarkingContext* const _mark_context;
62 bool _weak;
63
64 protected:
65 template <class T, ShenandoahGenerationType GENERATION>
66 void work(T *p);
67
68 public:
69 inline ShenandoahMarkRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp);
70
71 bool is_weak() const {
72 return _weak;
73 }
74
75 void set_weak(bool weak) {
76 _weak = weak;
77 }
78
79 virtual void do_nmethod(nmethod* nm) {
80 assert(!is_weak(), "Can't handle weak marking of nmethods");
81 ShenandoahSuperClosure::do_nmethod(nm);
82 }
83 };
84
85 template <ShenandoahGenerationType GENERATION>
86 class ShenandoahMarkRefsClosure : public ShenandoahMarkRefsSuperClosure {
87 private:
88 template <class T>
89 inline void do_oop_work(T* p) { work<T, GENERATION>(p); }
90
91 public:
92 ShenandoahMarkRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) :
93 ShenandoahMarkRefsSuperClosure(q, rp) {};
94
95 virtual void do_oop(narrowOop* p) { do_oop_work(p); }
96 virtual void do_oop(oop* p) { do_oop_work(p); }
97 };
98
99 class ShenandoahForwardedIsAliveClosure : public BoolObjectClosure {
100 private:
101 ShenandoahMarkingContext* const _mark_context;
102 public:
103 inline ShenandoahForwardedIsAliveClosure();
104 inline bool do_object_b(oop obj);
105 };
106
107 class ShenandoahIsAliveClosure : public BoolObjectClosure {
108 private:
109 ShenandoahMarkingContext* const _mark_context;
110 public:
111 inline ShenandoahIsAliveClosure();
112 inline bool do_object_b(oop obj);
113 };
174 private:
175 BarrierSetNMethod* const _bs;
176
177 public:
178 inline ShenandoahNMethodAndDisarmClosure(OopClosure* cl);
179 inline void do_nmethod(nmethod* nm);
180 };
181
182
183 //
184 // ========= Update References
185 //
186
187 template <ShenandoahGenerationType GENERATION>
188 class ShenandoahMarkUpdateRefsClosure : public ShenandoahMarkRefsSuperClosure {
189 private:
190 template <class T>
191 inline void work(T* p);
192
193 public:
194 ShenandoahMarkUpdateRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp);
195
196 virtual void do_oop(narrowOop* p) { work(p); }
197 virtual void do_oop(oop* p) { work(p); }
198 };
199
200 class ShenandoahUpdateRefsSuperClosure : public ShenandoahSuperClosure {};
201
202 class ShenandoahNonConcUpdateRefsClosure : public ShenandoahUpdateRefsSuperClosure {
203 private:
204 template<class T>
205 inline void work(T* p);
206
207 public:
208 virtual void do_oop(narrowOop* p) { work(p); }
209 virtual void do_oop(oop* p) { work(p); }
210 };
211
212 class ShenandoahConcUpdateRefsClosure : public ShenandoahUpdateRefsSuperClosure {
213 private:
214 template<class T>
|
41 // ========= Super
42 //
43
44 class ShenandoahSuperClosure : public MetadataVisitingOopIterateClosure {
45 protected:
46 ShenandoahHeap* const _heap;
47
48 public:
49 inline ShenandoahSuperClosure();
50 inline ShenandoahSuperClosure(ShenandoahReferenceProcessor* rp);
51 inline void do_nmethod(nmethod* nm);
52 };
53
54 //
55 // ========= Marking
56 //
57
58 class ShenandoahMarkRefsSuperClosure : public ShenandoahSuperClosure {
59 private:
60 ShenandoahObjToScanQueue* _queue;
61 ShenandoahObjToScanQueue* _old_queue;
62 ShenandoahMarkingContext* const _mark_context;
63 bool _weak;
64
65 protected:
66 template <class T, ShenandoahGenerationType GENERATION>
67 void work(T *p);
68
69 public:
70 inline ShenandoahMarkRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old_q);
71
72 bool is_weak() const {
73 return _weak;
74 }
75
76 void set_weak(bool weak) {
77 _weak = weak;
78 }
79
80 virtual void do_nmethod(nmethod* nm) {
81 assert(!is_weak(), "Can't handle weak marking of nmethods");
82 ShenandoahSuperClosure::do_nmethod(nm);
83 }
84 };
85
86 template <ShenandoahGenerationType GENERATION>
87 class ShenandoahMarkRefsClosure : public ShenandoahMarkRefsSuperClosure {
88 private:
89 template <class T>
90 inline void do_oop_work(T* p) { work<T, GENERATION>(p); }
91
92 public:
93 ShenandoahMarkRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old_q) :
94 ShenandoahMarkRefsSuperClosure(q, rp, old_q) {};
95
96 virtual void do_oop(narrowOop* p) { do_oop_work(p); }
97 virtual void do_oop(oop* p) { do_oop_work(p); }
98 };
99
100 class ShenandoahForwardedIsAliveClosure : public BoolObjectClosure {
101 private:
102 ShenandoahMarkingContext* const _mark_context;
103 public:
104 inline ShenandoahForwardedIsAliveClosure();
105 inline bool do_object_b(oop obj);
106 };
107
108 class ShenandoahIsAliveClosure : public BoolObjectClosure {
109 private:
110 ShenandoahMarkingContext* const _mark_context;
111 public:
112 inline ShenandoahIsAliveClosure();
113 inline bool do_object_b(oop obj);
114 };
175 private:
176 BarrierSetNMethod* const _bs;
177
178 public:
179 inline ShenandoahNMethodAndDisarmClosure(OopClosure* cl);
180 inline void do_nmethod(nmethod* nm);
181 };
182
183
184 //
185 // ========= Update References
186 //
187
188 template <ShenandoahGenerationType GENERATION>
189 class ShenandoahMarkUpdateRefsClosure : public ShenandoahMarkRefsSuperClosure {
190 private:
191 template <class T>
192 inline void work(T* p);
193
194 public:
195 ShenandoahMarkUpdateRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old_q);
196
197 virtual void do_oop(narrowOop* p) { work(p); }
198 virtual void do_oop(oop* p) { work(p); }
199 };
200
201 class ShenandoahUpdateRefsSuperClosure : public ShenandoahSuperClosure {};
202
203 class ShenandoahNonConcUpdateRefsClosure : public ShenandoahUpdateRefsSuperClosure {
204 private:
205 template<class T>
206 inline void work(T* p);
207
208 public:
209 virtual void do_oop(narrowOop* p) { work(p); }
210 virtual void do_oop(oop* p) { work(p); }
211 };
212
213 class ShenandoahConcUpdateRefsClosure : public ShenandoahUpdateRefsSuperClosure {
214 private:
215 template<class T>
|