RFR[S] 8209545 Simplify HeapShared::archive_module_graph_objects

Ioi Lam ioi.lam at oracle.com
Wed Aug 15 18:48:47 UTC 2018


With this cleanup, HeapShared::archive_module_graph_objects is driven by
a simple table like the following.

To archive new static fields, now you can just modify Java code, and 
make a single
edit in the C code.

The keyword here is "you should know what you're doing" :-)

   // If you add new entries to this table, you should know what you're 
   static ArchivableStaticFieldInfo archivable_static_fields[] = {
     {"jdk/internal/module/ArchivedModuleGraph", "archivedSystemModules"},
     {"jdk/internal/module/ArchivedModuleGraph", "archivedModuleFinder"},
     {"jdk/internal/module/ArchivedModuleGraph", "archivedMainModule"},
     {"jdk/internal/module/ArchivedModuleGraph", "archivedConfiguration"},
     {"java/util/ImmutableCollections$ListN",     "EMPTY_LIST"},
     {"java/util/ImmutableCollections$MapN",      "EMPTY_MAP"},
     {"java/util/ImmutableCollections$SetN",      "EMPTY_SET"},
     {"java/lang/Integer$IntegerCache",           "archivedCache"},
     {"java/lang/module/Configuration", "EMPTY_CONFIGURATION"},

I was able to removed a bunch of boilerplate code in javaClasses, as 
well as some
unused stuff in vmSymbols and systemDictionary.

Testing with hs tiers 1/2

- Ioi

More information about the hotspot-runtime-dev mailing list