1969 }
1970 }
1971
1972 void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
1973 bool is_full_module_graph) {
1974 _num_total_subgraph_recordings = 0;
1975 _num_total_walked_objs = 0;
1976 _num_total_archived_objs = 0;
1977 _num_total_recorded_klasses = 0;
1978 _num_total_verifications = 0;
1979
1980 // For each class X that has one or more archived fields:
1981 // [1] Dump the subgraph of each archived field
1982 // [2] Create a list of all the class of the objects that can be reached
1983 // by any of these static fields.
1984 // At runtime, these classes are initialized before X's archived fields
1985 // are restored by HeapShared::initialize_from_archived_subgraph().
1986 for (int i = 0; fields[i].valid(); ) {
1987 ArchivableStaticFieldInfo* info = &fields[i];
1988 const char* klass_name = info->klass_name;
1989 start_recording_subgraph(info->klass, klass_name, is_full_module_graph);
1990
1991 // If you have specified consecutive fields of the same klass in
1992 // fields[], these will be archived in the same
1993 // {start_recording_subgraph ... done_recording_subgraph} pass to
1994 // save time.
1995 for (; fields[i].valid(); i++) {
1996 ArchivableStaticFieldInfo* f = &fields[i];
1997 if (f->klass_name != klass_name) {
1998 break;
1999 }
2000
2001 archive_reachable_objects_from_static_field(f->klass, f->klass_name,
2002 f->offset, f->field_name);
2003 }
2004 done_recording_subgraph(info->klass, klass_name);
2005 }
2006
2007 log_info(cds, heap)("Archived subgraph records = %d",
2008 _num_total_subgraph_recordings);
|
1969 }
1970 }
1971
1972 void HeapShared::archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
1973 bool is_full_module_graph) {
1974 _num_total_subgraph_recordings = 0;
1975 _num_total_walked_objs = 0;
1976 _num_total_archived_objs = 0;
1977 _num_total_recorded_klasses = 0;
1978 _num_total_verifications = 0;
1979
1980 // For each class X that has one or more archived fields:
1981 // [1] Dump the subgraph of each archived field
1982 // [2] Create a list of all the class of the objects that can be reached
1983 // by any of these static fields.
1984 // At runtime, these classes are initialized before X's archived fields
1985 // are restored by HeapShared::initialize_from_archived_subgraph().
1986 for (int i = 0; fields[i].valid(); ) {
1987 ArchivableStaticFieldInfo* info = &fields[i];
1988 const char* klass_name = info->klass_name;
1989
1990 if (CDSConfig::is_valhalla_preview() && strcmp(klass_name, "jdk/internal/module/ArchivedModuleGraph") == 0) {
1991 // FIXME -- ArchivedModuleGraph doesn't work when java.base is patched with valhalla classes.
1992 i++;
1993 continue;
1994 }
1995
1996 start_recording_subgraph(info->klass, klass_name, is_full_module_graph);
1997
1998 // If you have specified consecutive fields of the same klass in
1999 // fields[], these will be archived in the same
2000 // {start_recording_subgraph ... done_recording_subgraph} pass to
2001 // save time.
2002 for (; fields[i].valid(); i++) {
2003 ArchivableStaticFieldInfo* f = &fields[i];
2004 if (f->klass_name != klass_name) {
2005 break;
2006 }
2007
2008 archive_reachable_objects_from_static_field(f->klass, f->klass_name,
2009 f->offset, f->field_name);
2010 }
2011 done_recording_subgraph(info->klass, klass_name);
2012 }
2013
2014 log_info(cds, heap)("Archived subgraph records = %d",
2015 _num_total_subgraph_recordings);
|