< prev index next >

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

Print this page
rev 58345 : 8240873: Shenandoah: Short-cut arraycopy barriers


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

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




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


< prev index next >