RFR: 8279366: CDS should allow alternative locations for JAR files in classpath [v2]

Calvin Cheung ccheung at openjdk.org
Tue Oct 18 20:32:50 UTC 2022


On Mon, 17 Oct 2022 20:23:52 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> 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
>
> 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.

Fixed.

> 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`?

Done.

> 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`?

Done.

> src/hotspot/share/cds/filemap.cpp line 1280:
> 
>> 1278:     }
>> 1279: 
>> 1280:     if (!check_common_app_classpath()) {
> 
> How about `check_common_app_classpath_prefix_len()`?

Done.
I also did similar renaming in cdsConstants.cpp and CDSArchiveUtils.java.
Also added more tests for testing single app class path case.

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

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


More information about the hotspot-runtime-dev mailing list