< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp

Print this page

417       assert(oopDesc::is_oop(obj), "sanity");
418       assert(ctx->is_marked(obj), "object expected to be marked");
419       cl->do_object(obj);
420       cb += skip_bitmap_delta;
421       if (cb < limit_bitmap) {
422         cb = ctx->get_next_marked_addr(cb, limit_bitmap);
423       }
424     }
425   }
426 
427   // Step 2. Accurate size-based traversal, happens past the TAMS.
428   // This restarts the scan at TAMS, which makes sure we traverse all objects,
429   // regardless of what happened at Step 1.
430   HeapWord* cs = tams;
431   while (cs < limit) {
432     assert (cs >= tams, "only objects past TAMS here: "   PTR_FORMAT " (" PTR_FORMAT ")", p2i(cs), p2i(tams));
433     assert (cs < limit, "only objects below limit here: " PTR_FORMAT " (" PTR_FORMAT ")", p2i(cs), p2i(limit));
434     oop obj = cast_to_oop(cs);
435     assert(oopDesc::is_oop(obj), "sanity");
436     assert(ctx->is_marked(obj), "object expected to be marked");
437     size_t size = obj->size();
438     cl->do_object(obj);
439     cs += size;
440   }
441 }
442 
443 template <class T>
444 class ShenandoahObjectToOopClosure : public ObjectClosure {
445   T* _cl;
446 public:
447   ShenandoahObjectToOopClosure(T* cl) : _cl(cl) {}
448 
449   void do_object(oop obj) {
450     obj->oop_iterate(_cl);
451   }
452 };
453 
454 template <class T>
455 class ShenandoahObjectToOopBoundedClosure : public ObjectClosure {
456   T* _cl;
457   MemRegion _bounds;

417       assert(oopDesc::is_oop(obj), "sanity");
418       assert(ctx->is_marked(obj), "object expected to be marked");
419       cl->do_object(obj);
420       cb += skip_bitmap_delta;
421       if (cb < limit_bitmap) {
422         cb = ctx->get_next_marked_addr(cb, limit_bitmap);
423       }
424     }
425   }
426 
427   // Step 2. Accurate size-based traversal, happens past the TAMS.
428   // This restarts the scan at TAMS, which makes sure we traverse all objects,
429   // regardless of what happened at Step 1.
430   HeapWord* cs = tams;
431   while (cs < limit) {
432     assert (cs >= tams, "only objects past TAMS here: "   PTR_FORMAT " (" PTR_FORMAT ")", p2i(cs), p2i(tams));
433     assert (cs < limit, "only objects below limit here: " PTR_FORMAT " (" PTR_FORMAT ")", p2i(cs), p2i(limit));
434     oop obj = cast_to_oop(cs);
435     assert(oopDesc::is_oop(obj), "sanity");
436     assert(ctx->is_marked(obj), "object expected to be marked");
437     size_t size = obj->forward_safe_size();
438     cl->do_object(obj);
439     cs += size;
440   }
441 }
442 
443 template <class T>
444 class ShenandoahObjectToOopClosure : public ObjectClosure {
445   T* _cl;
446 public:
447   ShenandoahObjectToOopClosure(T* cl) : _cl(cl) {}
448 
449   void do_object(oop obj) {
450     obj->oop_iterate(_cl);
451   }
452 };
453 
454 template <class T>
455 class ShenandoahObjectToOopBoundedClosure : public ObjectClosure {
456   T* _cl;
457   MemRegion _bounds;
< prev index next >