< prev index next >

src/hotspot/share/cds/archiveBuilder.cpp

Print this page

1230     for (size_t seg_idx = 0; seg_idx < segments.count(); seg_idx++) {
1231       address requested_start = ArchiveHeapWriter::buffered_addr_to_requested_addr(start);
1232       st.print_cr(PTR_FORMAT ": Heap roots segment [%d]",
1233                   p2i(requested_start), segments.size_in_elems(seg_idx));
1234       start += segments.size_in_bytes(seg_idx);
1235     }
1236     log_heap_roots();
1237 
1238     while (start < end) {
1239       size_t byte_size;
1240       oop source_oop = ArchiveHeapWriter::buffered_addr_to_source_obj(start);
1241       address requested_start = ArchiveHeapWriter::buffered_addr_to_requested_addr(start);
1242       st.print(PTR_FORMAT ": @@ Object ", p2i(requested_start));
1243 
1244       if (source_oop != nullptr) {
1245         // This is a regular oop that got archived.
1246         // Don't print the requested addr again as we have just printed it at the beginning of the line.
1247         // Example:
1248         // 0x00000007ffd27938: @@ Object (0xfffa4f27) java.util.HashMap
1249         print_oop_info_cr(&st, source_oop, /*print_requested_addr=*/false);
1250         byte_size = source_oop->size() * BytesPerWord;


1251       } else if ((byte_size = ArchiveHeapWriter::get_filler_size_at(start)) > 0) {
1252         // We have a filler oop, which also does not exist in BufferOffsetToSourceObjectTable.
1253         // Example:
1254         // 0x00000007ffc3ffd8: @@ Object filler 40 bytes
1255         st.print_cr("filler %zu bytes", byte_size);
1256       } else {
1257         ShouldNotReachHere();
1258       }
1259 
1260       address oop_end = start + byte_size;
1261       log_as_hex(start, oop_end, requested_start, /*is_heap=*/true);
1262 
1263       if (source_oop != nullptr) {
1264         log_oop_details(heap_info, source_oop, /*buffered_addr=*/start);
1265       }
1266       start = oop_end;
1267     }
1268   }
1269 
1270   // ArchivedFieldPrinter is used to print the fields of archived objects. We can't

1230     for (size_t seg_idx = 0; seg_idx < segments.count(); seg_idx++) {
1231       address requested_start = ArchiveHeapWriter::buffered_addr_to_requested_addr(start);
1232       st.print_cr(PTR_FORMAT ": Heap roots segment [%d]",
1233                   p2i(requested_start), segments.size_in_elems(seg_idx));
1234       start += segments.size_in_bytes(seg_idx);
1235     }
1236     log_heap_roots();
1237 
1238     while (start < end) {
1239       size_t byte_size;
1240       oop source_oop = ArchiveHeapWriter::buffered_addr_to_source_obj(start);
1241       address requested_start = ArchiveHeapWriter::buffered_addr_to_requested_addr(start);
1242       st.print(PTR_FORMAT ": @@ Object ", p2i(requested_start));
1243 
1244       if (source_oop != nullptr) {
1245         // This is a regular oop that got archived.
1246         // Don't print the requested addr again as we have just printed it at the beginning of the line.
1247         // Example:
1248         // 0x00000007ffd27938: @@ Object (0xfffa4f27) java.util.HashMap
1249         print_oop_info_cr(&st, source_oop, /*print_requested_addr=*/false);
1250         size_t old_size = source_oop->size();
1251         size_t new_size = source_oop->copy_size_cds(old_size, source_oop->mark());
1252         byte_size = new_size * BytesPerWord;
1253       } else if ((byte_size = ArchiveHeapWriter::get_filler_size_at(start)) > 0) {
1254         // We have a filler oop, which also does not exist in BufferOffsetToSourceObjectTable.
1255         // Example:
1256         // 0x00000007ffc3ffd8: @@ Object filler 40 bytes
1257         st.print_cr("filler %zu bytes", byte_size);
1258       } else {
1259         ShouldNotReachHere();
1260       }
1261 
1262       address oop_end = start + byte_size;
1263       log_as_hex(start, oop_end, requested_start, /*is_heap=*/true);
1264 
1265       if (source_oop != nullptr) {
1266         log_oop_details(heap_info, source_oop, /*buffered_addr=*/start);
1267       }
1268       start = oop_end;
1269     }
1270   }
1271 
1272   // ArchivedFieldPrinter is used to print the fields of archived objects. We can't
< prev index next >