< prev index next >

src/hotspot/share/cds/heapShared.cpp

Print this page

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







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

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