< prev index next >

src/hotspot/share/cds/heapShared.cpp

Print this page

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







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

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