RFR: 8345936: Call ClassLoader.getResourceAsByteArray only for multi-release jar

Ioi Lam iklam at openjdk.org
Thu Dec 12 00:32:37 UTC 2024


On Thu, 12 Dec 2024 00:10:39 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

> This patch stores whether a jar is multi-release in the SharedClassPathEntry during CDS dump time.
> At runtime, it only calls ClassLoader.getResourceAsByteArray if the jar is a multi-release jar.
> As a result, the number of java calls is reduced.
> 
> Passed tiers 1, 3, 4 testing.

Looks good overall. I have one suggestion for simplification.

src/hotspot/share/classfile/classLoader.cpp line 859:

> 857:     bool is_multi_release = ClassLoaderExt::process_jar_manifest(current, entry);
> 858:     if (is_multi_release) {
> 859:       entry->set_multi_release_jar();

Maybe the set_multi_release_jar() call should be moved into process_jar_manifest()? That way, the logic doesn't need to be split in two places.

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

Changes requested by iklam (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/22696#pullrequestreview-2497303524
PR Review Comment: https://git.openjdk.org/jdk/pull/22696#discussion_r1881193821


More information about the hotspot-runtime-dev mailing list