1540 }
1541 }
1542
1543 void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
1544 bool is_full_module_graph) {
1545 _num_total_subgraph_recordings = 0;
1546 _num_total_walked_objs = 0;
1547 _num_total_archived_objs = 0;
1548 _num_total_recorded_klasses = 0;
1549 _num_total_verifications = 0;
1550
1551 // For each class X that has one or more archived fields:
1552 // [1] Dump the subgraph of each archived field
1553 // [2] Create a list of all the class of the objects that can be reached
1554 // by any of these static fields.
1555 // At runtime, these classes are initialized before X's archived fields
1556 // are restored by HeapShared::initialize_from_archived_subgraph().
1557 for (int i = 0; fields[i].valid(); ) {
1558 ArchivableStaticFieldInfo* info = &fields[i];
1559 const char* klass_name = info->klass_name;
1560 start_recording_subgraph(info->klass, klass_name, is_full_module_graph);
1561
1562 // If you have specified consecutive fields of the same klass in
1563 // fields[], these will be archived in the same
1564 // {start_recording_subgraph ... done_recording_subgraph} pass to
1565 // save time.
1566 for (; fields[i].valid(); i++) {
1567 ArchivableStaticFieldInfo* f = &fields[i];
1568 if (f->klass_name != klass_name) {
1569 break;
1570 }
1571
1572 archive_reachable_objects_from_static_field(f->klass, f->klass_name,
1573 f->offset, f->field_name);
1574 }
1575 done_recording_subgraph(info->klass, klass_name);
1576 }
1577
1578 log_info(cds, heap)("Archived subgraph records = %d",
1579 _num_total_subgraph_recordings);
|
1540 }
1541 }
1542
1543 void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
1544 bool is_full_module_graph) {
1545 _num_total_subgraph_recordings = 0;
1546 _num_total_walked_objs = 0;
1547 _num_total_archived_objs = 0;
1548 _num_total_recorded_klasses = 0;
1549 _num_total_verifications = 0;
1550
1551 // For each class X that has one or more archived fields:
1552 // [1] Dump the subgraph of each archived field
1553 // [2] Create a list of all the class of the objects that can be reached
1554 // by any of these static fields.
1555 // At runtime, these classes are initialized before X's archived fields
1556 // are restored by HeapShared::initialize_from_archived_subgraph().
1557 for (int i = 0; fields[i].valid(); ) {
1558 ArchivableStaticFieldInfo* info = &fields[i];
1559 const char* klass_name = info->klass_name;
1560
1561 if (CDSConfig::is_valhalla_preview() && strcmp(klass_name, "jdk/internal/module/ArchivedModuleGraph") == 0) {
1562 // FIXME -- ArchivedModuleGraph doesn't work when java.base is patched with valhalla classes.
1563 i++;
1564 continue;
1565 }
1566
1567 start_recording_subgraph(info->klass, klass_name, is_full_module_graph);
1568
1569 // If you have specified consecutive fields of the same klass in
1570 // fields[], these will be archived in the same
1571 // {start_recording_subgraph ... done_recording_subgraph} pass to
1572 // save time.
1573 for (; fields[i].valid(); i++) {
1574 ArchivableStaticFieldInfo* f = &fields[i];
1575 if (f->klass_name != klass_name) {
1576 break;
1577 }
1578
1579 archive_reachable_objects_from_static_field(f->klass, f->klass_name,
1580 f->offset, f->field_name);
1581 }
1582 done_recording_subgraph(info->klass, klass_name);
1583 }
1584
1585 log_info(cds, heap)("Archived subgraph records = %d",
1586 _num_total_subgraph_recordings);
|