RFR: 8271420: Extend CDS custom loader support to Windows platform

Calvin Cheung ccheung at openjdk.java.net
Tue Nov 2 18:29:15 UTC 2021


On Tue, 2 Nov 2021 00:41:13 GMT, Yumin Qi <minqi at openjdk.org> wrote:

> Currently CDS does not support custom loaders on Windows, this patch extends  the support to Windows 64 bit platform.
> 
> Tests: mach5 tier1-4
> 
> Thanks
> Yumin

I have couple of comments.

src/hotspot/share/cds/heapShared.cpp line 283:

> 281:   }
> 282: 
> 283:   int len = (int)obj->size();

`obj->size()` already returns an `int` so I don't think the typecast is needed.
I agree with Ioi that this file shouldn't be changed.

test/hotspot/jtreg/runtime/cds/appcds/test-classes/CustomAppLoader.java line 43:

> 41:     public static void main(String args[]) throws Throwable {
> 42:         File f = new File(args[0]);
> 43:         URL[] classLoaderUrls = new URL[] {f.toURI().toURL()};

Not sure if the above can handle relative path.
It is better to set f as follows:
`File f = Path.of(args[0]).toRealPath().toFile();`
Before the above, there should be a check if the length of args is 1.

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

Changes requested by ccheung (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/6202


More information about the hotspot-runtime-dev mailing list