< prev index next >

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

Print this page
rev 57746 : 8240873: Shenandoah: Short-cut arraycopy barriers
Reviewed-by: shade


 297 
 298   // Traversal does not support concurrent code root scanning
 299   FLAG_SET_DEFAULT(ShenandoahConcurrentScanCodeRoots, false);
 300 
 301   uint num_queues = heap->max_workers();
 302   for (uint i = 0; i < num_queues; ++i) {
 303     ShenandoahObjToScanQueue* task_queue = new ShenandoahObjToScanQueue();
 304     task_queue->initialize();
 305     _task_queues->register_queue(i, task_queue);
 306   }
 307 }
 308 
 309 ShenandoahTraversalGC::~ShenandoahTraversalGC() {
 310 }
 311 
 312 void ShenandoahTraversalGC::prepare_regions() {
 313   size_t num_regions = _heap->num_regions();
 314   ShenandoahMarkingContext* const ctx = _heap->marking_context();
 315   for (size_t i = 0; i < num_regions; i++) {
 316     ShenandoahHeapRegion* region = _heap->get_region(i);

 317     if (_heap->is_bitmap_slice_committed(region)) {
 318       if (_traversal_set.is_in(i)) {
 319         ctx->capture_top_at_mark_start(region);
 320         region->clear_live_data();
 321         assert(ctx->is_bitmap_clear_range(region->bottom(), region->end()), "bitmap for traversal regions must be cleared");
 322       } else {
 323         // Everything outside the traversal set is always considered live.
 324         ctx->reset_top_at_mark_start(region);
 325       }
 326     } else {
 327       // FreeSet may contain uncommitted empty regions, once they are recommitted,
 328       // their TAMS may have old values, so reset them here.
 329       ctx->reset_top_at_mark_start(region);
 330     }
 331   }
 332 }
 333 
 334 void ShenandoahTraversalGC::prepare() {
 335   {
 336     ShenandoahGCPhase phase(ShenandoahPhaseTimings::traversal_gc_make_parsable);




 297 
 298   // Traversal does not support concurrent code root scanning
 299   FLAG_SET_DEFAULT(ShenandoahConcurrentScanCodeRoots, false);
 300 
 301   uint num_queues = heap->max_workers();
 302   for (uint i = 0; i < num_queues; ++i) {
 303     ShenandoahObjToScanQueue* task_queue = new ShenandoahObjToScanQueue();
 304     task_queue->initialize();
 305     _task_queues->register_queue(i, task_queue);
 306   }
 307 }
 308 
 309 ShenandoahTraversalGC::~ShenandoahTraversalGC() {
 310 }
 311 
 312 void ShenandoahTraversalGC::prepare_regions() {
 313   size_t num_regions = _heap->num_regions();
 314   ShenandoahMarkingContext* const ctx = _heap->marking_context();
 315   for (size_t i = 0; i < num_regions; i++) {
 316     ShenandoahHeapRegion* region = _heap->get_region(i);
 317     region->set_update_watermark(region->top());
 318     if (_heap->is_bitmap_slice_committed(region)) {
 319       if (_traversal_set.is_in(i)) {
 320         ctx->capture_top_at_mark_start(region);
 321         region->clear_live_data();
 322         assert(ctx->is_bitmap_clear_range(region->bottom(), region->end()), "bitmap for traversal regions must be cleared");
 323       } else {
 324         // Everything outside the traversal set is always considered live.
 325         ctx->reset_top_at_mark_start(region);
 326       }
 327     } else {
 328       // FreeSet may contain uncommitted empty regions, once they are recommitted,
 329       // their TAMS may have old values, so reset them here.
 330       ctx->reset_top_at_mark_start(region);
 331     }
 332   }
 333 }
 334 
 335 void ShenandoahTraversalGC::prepare() {
 336   {
 337     ShenandoahGCPhase phase(ShenandoahPhaseTimings::traversal_gc_make_parsable);


< prev index next >