1592 }
1593 }
1594
1595 void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
1596 bool is_full_module_graph) {
1597 _num_total_subgraph_recordings = 0;
1598 _num_total_walked_objs = 0;
1599 _num_total_archived_objs = 0;
1600 _num_total_recorded_klasses = 0;
1601 _num_total_verifications = 0;
1602
1603 // For each class X that has one or more archived fields:
1604 // [1] Dump the subgraph of each archived field
1605 // [2] Create a list of all the class of the objects that can be reached
1606 // by any of these static fields.
1607 // At runtime, these classes are initialized before X's archived fields
1608 // are restored by HeapShared::initialize_from_archived_subgraph().
1609 for (int i = 0; fields[i].valid(); ) {
1610 ArchivableStaticFieldInfo* info = &fields[i];
1611 const char* klass_name = info->klass_name;
1612 start_recording_subgraph(info->klass, klass_name, is_full_module_graph);
1613
1614 // If you have specified consecutive fields of the same klass in
1615 // fields[], these will be archived in the same
1616 // {start_recording_subgraph ... done_recording_subgraph} pass to
1617 // save time.
1618 for (; fields[i].valid(); i++) {
1619 ArchivableStaticFieldInfo* f = &fields[i];
1620 if (f->klass_name != klass_name) {
1621 break;
1622 }
1623
1624 archive_reachable_objects_from_static_field(f->klass, f->klass_name,
1625 f->offset, f->field_name);
1626 }
1627 done_recording_subgraph(info->klass, klass_name);
1628 }
1629
1630 log_info(cds, heap)("Archived subgraph records = %d",
1631 _num_total_subgraph_recordings);
|
1592 }
1593 }
1594
1595 void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
1596 bool is_full_module_graph) {
1597 _num_total_subgraph_recordings = 0;
1598 _num_total_walked_objs = 0;
1599 _num_total_archived_objs = 0;
1600 _num_total_recorded_klasses = 0;
1601 _num_total_verifications = 0;
1602
1603 // For each class X that has one or more archived fields:
1604 // [1] Dump the subgraph of each archived field
1605 // [2] Create a list of all the class of the objects that can be reached
1606 // by any of these static fields.
1607 // At runtime, these classes are initialized before X's archived fields
1608 // are restored by HeapShared::initialize_from_archived_subgraph().
1609 for (int i = 0; fields[i].valid(); ) {
1610 ArchivableStaticFieldInfo* info = &fields[i];
1611 const char* klass_name = info->klass_name;
1612
1613 if (CDSConfig::is_valhalla_preview() && strcmp(klass_name, "jdk/internal/module/ArchivedModuleGraph") == 0) {
1614 // FIXME -- ArchivedModuleGraph doesn't work when java.base is patched with valhalla classes.
1615 i++;
1616 continue;
1617 }
1618
1619 start_recording_subgraph(info->klass, klass_name, is_full_module_graph);
1620
1621 // If you have specified consecutive fields of the same klass in
1622 // fields[], these will be archived in the same
1623 // {start_recording_subgraph ... done_recording_subgraph} pass to
1624 // save time.
1625 for (; fields[i].valid(); i++) {
1626 ArchivableStaticFieldInfo* f = &fields[i];
1627 if (f->klass_name != klass_name) {
1628 break;
1629 }
1630
1631 archive_reachable_objects_from_static_field(f->klass, f->klass_name,
1632 f->offset, f->field_name);
1633 }
1634 done_recording_subgraph(info->klass, klass_name);
1635 }
1636
1637 log_info(cds, heap)("Archived subgraph records = %d",
1638 _num_total_subgraph_recordings);
|