< prev index next >

src/hotspot/share/cds/heapShared.cpp

Print this page

1599   }
1600 }
1601 
1602 void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
1603                                           bool is_full_module_graph) {
1604   _num_total_subgraph_recordings = 0;
1605   _num_total_walked_objs = 0;
1606   _num_total_archived_objs = 0;
1607   _num_total_recorded_klasses = 0;
1608   _num_total_verifications = 0;
1609 
1610   // For each class X that has one or more archived fields:
1611   // [1] Dump the subgraph of each archived field
1612   // [2] Create a list of all the class of the objects that can be reached
1613   //     by any of these static fields.
1614   //     At runtime, these classes are initialized before X's archived fields
1615   //     are restored by HeapShared::initialize_from_archived_subgraph().
1616   for (int i = 0; fields[i].valid(); ) {
1617     ArchivableStaticFieldInfo* info = &fields[i];
1618     const char* klass_name = info->klass_name;







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);

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