720 }
721
722 // if we get here, the shared string data is not mapped
723 assert(string_ranges == NULL && num_ranges == 0, "sanity");
724 StringTable::ignore_shared_strings(true);
725 #endif
726 return true;
727 }
728
729 bool FileMapInfo::verify_string_regions() {
730 for (int i = MetaspaceShared::first_string;
731 i < MetaspaceShared::first_string + MetaspaceShared::max_strings; i++) {
732 if (!verify_region_checksum(i)) {
733 return false;
734 }
735 }
736 return true;
737 }
738
739 void FileMapInfo::fixup_string_regions() {
740 if (string_ranges != NULL) {
741 G1CollectedHeap::heap()->fill_archive_regions(string_ranges, num_ranges);
742 }
743 }
744
745 bool FileMapInfo::verify_region_checksum(int i) {
746 if (!VerifySharedSpaces) {
747 return true;
748 }
749
750 size_t sz = _header->_space[i]._used;
751
752 if (sz == 0) {
753 return true; // no data
754 }
755 if (MetaspaceShared::is_string_region(i) && StringTable::shared_string_ignored()) {
756 return true; // shared string data are not mapped
757 }
758 const char* buf = _header->region_addr(i);
759 int crc = ClassLoader::crc32(0, buf, (jint)sz);
760 if (crc != _header->_space[i]._crc) {
|
720 }
721
722 // if we get here, the shared string data is not mapped
723 assert(string_ranges == NULL && num_ranges == 0, "sanity");
724 StringTable::ignore_shared_strings(true);
725 #endif
726 return true;
727 }
728
729 bool FileMapInfo::verify_string_regions() {
730 for (int i = MetaspaceShared::first_string;
731 i < MetaspaceShared::first_string + MetaspaceShared::max_strings; i++) {
732 if (!verify_region_checksum(i)) {
733 return false;
734 }
735 }
736 return true;
737 }
738
739 void FileMapInfo::fixup_string_regions() {
740 if (num_ranges != 0) {
741 assert(string_ranges != NULL, "Null string_ranges array with non-zero count");
742 G1CollectedHeap::heap()->fill_archive_regions(string_ranges, num_ranges);
743 }
744 }
745
746 bool FileMapInfo::verify_region_checksum(int i) {
747 if (!VerifySharedSpaces) {
748 return true;
749 }
750
751 size_t sz = _header->_space[i]._used;
752
753 if (sz == 0) {
754 return true; // no data
755 }
756 if (MetaspaceShared::is_string_region(i) && StringTable::shared_string_ignored()) {
757 return true; // shared string data are not mapped
758 }
759 const char* buf = _header->region_addr(i);
760 int crc = ClassLoader::crc32(0, buf, (jint)sz);
761 if (crc != _header->_space[i]._crc) {
|