< prev index next >

src/hotspot/share/cds/heapShared.cpp

Print this page

2009   }
2010 }
2011 
2012 void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
2013                                           bool is_full_module_graph) {
2014   _num_total_subgraph_recordings = 0;
2015   _num_total_walked_objs = 0;
2016   _num_total_archived_objs = 0;
2017   _num_total_recorded_klasses = 0;
2018   _num_total_verifications = 0;
2019 
2020   // For each class X that has one or more archived fields:
2021   // [1] Dump the subgraph of each archived field
2022   // [2] Create a list of all the class of the objects that can be reached
2023   //     by any of these static fields.
2024   //     At runtime, these classes are initialized before X's archived fields
2025   //     are restored by HeapShared::initialize_from_archived_subgraph().
2026   for (int i = 0; fields[i].valid(); ) {
2027     ArchivableStaticFieldInfo* info = &fields[i];
2028     const char* klass_name = info->klass_name;







2029     start_recording_subgraph(info->klass, klass_name, is_full_module_graph);
2030 
2031     // If you have specified consecutive fields of the same klass in
2032     // fields[], these will be archived in the same
2033     // {start_recording_subgraph ... done_recording_subgraph} pass to
2034     // save time.
2035     for (; fields[i].valid(); i++) {
2036       ArchivableStaticFieldInfo* f = &fields[i];
2037       if (f->klass_name != klass_name) {
2038         break;
2039       }
2040 
2041       archive_reachable_objects_from_static_field(f->klass, f->klass_name,
2042                                                   f->offset, f->field_name);
2043     }
2044     done_recording_subgraph(info->klass, klass_name);
2045   }
2046 
2047   log_info(cds, heap)("Archived subgraph records = %d",
2048                       _num_total_subgraph_recordings);

2009   }
2010 }
2011 
2012 void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
2013                                           bool is_full_module_graph) {
2014   _num_total_subgraph_recordings = 0;
2015   _num_total_walked_objs = 0;
2016   _num_total_archived_objs = 0;
2017   _num_total_recorded_klasses = 0;
2018   _num_total_verifications = 0;
2019 
2020   // For each class X that has one or more archived fields:
2021   // [1] Dump the subgraph of each archived field
2022   // [2] Create a list of all the class of the objects that can be reached
2023   //     by any of these static fields.
2024   //     At runtime, these classes are initialized before X's archived fields
2025   //     are restored by HeapShared::initialize_from_archived_subgraph().
2026   for (int i = 0; fields[i].valid(); ) {
2027     ArchivableStaticFieldInfo* info = &fields[i];
2028     const char* klass_name = info->klass_name;
2029 
2030     if (CDSConfig::is_valhalla_preview() && strcmp(klass_name, "jdk/internal/module/ArchivedModuleGraph") == 0) {
2031       // FIXME -- ArchivedModuleGraph doesn't work when java.base is patched with valhalla classes.
2032       i++;
2033       continue;
2034     }
2035 
2036     start_recording_subgraph(info->klass, klass_name, is_full_module_graph);
2037 
2038     // If you have specified consecutive fields of the same klass in
2039     // fields[], these will be archived in the same
2040     // {start_recording_subgraph ... done_recording_subgraph} pass to
2041     // save time.
2042     for (; fields[i].valid(); i++) {
2043       ArchivableStaticFieldInfo* f = &fields[i];
2044       if (f->klass_name != klass_name) {
2045         break;
2046       }
2047 
2048       archive_reachable_objects_from_static_field(f->klass, f->klass_name,
2049                                                   f->offset, f->field_name);
2050     }
2051     done_recording_subgraph(info->klass, klass_name);
2052   }
2053 
2054   log_info(cds, heap)("Archived subgraph records = %d",
2055                       _num_total_subgraph_recordings);
< prev index next >