< prev index next >

src/hotspot/share/gc/z/zHeapIterator.cpp

Print this page

173       const ZHeapIteratorContext& _context;
174 
175     public:
176       explicit NativeAccessClosure(const ZHeapIteratorContext& context) :
177           _context(context) {}
178 
179       virtual void do_oop(oop* p) {
180         assert(!ZCollectedHeap::heap()->is_in(p), "Should not be in heap");
181         const oop obj = NativeAccess<AS_NO_KEEPALIVE>::oop_load(p);
182         _context.mark_and_push(obj);
183       }
184 
185       virtual void do_oop(narrowOop* p) {
186         ShouldNotReachHere();
187       }
188     };
189 
190     NativeAccessClosure cl(_context);
191     cld->oops_do(&cl, ClassLoaderData::_claim_other);
192   }




193 };
194 
195 ZHeapIterator::ZHeapIterator(uint nworkers, bool visit_weaks) :
196     _visit_weaks(visit_weaks),
197     _timer_disable(),
198     _bitmaps(ZAddressOffsetMax),
199     _bitmaps_lock(),
200     _queues(nworkers),
201     _array_queues(nworkers),
202     _roots(ClassLoaderData::_claim_other),
203     _weak_roots(),
204     _terminator(nworkers, &_queues) {
205 
206   // Create queues
207   for (uint i = 0; i < _queues.size(); i++) {
208     ZHeapIteratorQueue* const queue = new ZHeapIteratorQueue();
209     _queues.register_queue(i, queue);
210   }
211 
212   // Create array queues

173       const ZHeapIteratorContext& _context;
174 
175     public:
176       explicit NativeAccessClosure(const ZHeapIteratorContext& context) :
177           _context(context) {}
178 
179       virtual void do_oop(oop* p) {
180         assert(!ZCollectedHeap::heap()->is_in(p), "Should not be in heap");
181         const oop obj = NativeAccess<AS_NO_KEEPALIVE>::oop_load(p);
182         _context.mark_and_push(obj);
183       }
184 
185       virtual void do_oop(narrowOop* p) {
186         ShouldNotReachHere();
187       }
188     };
189 
190     NativeAccessClosure cl(_context);
191     cld->oops_do(&cl, ClassLoaderData::_claim_other);
192   }
193 
194   // Don't follow loom stack metadata; it's already followed in other ways through CLDs
195   virtual void do_nmethod(nmethod* nm) {}
196   virtual void do_method(Method* m) {}
197 };
198 
199 ZHeapIterator::ZHeapIterator(uint nworkers, bool visit_weaks) :
200     _visit_weaks(visit_weaks),
201     _timer_disable(),
202     _bitmaps(ZAddressOffsetMax),
203     _bitmaps_lock(),
204     _queues(nworkers),
205     _array_queues(nworkers),
206     _roots(ClassLoaderData::_claim_other),
207     _weak_roots(),
208     _terminator(nworkers, &_queues) {
209 
210   // Create queues
211   for (uint i = 0; i < _queues.size(); i++) {
212     ZHeapIteratorQueue* const queue = new ZHeapIteratorQueue();
213     _queues.register_queue(i, queue);
214   }
215 
216   // Create array queues
< prev index next >