RFR: 8291840: Avoid JavaCalls for setting up _java_system_loader and _java_platform_loader

Ioi Lam iklam at openjdk.org
Wed Aug 3 23:09:57 UTC 2022


On Wed, 3 Aug 2022 19:04:56 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

> Please review this small optimization for setting up the `_java_system_loader `and `_java_platform_loader`.
> 
> I saw startup perf improvements with HelloWorld on linux-x64 like the following:
> 
> 
> instr delta =      -102248    -0.1226%
> time  delta =       -0.125 ms -0.3507%
> 
> 
> Passed tiers 1,2,3 testing.

src/hotspot/share/classfile/systemDictionary.cpp line 134:

> 132: 
> 133:     _java_system_loader = OopHandle(Universe::vm_global(), result.get_oop());
> 134:   }

To check that the we correctly restored _java_system_loader from CDS, I think we should move the Java upcall to a worker function and add some asserts:


if (_java_system_loader.is_empty()) {
    _java_system_loader = get_system_classloader_impl();
} else {
   // It must have been restored from the archived module graph
   assert(UseSharedSpaces, "must be");
   assert(MetaspaceShared::use_full_module_graph(). "must be");
   assert(_java_system_loader.resolve() == get_system_classloader_impl(), "must be");
}

-------------

PR: https://git.openjdk.org/jdk/pull/9734


More information about the hotspot-runtime-dev mailing list