RFR: 8279366: CDS should allow alternative locations for JAR files in classpath [v2]
Ioi Lam
iklam at openjdk.org
Mon Oct 17 22:21:07 UTC 2022
On Fri, 14 Oct 2022 16:51:10 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> Please review this RFE for allowing alternative locations for jar files in the app classpath during runtime.
>>
>> During dump time, the longest common prefix of the app classpath will be stored in the CDS archive header. During runtime, existing checks of the app classpath will be performed first. Upon failure, the longest common prefix of the runtime app classpath will be computed and another check of the app classpath will be performed ignoring the longest common prefix.
>>
>> Refer to the [bug report comment](https://bugs.openjdk.org/browse/JDK-8279366?focusedCommentId=14509536&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14509536) for an example.
>>
>> Passed tiers 1 - 4 testing (including the new tests).
>
> Calvin Cheung has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>
> - not storing the common app path string in the archive header
> - Merge branch 'master' into 8279366-longest-common-prefix
> - remove trailing whitespace
> - 8279366: CDS should allow alternative locations for JAR files in classpath
Changes requested by iklam (Reviewer).
src/hotspot/share/cds/filemap.cpp line 208:
> 206: size_t base_archive_name_offset = 0;
> 207: size_t longest_common_prefix_size = 0;
> 208: size_t longest_common_prefix_offset = 0;
This variable can also be removed.
src/hotspot/share/cds/filemap.cpp line 887:
> 885: }
> 886:
> 887: bool FileMapInfo::check_paths_ignoring_common_path(int shared_path_start_idx, int num_paths,
I think we should use the word "prefix" in the names. This way, it's clear that we are talking about a portion of a path string. How about `check_paths_ignoring_common_prefix`?
src/hotspot/share/cds/filemap.cpp line 1033:
> 1031: if (mismatch) {
> 1032: unsigned int dumptime_prefix_len = header()->common_app_classpath_size();
> 1033: unsigned int runtime_prefix_len = longest_common_app_classpath_len(shared_app_paths_len, rp_array);
How about `header()->common_app_classpath_prefix_size()` and `longest_common_app_classpath_prefix_len`?
src/hotspot/share/cds/filemap.cpp line 1280:
> 1278: }
> 1279:
> 1280: if (!check_common_app_classpath()) {
How about `check_common_app_classpath_prefix_len()`?
-------------
PR: https://git.openjdk.org/jdk/pull/10615
More information about the hotspot-runtime-dev
mailing list