< prev index next >

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

Print this page




 739   if (ShenandoahVerifyLevel >= 4 && marked == _verify_marked_complete) {
 740     guarantee(_heap->marking_context()->is_complete(), "Marking context should be complete");
 741     ShenandoahVerifierMarkedRegionTask task(_verification_bit_map, ld, label, options);
 742     _heap->workers()->run_task(&task);
 743     count_marked = task.processed();
 744   } else {
 745     guarantee(ShenandoahVerifyLevel < 4 || marked == _verify_marked_incomplete || marked == _verify_marked_disable, "Should be");
 746   }
 747 
 748   // Step 4. Verify accumulated liveness data, if needed. Only reliable if verification level includes
 749   // marked objects.
 750 
 751   if (ShenandoahVerifyLevel >= 4 && marked == _verify_marked_complete && liveness == _verify_liveness_complete) {
 752     for (size_t i = 0; i < _heap->num_regions(); i++) {
 753       ShenandoahHeapRegion* r = _heap->get_region(i);
 754 
 755       juint verf_live = 0;
 756       if (r->is_humongous()) {
 757         // For humongous objects, test if start region is marked live, and if so,
 758         // all humongous regions in that chain have live data equal to their "used".
 759         juint start_live = OrderAccess::load_acquire(&ld[r->humongous_start_region()->region_number()]);
 760         if (start_live > 0) {
 761           verf_live = (juint)(r->used() / HeapWordSize);
 762         }
 763       } else {
 764         verf_live = OrderAccess::load_acquire(&ld[r->region_number()]);
 765       }
 766 
 767       size_t reg_live = r->get_live_data_words();
 768       if (reg_live != verf_live) {
 769         ResourceMark rm;
 770         stringStream ss;
 771         r->print_on(&ss);
 772         fatal("%s: Live data should match: region-live = " SIZE_FORMAT ", verifier-live = " UINT32_FORMAT "\n%s",
 773               label, reg_live, verf_live, ss.as_string());
 774       }
 775     }
 776   }
 777 
 778   log_info(gc)("Verify %s, Level " INTX_FORMAT " (" SIZE_FORMAT " reachable, " SIZE_FORMAT " marked)",
 779                label, ShenandoahVerifyLevel, count_reachable, count_marked);
 780 
 781   FREE_C_HEAP_ARRAY(ShenandoahLivenessData, ld);
 782 }
 783 
 784 void ShenandoahVerifier::verify_generic(VerifyOption vo) {




 739   if (ShenandoahVerifyLevel >= 4 && marked == _verify_marked_complete) {
 740     guarantee(_heap->marking_context()->is_complete(), "Marking context should be complete");
 741     ShenandoahVerifierMarkedRegionTask task(_verification_bit_map, ld, label, options);
 742     _heap->workers()->run_task(&task);
 743     count_marked = task.processed();
 744   } else {
 745     guarantee(ShenandoahVerifyLevel < 4 || marked == _verify_marked_incomplete || marked == _verify_marked_disable, "Should be");
 746   }
 747 
 748   // Step 4. Verify accumulated liveness data, if needed. Only reliable if verification level includes
 749   // marked objects.
 750 
 751   if (ShenandoahVerifyLevel >= 4 && marked == _verify_marked_complete && liveness == _verify_liveness_complete) {
 752     for (size_t i = 0; i < _heap->num_regions(); i++) {
 753       ShenandoahHeapRegion* r = _heap->get_region(i);
 754 
 755       juint verf_live = 0;
 756       if (r->is_humongous()) {
 757         // For humongous objects, test if start region is marked live, and if so,
 758         // all humongous regions in that chain have live data equal to their "used".
 759         juint start_live = Atomic::load_acquire(&ld[r->humongous_start_region()->region_number()]);
 760         if (start_live > 0) {
 761           verf_live = (juint)(r->used() / HeapWordSize);
 762         }
 763       } else {
 764         verf_live = Atomic::load_acquire(&ld[r->region_number()]);
 765       }
 766 
 767       size_t reg_live = r->get_live_data_words();
 768       if (reg_live != verf_live) {
 769         ResourceMark rm;
 770         stringStream ss;
 771         r->print_on(&ss);
 772         fatal("%s: Live data should match: region-live = " SIZE_FORMAT ", verifier-live = " UINT32_FORMAT "\n%s",
 773               label, reg_live, verf_live, ss.as_string());
 774       }
 775     }
 776   }
 777 
 778   log_info(gc)("Verify %s, Level " INTX_FORMAT " (" SIZE_FORMAT " reachable, " SIZE_FORMAT " marked)",
 779                label, ShenandoahVerifyLevel, count_reachable, count_marked);
 780 
 781   FREE_C_HEAP_ARRAY(ShenandoahLivenessData, ld);
 782 }
 783 
 784 void ShenandoahVerifier::verify_generic(VerifyOption vo) {


< prev index next >