678 p2i(p), p2i(_containing_obj),
679 p2i(from->bottom()), p2i(from->end()));
680 print_object(gclog_or_tty, _containing_obj);
681 gclog_or_tty->print_cr("points to dead obj " PTR_FORMAT " in region "
682 "[" PTR_FORMAT ", " PTR_FORMAT ")",
683 p2i(obj), p2i(to->bottom()), p2i(to->end()));
684 print_object(gclog_or_tty, obj);
685 }
686 gclog_or_tty->print_cr("----------");
687 gclog_or_tty->flush();
688 _failures = true;
689 failed = true;
690 _n_failures++;
691 }
692
693 if (!_g1h->collector_state()->full_collection() || G1VerifyRSetsDuringFullGC) {
694 HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
695 HeapRegion* to = _g1h->heap_region_containing(obj);
696 if (from != NULL && to != NULL &&
697 from != to &&
698 !to->is_pinned() &&
699 !from->is_continues_humongous()) {
700 jbyte cv_obj = *_bs->byte_for_const(_containing_obj);
701 jbyte cv_field = *_bs->byte_for_const(p);
702 const jbyte dirty = CardTableModRefBS::dirty_card_val();
703
704 bool is_bad = !(from->is_young()
705 || to->rem_set()->contains_reference(p)
706 || !G1HRRSFlushLogBuffersOnVerify && // buffers were not flushed
707 (_containing_obj->is_objArray() ?
708 cv_field == dirty
709 : cv_obj == dirty || cv_field == dirty));
710 if (is_bad) {
711 MutexLockerEx x(ParGCRareEvent_lock,
712 Mutex::_no_safepoint_check_flag);
713
714 if (!_failures) {
715 gclog_or_tty->cr();
716 gclog_or_tty->print_cr("----------");
717 }
718 gclog_or_tty->print_cr("Missing rem set entry:");
719 gclog_or_tty->print_cr("Field " PTR_FORMAT " "
791 }
792 if (G1MaxVerifyFailures >= 0 &&
793 vl_cl.n_failures() >= G1MaxVerifyFailures) {
794 return;
795 }
796 }
797 } else {
798 gclog_or_tty->print_cr(PTR_FORMAT " no an oop", p2i(obj));
799 *failures = true;
800 return;
801 }
802 }
803 prev_p = p;
804 p += obj_size;
805 }
806
807 if (!is_young() && !is_empty()) {
808 _offsets.verify();
809 }
810
811 if (!is_region_humongous && p != top()) {
812 gclog_or_tty->print_cr("end of last object " PTR_FORMAT " "
813 "does not match top " PTR_FORMAT, p2i(p), p2i(top()));
814 *failures = true;
815 return;
816 }
817
818 HeapWord* the_end = end();
819 // Do some extra BOT consistency checking for addresses in the
820 // range [top, end). BOT look-ups in this range should yield
821 // top. No point in doing that if top == end (there's nothing there).
822 if (p < the_end) {
823 // Look up top
824 HeapWord* addr_1 = p;
825 HeapWord* b_start_1 = _offsets.block_start_const(addr_1);
826 if (b_start_1 != p) {
827 gclog_or_tty->print_cr("BOT look up for top: " PTR_FORMAT " "
828 " yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
829 p2i(addr_1), p2i(b_start_1), p2i(p));
830 *failures = true;
889 void HeapRegion::prepare_for_compaction(CompactPoint* cp) {
890 scan_and_forward(this, cp);
891 }
892
893 // G1OffsetTableContigSpace code; copied from space.cpp. Hope this can go
894 // away eventually.
895
896 void G1OffsetTableContigSpace::clear(bool mangle_space) {
897 set_top(bottom());
898 _scan_top = bottom();
899 CompactibleSpace::clear(mangle_space);
900 reset_bot();
901 }
902
903 void G1OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) {
904 Space::set_bottom(new_bottom);
905 _offsets.set_bottom(new_bottom);
906 }
907
908 void G1OffsetTableContigSpace::set_end(HeapWord* new_end) {
909 Space::set_end(new_end);
910 _offsets.resize(new_end - bottom());
911 }
912
913 #ifndef PRODUCT
914 void G1OffsetTableContigSpace::mangle_unused_area() {
915 mangle_unused_area_complete();
916 }
917
918 void G1OffsetTableContigSpace::mangle_unused_area_complete() {
919 SpaceMangler::mangle_region(MemRegion(top(), end()));
920 }
921 #endif
922
923 void G1OffsetTableContigSpace::print() const {
924 print_short();
925 gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
926 INTPTR_FORMAT ", " INTPTR_FORMAT ")",
927 p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end()));
928 }
|
678 p2i(p), p2i(_containing_obj),
679 p2i(from->bottom()), p2i(from->end()));
680 print_object(gclog_or_tty, _containing_obj);
681 gclog_or_tty->print_cr("points to dead obj " PTR_FORMAT " in region "
682 "[" PTR_FORMAT ", " PTR_FORMAT ")",
683 p2i(obj), p2i(to->bottom()), p2i(to->end()));
684 print_object(gclog_or_tty, obj);
685 }
686 gclog_or_tty->print_cr("----------");
687 gclog_or_tty->flush();
688 _failures = true;
689 failed = true;
690 _n_failures++;
691 }
692
693 if (!_g1h->collector_state()->full_collection() || G1VerifyRSetsDuringFullGC) {
694 HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
695 HeapRegion* to = _g1h->heap_region_containing(obj);
696 if (from != NULL && to != NULL &&
697 from != to &&
698 !to->is_pinned()) {
699 jbyte cv_obj = *_bs->byte_for_const(_containing_obj);
700 jbyte cv_field = *_bs->byte_for_const(p);
701 const jbyte dirty = CardTableModRefBS::dirty_card_val();
702
703 bool is_bad = !(from->is_young()
704 || to->rem_set()->contains_reference(p)
705 || !G1HRRSFlushLogBuffersOnVerify && // buffers were not flushed
706 (_containing_obj->is_objArray() ?
707 cv_field == dirty
708 : cv_obj == dirty || cv_field == dirty));
709 if (is_bad) {
710 MutexLockerEx x(ParGCRareEvent_lock,
711 Mutex::_no_safepoint_check_flag);
712
713 if (!_failures) {
714 gclog_or_tty->cr();
715 gclog_or_tty->print_cr("----------");
716 }
717 gclog_or_tty->print_cr("Missing rem set entry:");
718 gclog_or_tty->print_cr("Field " PTR_FORMAT " "
790 }
791 if (G1MaxVerifyFailures >= 0 &&
792 vl_cl.n_failures() >= G1MaxVerifyFailures) {
793 return;
794 }
795 }
796 } else {
797 gclog_or_tty->print_cr(PTR_FORMAT " no an oop", p2i(obj));
798 *failures = true;
799 return;
800 }
801 }
802 prev_p = p;
803 p += obj_size;
804 }
805
806 if (!is_young() && !is_empty()) {
807 _offsets.verify();
808 }
809
810 if (is_region_humongous) {
811 oop obj = oop(this->humongous_start_region()->bottom());
812 if ((HeapWord*)obj > bottom() || (HeapWord*)obj + obj->size() < bottom()) {
813 gclog_or_tty->print_cr("this humongous region is not part of its' humongous object " PTR_FORMAT, p2i(obj));
814 }
815 }
816
817 if (!is_region_humongous && p != top()) {
818 gclog_or_tty->print_cr("end of last object " PTR_FORMAT " "
819 "does not match top " PTR_FORMAT, p2i(p), p2i(top()));
820 *failures = true;
821 return;
822 }
823
824 HeapWord* the_end = end();
825 // Do some extra BOT consistency checking for addresses in the
826 // range [top, end). BOT look-ups in this range should yield
827 // top. No point in doing that if top == end (there's nothing there).
828 if (p < the_end) {
829 // Look up top
830 HeapWord* addr_1 = p;
831 HeapWord* b_start_1 = _offsets.block_start_const(addr_1);
832 if (b_start_1 != p) {
833 gclog_or_tty->print_cr("BOT look up for top: " PTR_FORMAT " "
834 " yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
835 p2i(addr_1), p2i(b_start_1), p2i(p));
836 *failures = true;
895 void HeapRegion::prepare_for_compaction(CompactPoint* cp) {
896 scan_and_forward(this, cp);
897 }
898
899 // G1OffsetTableContigSpace code; copied from space.cpp. Hope this can go
900 // away eventually.
901
902 void G1OffsetTableContigSpace::clear(bool mangle_space) {
903 set_top(bottom());
904 _scan_top = bottom();
905 CompactibleSpace::clear(mangle_space);
906 reset_bot();
907 }
908
909 void G1OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) {
910 Space::set_bottom(new_bottom);
911 _offsets.set_bottom(new_bottom);
912 }
913
914 void G1OffsetTableContigSpace::set_end(HeapWord* new_end) {
915 assert(new_end == _bottom + HeapRegion::GrainWords, "set_end should only ever be set to _bottom + HeapRegion::GrainWords");
916 Space::set_end(new_end);
917 _offsets.resize(new_end - bottom());
918 }
919
920 #ifndef PRODUCT
921 void G1OffsetTableContigSpace::mangle_unused_area() {
922 mangle_unused_area_complete();
923 }
924
925 void G1OffsetTableContigSpace::mangle_unused_area_complete() {
926 SpaceMangler::mangle_region(MemRegion(top(), end()));
927 }
928 #endif
929
930 void G1OffsetTableContigSpace::print() const {
931 print_short();
932 gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
933 INTPTR_FORMAT ", " INTPTR_FORMAT ")",
934 p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end()));
935 }
|