1730 }
1731 }
1732
1733 void FileMapInfo::map_heap_regions() {
1734 if (has_heap_regions()) {
1735 map_heap_regions_impl();
1736 }
1737
1738 if (!HeapShared::closed_archive_heap_region_mapped()) {
1739 assert(closed_archive_heap_ranges == NULL &&
1740 num_closed_archive_heap_ranges == 0, "sanity");
1741 }
1742
1743 if (!HeapShared::open_archive_heap_region_mapped()) {
1744 assert(open_archive_heap_ranges == NULL && num_open_archive_heap_ranges == 0, "sanity");
1745 }
1746 }
1747
1748 bool FileMapInfo::map_heap_data(MemRegion **heap_mem, int first,
1749 int max, int* num, bool is_open_archive) {
1750 MemRegion * regions = new MemRegion[max];
1751 FileMapRegion* si;
1752 int region_num = 0;
1753
1754 for (int i = first;
1755 i < first + max; i++) {
1756 si = space_at(i);
1757 size_t size = si->used();
1758 if (size > 0) {
1759 HeapWord* start = (HeapWord*)start_address_as_decoded_from_archive(si);
1760 regions[region_num] = MemRegion(start, size / HeapWordSize);
1761 region_num ++;
1762 log_info(cds)("Trying to map heap data: region[%d] at " INTPTR_FORMAT ", size = " SIZE_FORMAT_W(8) " bytes",
1763 i, p2i(start), size);
1764 }
1765 }
1766
1767 if (region_num == 0) {
1768 return false; // no archived java heap data
1769 }
1770
|
1730 }
1731 }
1732
1733 void FileMapInfo::map_heap_regions() {
1734 if (has_heap_regions()) {
1735 map_heap_regions_impl();
1736 }
1737
1738 if (!HeapShared::closed_archive_heap_region_mapped()) {
1739 assert(closed_archive_heap_ranges == NULL &&
1740 num_closed_archive_heap_ranges == 0, "sanity");
1741 }
1742
1743 if (!HeapShared::open_archive_heap_region_mapped()) {
1744 assert(open_archive_heap_ranges == NULL && num_open_archive_heap_ranges == 0, "sanity");
1745 }
1746 }
1747
1748 bool FileMapInfo::map_heap_data(MemRegion **heap_mem, int first,
1749 int max, int* num, bool is_open_archive) {
1750 MemRegion* regions = MemRegion::create(max, mtInternal);
1751 FileMapRegion* si;
1752 int region_num = 0;
1753
1754 for (int i = first;
1755 i < first + max; i++) {
1756 si = space_at(i);
1757 size_t size = si->used();
1758 if (size > 0) {
1759 HeapWord* start = (HeapWord*)start_address_as_decoded_from_archive(si);
1760 regions[region_num] = MemRegion(start, size / HeapWordSize);
1761 region_num ++;
1762 log_info(cds)("Trying to map heap data: region[%d] at " INTPTR_FORMAT ", size = " SIZE_FORMAT_W(8) " bytes",
1763 i, p2i(start), size);
1764 }
1765 }
1766
1767 if (region_num == 0) {
1768 return false; // no archived java heap data
1769 }
1770
|