RFR[S] 8209545 Simplify HeapShared::archive_module_graph_objects

Jiangli Zhou jiangli.zhou at oracle.com
Thu Aug 16 01:09:28 UTC 2018


Hi Ioi,

Thanks a lot for the clean up! This looks good and is a helpful step 
towards providing the Java API for registering the graph entry points 
(in the near future)! Glad to see the C++ classes being removed from 
javaClasses.cpp.

Thanks again!

Jiangli


On 8/15/18 11:48 AM, Ioi Lam wrote:
> https://bugs.openjdk.java.net/browse/JDK-8209545
> http://cr.openjdk.java.net/~iklam/jdk12/8209545_cleanup_archive_module_graph_objects.v01/ 
>
>
> 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 
> doing!
>   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
>
> Thanks
> - Ioi



More information about the hotspot-runtime-dev mailing list