< prev index next >

src/hotspot/share/cds/archiveBuilder.cpp

Print this page

1281     for (size_t seg_idx = 0; seg_idx < segments.count(); seg_idx++) {
1282       address requested_start = ArchiveHeapWriter::buffered_addr_to_requested_addr(start);
1283       st.print_cr(PTR_FORMAT ": Heap roots segment [%d]",
1284                   p2i(requested_start), segments.size_in_elems(seg_idx));
1285       start += segments.size_in_bytes(seg_idx);
1286     }
1287     log_heap_roots();
1288 
1289     while (start < end) {
1290       size_t byte_size;
1291       oop source_oop = ArchiveHeapWriter::buffered_addr_to_source_obj(start);
1292       address requested_start = ArchiveHeapWriter::buffered_addr_to_requested_addr(start);
1293       st.print(PTR_FORMAT ": @@ Object ", p2i(requested_start));
1294 
1295       if (source_oop != nullptr) {
1296         // This is a regular oop that got archived.
1297         // Don't print the requested addr again as we have just printed it at the beginning of the line.
1298         // Example:
1299         // 0x00000007ffd27938: @@ Object (0xfffa4f27) java.util.HashMap
1300         print_oop_info_cr(&st, source_oop, /*print_requested_addr=*/false);
1301         byte_size = source_oop->size() * BytesPerWord;


1302       } else if ((byte_size = ArchiveHeapWriter::get_filler_size_at(start)) > 0) {
1303         // We have a filler oop, which also does not exist in BufferOffsetToSourceObjectTable.
1304         // Example:
1305         // 0x00000007ffc3ffd8: @@ Object filler 40 bytes
1306         st.print_cr("filler " SIZE_FORMAT " bytes", byte_size);
1307       } else {
1308         ShouldNotReachHere();
1309       }
1310 
1311       address oop_end = start + byte_size;
1312       log_as_hex(start, oop_end, requested_start, /*is_heap=*/true);
1313 
1314       if (source_oop != nullptr) {
1315         log_oop_details(heap_info, source_oop, /*buffered_addr=*/start);
1316       }
1317       start = oop_end;
1318     }
1319   }
1320 
1321   // ArchivedFieldPrinter is used to print the fields of archived objects. We can't

1281     for (size_t seg_idx = 0; seg_idx < segments.count(); seg_idx++) {
1282       address requested_start = ArchiveHeapWriter::buffered_addr_to_requested_addr(start);
1283       st.print_cr(PTR_FORMAT ": Heap roots segment [%d]",
1284                   p2i(requested_start), segments.size_in_elems(seg_idx));
1285       start += segments.size_in_bytes(seg_idx);
1286     }
1287     log_heap_roots();
1288 
1289     while (start < end) {
1290       size_t byte_size;
1291       oop source_oop = ArchiveHeapWriter::buffered_addr_to_source_obj(start);
1292       address requested_start = ArchiveHeapWriter::buffered_addr_to_requested_addr(start);
1293       st.print(PTR_FORMAT ": @@ Object ", p2i(requested_start));
1294 
1295       if (source_oop != nullptr) {
1296         // This is a regular oop that got archived.
1297         // Don't print the requested addr again as we have just printed it at the beginning of the line.
1298         // Example:
1299         // 0x00000007ffd27938: @@ Object (0xfffa4f27) java.util.HashMap
1300         print_oop_info_cr(&st, source_oop, /*print_requested_addr=*/false);
1301         size_t old_size = source_oop->size();
1302         size_t new_size = source_oop->copy_size_cds(old_size, source_oop->mark());
1303         byte_size = new_size * BytesPerWord;
1304       } else if ((byte_size = ArchiveHeapWriter::get_filler_size_at(start)) > 0) {
1305         // We have a filler oop, which also does not exist in BufferOffsetToSourceObjectTable.
1306         // Example:
1307         // 0x00000007ffc3ffd8: @@ Object filler 40 bytes
1308         st.print_cr("filler " SIZE_FORMAT " bytes", byte_size);
1309       } else {
1310         ShouldNotReachHere();
1311       }
1312 
1313       address oop_end = start + byte_size;
1314       log_as_hex(start, oop_end, requested_start, /*is_heap=*/true);
1315 
1316       if (source_oop != nullptr) {
1317         log_oop_details(heap_info, source_oop, /*buffered_addr=*/start);
1318       }
1319       start = oop_end;
1320     }
1321   }
1322 
1323   // ArchivedFieldPrinter is used to print the fields of archived objects. We can't
< prev index next >