src/share/vm/gc_implementation/g1/concurrentMark.cpp

Print this page
rev 7653 : 8068883: Remove disabling of warning "C4355: 'this' : used in base member initializer list"


 522 
 523   {
 524     MutexLockerEx x(RootRegionScan_lock, Mutex::_no_safepoint_check_flag);
 525     _scan_in_progress = false;
 526     RootRegionScan_lock->notify_all();
 527   }
 528 }
 529 
 530 bool CMRootRegions::wait_until_scan_finished() {
 531   if (!scan_in_progress()) return false;
 532 
 533   {
 534     MutexLockerEx x(RootRegionScan_lock, Mutex::_no_safepoint_check_flag);
 535     while (scan_in_progress()) {
 536       RootRegionScan_lock->wait(Mutex::_no_safepoint_check_flag);
 537     }
 538   }
 539   return true;
 540 }
 541 
 542 #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away
 543 #pragma warning( disable:4355 ) // 'this' : used in base member initializer list
 544 #endif // _MSC_VER
 545 
 546 uint ConcurrentMark::scale_parallel_threads(uint n_par_threads) {
 547   return MAX2((n_par_threads + 2) / 4, 1U);
 548 }
 549 
 550 ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev_bitmap_storage, G1RegionToSpaceMapper* next_bitmap_storage) :
 551   _g1h(g1h),
 552   _markBitMap1(),
 553   _markBitMap2(),
 554   _parallel_marking_threads(0),
 555   _max_parallel_marking_threads(0),
 556   _sleep_factor(0.0),
 557   _marking_task_overhead(1.0),
 558   _cleanup_sleep_factor(0.0),
 559   _cleanup_task_overhead(1.0),
 560   _cleanup_list("Cleanup List"),
 561   _region_bm((BitMap::idx_t)(g1h->max_regions()), false /* in_resource_area*/),
 562   _card_bm((g1h->reserved_region().byte_size() + CardTableModRefBS::card_size - 1) >>
 563             CardTableModRefBS::card_shift,
 564             false /* in_resource_area*/),
 565 
 566   _prevMarkBitMap(&_markBitMap1),
 567   _nextMarkBitMap(&_markBitMap2),
 568 
 569   _markStack(this),
 570   // _finger set in set_non_marking_state
 571 
 572   _max_worker_id(MAX2((uint)ParallelGCThreads, 1U)),
 573   // _active_tasks set in set_non_marking_state
 574   // _tasks set inside the constructor
 575   _task_queues(new CMTaskQueueSet((int) _max_worker_id)),
 576   _terminator(ParallelTaskTerminator((int) _max_worker_id, _task_queues)),
 577 
 578   _has_overflown(false),
 579   _concurrent(false),
 580   _has_aborted(false),
 581   _aborted_gc_id(GCId::undefined()),
 582   _restart_for_overflow(false),
 583   _concurrent_marking_in_progress(false),
 584 
 585   // _verbose_level set below
 586 
 587   _init_times(),
 588   _remark_times(), _remark_mark_times(), _remark_weak_ref_times(),
 589   _cleanup_times(),
 590   _total_counting_time(0.0),
 591   _total_rs_scrub_time(0.0),
 592 
 593   _parallel_workers(NULL),
 594 
 595   _count_card_bitmaps(NULL),
 596   _count_marked_bytes(NULL),
 597   _completed_initialization(false) {



 598   CMVerboseLevel verbose_level = (CMVerboseLevel) G1MarkingVerboseLevel;
 599   if (verbose_level < no_verbose) {
 600     verbose_level = no_verbose;
 601   }
 602   if (verbose_level > high_verbose) {
 603     verbose_level = high_verbose;
 604   }
 605   _verbose_level = verbose_level;
 606 
 607   if (verbose_low()) {
 608     gclog_or_tty->print_cr("[global] init, heap start = "PTR_FORMAT", "
 609                            "heap end = " PTR_FORMAT, p2i(_heap_start), p2i(_heap_end));
 610   }
 611 
 612   _markBitMap1.initialize(g1h->reserved_region(), prev_bitmap_storage);
 613   _markBitMap2.initialize(g1h->reserved_region(), next_bitmap_storage);
 614 
 615   // Create & start a ConcurrentMark thread.
 616   _cmThread = new ConcurrentMarkThread(this);
 617   assert(cmThread() != NULL, "CM Thread should have been created");




 522 
 523   {
 524     MutexLockerEx x(RootRegionScan_lock, Mutex::_no_safepoint_check_flag);
 525     _scan_in_progress = false;
 526     RootRegionScan_lock->notify_all();
 527   }
 528 }
 529 
 530 bool CMRootRegions::wait_until_scan_finished() {
 531   if (!scan_in_progress()) return false;
 532 
 533   {
 534     MutexLockerEx x(RootRegionScan_lock, Mutex::_no_safepoint_check_flag);
 535     while (scan_in_progress()) {
 536       RootRegionScan_lock->wait(Mutex::_no_safepoint_check_flag);
 537     }
 538   }
 539   return true;
 540 }
 541 




 542 uint ConcurrentMark::scale_parallel_threads(uint n_par_threads) {
 543   return MAX2((n_par_threads + 2) / 4, 1U);
 544 }
 545 
 546 ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev_bitmap_storage, G1RegionToSpaceMapper* next_bitmap_storage) :
 547   _g1h(g1h),
 548   _markBitMap1(),
 549   _markBitMap2(),
 550   _parallel_marking_threads(0),
 551   _max_parallel_marking_threads(0),
 552   _sleep_factor(0.0),
 553   _marking_task_overhead(1.0),
 554   _cleanup_sleep_factor(0.0),
 555   _cleanup_task_overhead(1.0),
 556   _cleanup_list("Cleanup List"),
 557   _region_bm((BitMap::idx_t)(g1h->max_regions()), false /* in_resource_area*/),
 558   _card_bm((g1h->reserved_region().byte_size() + CardTableModRefBS::card_size - 1) >>
 559             CardTableModRefBS::card_shift,
 560             false /* in_resource_area*/),
 561 
 562   _prevMarkBitMap(&_markBitMap1),
 563   _nextMarkBitMap(&_markBitMap2),
 564 

 565   // _finger set in set_non_marking_state
 566 
 567   _max_worker_id(MAX2((uint)ParallelGCThreads, 1U)),
 568   // _active_tasks set in set_non_marking_state
 569   // _tasks set inside the constructor
 570   _task_queues(new CMTaskQueueSet((int) _max_worker_id)),
 571   _terminator(ParallelTaskTerminator((int) _max_worker_id, _task_queues)),
 572 
 573   _has_overflown(false),
 574   _concurrent(false),
 575   _has_aborted(false),
 576   _aborted_gc_id(GCId::undefined()),
 577   _restart_for_overflow(false),
 578   _concurrent_marking_in_progress(false),
 579 
 580   // _verbose_level set below
 581 
 582   _init_times(),
 583   _remark_times(), _remark_mark_times(), _remark_weak_ref_times(),
 584   _cleanup_times(),
 585   _total_counting_time(0.0),
 586   _total_rs_scrub_time(0.0),
 587 
 588   _parallel_workers(NULL),
 589 
 590   _count_card_bitmaps(NULL),
 591   _count_marked_bytes(NULL),
 592   _completed_initialization(false) {
 593 
 594   _markStack = CMMarkStack(this);
 595 
 596   CMVerboseLevel verbose_level = (CMVerboseLevel) G1MarkingVerboseLevel;
 597   if (verbose_level < no_verbose) {
 598     verbose_level = no_verbose;
 599   }
 600   if (verbose_level > high_verbose) {
 601     verbose_level = high_verbose;
 602   }
 603   _verbose_level = verbose_level;
 604 
 605   if (verbose_low()) {
 606     gclog_or_tty->print_cr("[global] init, heap start = "PTR_FORMAT", "
 607                            "heap end = " PTR_FORMAT, p2i(_heap_start), p2i(_heap_end));
 608   }
 609 
 610   _markBitMap1.initialize(g1h->reserved_region(), prev_bitmap_storage);
 611   _markBitMap2.initialize(g1h->reserved_region(), next_bitmap_storage);
 612 
 613   // Create & start a ConcurrentMark thread.
 614   _cmThread = new ConcurrentMarkThread(this);
 615   assert(cmThread() != NULL, "CM Thread should have been created");