< prev index next >

src/hotspot/share/cds/archiveBuilder.cpp

Print this page

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


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

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