< prev index next >

src/hotspot/share/memory/filemap.cpp

Print this page
rev 58060 : [mq]: 8238999-iklam-review


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_C_HEAP_ARRAY(MemRegion, max, mtInternal);
1751   for (int i = 0; i < max; i++) {
1752     ::new (&regions[i]) MemRegion();
1753   }
1754   FileMapRegion* si;
1755   int region_num = 0;
1756 
1757   for (int i = first;
1758            i < first + max; i++) {
1759     si = space_at(i);
1760     size_t size = si->used();
1761     if (size > 0) {
1762       HeapWord* start = (HeapWord*)start_address_as_decoded_from_archive(si);
1763       regions[region_num] = MemRegion(start, size / HeapWordSize);
1764       region_num ++;
1765       log_info(cds)("Trying to map heap data: region[%d] at " INTPTR_FORMAT ", size = " SIZE_FORMAT_W(8) " bytes",
1766                     i, p2i(start), size);
1767     }
1768   }
1769 
1770   if (region_num == 0) {
1771     return false; // no archived java heap data
1772   }
1773 




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 


< prev index next >