Re: RFR: 8342283: CDS cannot handle a large number of classes

2025-04-25 Thread Calvin Cheung
On Fri, 25 Apr 2025 14:49:37 GMT, Aleksey Shipilev wrote: > CDS cannot handle large number of classes, because `ClassLoader` data > structures get too large for CDS archival. The new test captures such an > occasion. We do `clear()`-s, but that is not enough to trim the backing > storages for

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking

2025-04-25 Thread Calvin Cheung
On Fri, 18 Apr 2025 01:41:36 GMT, Ioi Lam wrote: >>> Do we have a test case where `--add-opens` is used both at dump time and >>> run time? That will verify that `--add-opens` at dump time is correctly >>> processed. >>> >> >> Yes, the new test `AddopensOption.java` uses the `--add-opens` bot

Integrated: 8352003: Support --add-opens with -XX:+AOTClassLinking

2025-04-25 Thread Calvin Cheung
On Wed, 16 Apr 2025 18:21:41 GMT, Calvin Cheung wrote: > This RFE allows --add-opens to be specified for AOT cache creation. AOT cache > can be used during production run with --add-opens option as long as the same > set of options is used during assembly phase. > > Passed tier

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking [v7]

2025-04-24 Thread Calvin Cheung
> This RFE allows --add-opens to be specified for AOT cache creation. AOT cache > can be used during production run with --add-opens option as long as the same > set of options is used during assembly phase. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated t

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking [v6]

2025-04-22 Thread Calvin Cheung
> This RFE allows --add-opens to be specified for AOT cache creation. AOT cache > can be used during production run with --add-opens option as long as the same > set of options is used during assembly phase. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated t

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking [v5]

2025-04-21 Thread Calvin Cheung
> This RFE allows --add-opens to be specified for AOT cache creation. AOT cache > can be used during production run with --add-opens option as long as the same > set of options is used during assembly phase. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated t

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking [v3]

2025-04-21 Thread Calvin Cheung
On Mon, 21 Apr 2025 18:39:39 GMT, Ioi Lam wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @iklam comment > > src/java.base/share/classes/jdk/internal/module/ModuleBoot

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking [v4]

2025-04-21 Thread Calvin Cheung
> This RFE allows --add-opens to be specified for AOT cache creation. AOT cache > can be used during production run with --add-opens option as long as the same > set of options is used during assembly phase. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated t

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking

2025-04-20 Thread Calvin Cheung
On Fri, 18 Apr 2025 01:41:36 GMT, Ioi Lam wrote: > > AddopensOption.java only checks if the --add-opens is accepted. It doesn't > check if the option has any effect. I think it's better to run `TEST_MODULE1` > to make sure that `setAccessible` can be called without throwing an > exception. Th

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking [v3]

2025-04-20 Thread Calvin Cheung
> This RFE allows --add-opens to be specified for AOT cache creation. AOT cache > can be used during production run with --add-opens option as long as the same > set of options is used during assembly phase. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated t

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking

2025-04-17 Thread Calvin Cheung
On Thu, 17 Apr 2025 21:21:22 GMT, Ioi Lam wrote: > Do we have a test case where `--add-opens` is used both at dump time and run > time? That will verify that `--add-opens` at dump time is correctly processed. > Yes, the new test `AddopensOption.java` uses the `--add-opens` both at dump time a

Re: RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking [v2]

2025-04-17 Thread Calvin Cheung
> This RFE allows --add-opens to be specified for AOT cache creation. AOT cache > can be used during production run with --add-opens option as long as the same > set of options is used during assembly phase. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated t

Re: RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v10]

2025-04-17 Thread Calvin Cheung
On Thu, 17 Apr 2025 07:38:27 GMT, Timofei Pushkin wrote: >> test/hotspot/jtreg/runtime/cds/appcds/customLoader/RegUnregSuperTest.java >> line 77: >> >>> 75: out.shouldContain("CustomLoadee3Child (id 3) has super-type >>> CustomLoadee3 (id 1) overshadowed by another class with the s

Re: RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v10]

2025-04-16 Thread Calvin Cheung
On Wed, 16 Apr 2025 14:34:25 GMT, Timofei Pushkin wrote: >> If a base class is package-private then its subclasses should have the same >> package name and defining class loader, otherwise `IllegalAccessError` is >> thrown when linking a subclass. Currently when dumping a static archive >> sep

Re: RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v8]

2025-04-16 Thread Calvin Cheung
On Wed, 16 Apr 2025 07:50:00 GMT, Timofei Pushkin wrote: >> src/java.base/share/classes/jdk/internal/misc/CDS.java line 390: >> >>> 388: @Override >>> 389: public byte[] readClassFile(String className) throws >>> IOException { >>> 390: final var subPath =

RFR: 8352003: Support --add-opens with -XX:+AOTClassLinking

2025-04-16 Thread Calvin Cheung
This RFE allows --add-opens to be specified for AOT cache creation. AOT cache can be used during production run with --add-opens option as long as the same set of options is used during assembly phase. Passed tiers 1 - 4 testing. - Commit messages: - trailing whitespace - 8352003

Re: RFR: 8352001: AOT cache should not contain classes injected into built-in class loaders [v4]

2025-04-16 Thread Calvin Cheung
On Wed, 16 Apr 2025 17:12:07 GMT, Ioi Lam wrote: >> During an application's training run, it's possible to inject classes into >> the built-in platform/app class loaders with reflection calls. >> >> - Before [JDK-8348426](https://bugs.openjdk.org/browse/JDK-8348426), only >> the names of thes

Re: RFR: 8352001: AOT cache should not contain classes injected into built-in class loaders [v3]

2025-04-16 Thread Calvin Cheung
On Wed, 16 Apr 2025 00:51:23 GMT, Ioi Lam wrote: >> During an application's training run, it's possible to inject classes into >> the built-in platform/app class loaders with reflection calls. >> >> - Before [JDK-8348426](https://bugs.openjdk.org/browse/JDK-8348426), only >> the names of thes

Re: RFR: 8352001: AOT cache should not contain classes injected into built-in class loaders [v2]

2025-04-15 Thread Calvin Cheung
On Sat, 12 Apr 2025 18:37:18 GMT, Ioi Lam wrote: >> During an application's training run, it's possible to inject classes into >> the built-in platform/app class loaders with reflection calls. >> >> - Before [JDK-8348426](https://bugs.openjdk.org/browse/JDK-8348426), only >> the names of thes

Re: RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v8]

2025-04-15 Thread Calvin Cheung
On Mon, 14 Apr 2025 14:04:33 GMT, Timofei Pushkin wrote: >> If a base class is package-private then its subclasses should have the same >> package name and defining class loader, otherwise `IllegalAccessError` is >> thrown when linking a subclass. Currently when dumping a static archive >> sep

Re: RFR: 8352437: Support --add-exports with -XX:+AOTClassLinking

2025-03-24 Thread Calvin Cheung
On Thu, 20 Mar 2025 04:46:21 GMT, Ioi Lam wrote: > `-XX:+AOTClassLinking` requires the CDS archived full module graph (FMG). > > - Before this PR, when `--add-export` is specified, FMG is disabled, so AOT > caches created with `-XX:+AOTClassLinking` cannot be loaded. > - After this PR, if the

Re: RFR: 8348240: Remove SystemDictionaryShared::lookup_super_for_unregistered_class() [v2]

2025-01-23 Thread Calvin Cheung
On Thu, 23 Jan 2025 02:04:33 GMT, Ioi Lam wrote: >> I reimplemented >> `SystemDictionaryShared::lookup_super_for_unregistered_class()` with Java >> code. This removes hacks in >> `SystemDictionary::resolve_with_circularity_detection()` to facilitate >> future clean-ups there that are planned

Re: RFR: 8348240: Remove SystemDictionaryShared::lookup_super_for_unregistered_class()

2025-01-22 Thread Calvin Cheung
On Wed, 22 Jan 2025 03:28:00 GMT, Ioi Lam wrote: > I reimplemented > `SystemDictionaryShared::lookup_super_for_unregistered_class()` with Java > code. This removes hacks in > `SystemDictionary::resolve_with_circularity_detection()` to facilitate future > clean-ups there that are planned by @c

Integrated: 8346132: fallbacklinker.c failed compilation due to unused variable

2024-12-18 Thread Calvin Cheung
On Tue, 17 Dec 2024 21:43:09 GMT, Calvin Cheung wrote: > A simple fix for removing an unused variable in fallbacklinker.c. This is > needed for building zero jvm variant on macosx-x64. > > Testing: > > - [x] tier1 > - [x] zero jvm variant build on macosx-x64 This pull

Re: RFR: 8346132: fallbacklinker.c failed compilation due to unused variable

2024-12-18 Thread Calvin Cheung
On Tue, 17 Dec 2024 21:43:09 GMT, Calvin Cheung wrote: > A simple fix for removing an unused variable in fallbacklinker.c. This is > needed for building zero jvm variant on macosx-x64. > > Testing: > > - [x] tier1 > - [x] zero jvm variant build on macosx-x64 Than

Re: RFR: 8346132: fallbacklinker.cpp failed compilation due to unused variable

2024-12-18 Thread Calvin Cheung
On Wed, 18 Dec 2024 11:58:37 GMT, Jorn Vernee wrote: >> How about the following? >> >> >> jint result = (*VM)->AttachCurrentThreadAsDaemon(VM, (void**) &env, NULL); >> if (result != JNI_OK) { >> fprintf(stderr, "do_upcall trying to attach thread returned %d", result); >> return; >>

Re: RFR: 8346132: fallbacklinker.cpp failed compilation due to unused variable

2024-12-17 Thread Calvin Cheung
On Wed, 18 Dec 2024 05:21:55 GMT, Julian Waters wrote: >> src/java.base/share/native/libfallbackLinker/fallbackLinker.c line 168: >> >>> 166: // attach thread >>> 167: JNIEnv* env; >>> 168: (*VM)->AttachCurrentThreadAsDaemon(VM, (void**) &env, NULL); >> >> I think the variable should be u

RFR: 8346132: fallbacklinker.cpp failed compilation due to unused variable

2024-12-17 Thread Calvin Cheung
A simple fix for removing an unused variable in fallbacklinker.cpp. This is needed for building zero jvm variant on macosx-x64. Testing: - [x] tier1 - [x] zero jvm variant build on macosx-x64 - Commit messages: - 8346132: fallbacklinker.cpp failed compilation due to unused variabl

Integrated: 8343427: Class file load hook crashes on archived classes from multi-release JARs

2024-11-26 Thread Calvin Cheung
On Wed, 20 Nov 2024 00:37:25 GMT, Calvin Cheung wrote: > Currently, when retrieving a ClassFileStream during runtime, we call into the > zip library to retrieve the stream based only on a class name. This doesn't > work well if the class is in a multi-release jar under a versi

Re: RFR: 8343427: Class file load hook crashes on archived classes from multi-release JARs [v6]

2024-11-26 Thread Calvin Cheung
On Tue, 26 Nov 2024 04:06:22 GMT, David Holmes wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> remove assert in filemap.cpp > > Marked as reviewed by dholmes (Reviewer). Thank

Re: RFR: 8343427: Class file load hook crashes on archived classes from multi-release JARs [v4]

2024-11-25 Thread Calvin Cheung
On Tue, 26 Nov 2024 00:29:15 GMT, David Holmes wrote: >> I adapted the asserts from diagnosticCommand.cpp. I'm keeping the first >> assert. Is it ok? > > Both asserts are unnecessary. I've removed the assert. Will run some tests before integrating the fix. Please re-review when you have a chanc

Re: RFR: 8343427: Class file load hook crashes on archived classes from multi-release JARs [v6]

2024-11-25 Thread Calvin Cheung
. To address this issue, this change > calls the java api `ClassLoader.getResourceAsStream()` to retrieve the stream. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: re

Re: RFR: 8343427: Class file load hook crashes on archived classes from multi-release JARs [v5]

2024-11-25 Thread Calvin Cheung
. To address this issue, this change > calls the java api `ClassLoader.getResourceAsStream()` to retrieve the stream. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: @dholmes-ora commen

Re: RFR: 8343427: Class file load hook crashes on archived classes from multi-release JARs [v4]

2024-11-25 Thread Calvin Cheung
On Mon, 25 Nov 2024 04:11:20 GMT, David Holmes wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> update comments > > src/hotspot/share/cds/filemap.cpp line 2718: > >> 2716:

Re: RFR: 8343427: Class file load hook crashes on archived classes from multi-release JARs [v3]

2024-11-22 Thread Calvin Cheung
On Fri, 22 Nov 2024 11:07:31 GMT, Alan Bateman wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @dholmes-ora comment > > src/java.base/share/classes/java/lang/ClassLoader.java l

Re: RFR: 8343427: Class file load hook crashes on archived classes from multi-release JARs [v4]

2024-11-22 Thread Calvin Cheung
. To address this issue, this change > calls the java api `ClassLoader.getResourceAsStream()` to retrieve the stream. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: update comments -

Re: RFR: 8319343: Improve CDS module graph support for --add-modules option [v4]

2024-10-31 Thread Calvin Cheung
On Mon, 28 Oct 2024 16:16:14 GMT, Calvin Cheung wrote: >> Summary of changes: >> >> Before dumping info the archive, all the module names from `--add-modules` >> will be sorted and then concatenated into one string with comma as the >> separator between modul

Integrated: 8319343: Improve CDS module graph support for --add-modules option

2024-10-31 Thread Calvin Cheung
On Wed, 16 Oct 2024 22:46:40 GMT, Calvin Cheung wrote: > Summary of changes: > > Before dumping info the archive, all the module names from `--add-modules` > will be sorted and then concatenated into one string with comma as the > separator between module names. > >

Re: RFR: 8319343: Improve CDS module graph support for --add-modules option [v2]

2024-10-28 Thread Calvin Cheung
On Mon, 28 Oct 2024 09:09:35 GMT, Alan Bateman wrote: >> Thanks, I'll get back to you on but I want see how this will behave with >> ALL-MODULE-PATH as that will sometimes appear in Maven environments. > > I chatted with Calvin about this change. Testing that the root modules > specified to --a

Re: RFR: 8319343: Improve CDS module graph support for --add-modules option [v4]

2024-10-28 Thread Calvin Cheung
o has an addition argument `Set addModules`. It > returns the `archivedModuleGraph` only if both the `mainModule` and the > `addModules` are the same as the input arguments. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit

Re: RFR: 8319343: Improve CDS module graph support for --add-modules option [v2]

2024-10-21 Thread Calvin Cheung
On Mon, 21 Oct 2024 13:17:10 GMT, Alan Bateman wrote: >> Hi Alan, >> I tried your suggestion but it can't handle the `ALL-SYSTEM` case. >> I made some slight adjustments to your patch as follows: >> >> >> /** >> * Returns true if all modules named in the given set are in the >> Config

Re: RFR: 8319343: Improve CDS module graph support for --add-modules option [v3]

2024-10-21 Thread Calvin Cheung
o has an addition argument `Set addModules`. It > returns the `archivedModuleGraph` only if both the `mainModule` and the > `addModules` are the same as the input arguments. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commi

Re: RFR: 8319343: Improve CDS module graph support for --add-modules option [v2]

2024-10-20 Thread Calvin Cheung
On Fri, 18 Oct 2024 11:26:30 GMT, Alan Bateman wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @rose00 comment > > src/java.base/share/classes/jdk/internal/module/ModuleBoot

Re: RFR: 8319343: Improve CDS module graph support for --add-modules option [v2]

2024-10-16 Thread Calvin Cheung
On Wed, 16 Oct 2024 23:18:42 GMT, John R Rose wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @rose00 comment > > src/hotspot/share/classfile/modules.cpp line 697: > >>

Re: RFR: 8319343: Improve CDS module graph support for --add-modules option [v2]

2024-10-16 Thread Calvin Cheung
o has an addition argument `Set addModules`. It > returns the `archivedModuleGraph` only if both the `mainModule` and the > `addModules` are the same as the input arguments. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit si

RFR: 8319343: Improve CDS module graph support for --add-modules option

2024-10-16 Thread Calvin Cheung
Summary of changes: Before dumping info the archive, all the module names from `--add-modules` will be sorted and then concatenated into one string with comma as the separator between module names. During runtime, same function will be used to obtain the string in the same format with sorted m

Integrated: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time

2024-10-02 Thread Calvin Cheung
On Tue, 17 Sep 2024 23:44:40 GMT, Calvin Cheung wrote: > Prior to this patch, if `--module-path` is specified in the command line: > during CDS dump time, full module graph will not be included in the CDS > archive; > during run time, full module graph will not be used. > &g

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v10]

2024-10-02 Thread Calvin Cheung
On Wed, 2 Oct 2024 05:50:14 GMT, Calvin Cheung wrote: >> Prior to this patch, if `--module-path` is specified in the command line: >> during CDS dump time, full module graph will not be included in the CDS >> archive; >> during run time, full module graph will not b

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v9]

2024-10-01 Thread Calvin Cheung
On Wed, 2 Oct 2024 02:13:40 GMT, David Holmes wrote: > Nothing further from me on the VM side. Just a couple of minor nits. > > Thanks I've pushed another commit to address the nits. Thanks! - PR Comment: https://git.openjdk.org/jdk/pull/21048#issuecomment-2387676650

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v10]

2024-10-01 Thread Calvin Cheung
gs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) > in the bug report regarding some changes in the corelib classes. Calvin Cheung has updated the pull request incrementally with one additional commit since the last rev

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v9]

2024-10-01 Thread Calvin Cheung
gs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) > in the bug report regarding some changes in the corelib classes. Calvin Cheung has updated the pull request incrementally with one additional commit since the last r

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v4]

2024-10-01 Thread Calvin Cheung
On Sun, 29 Sep 2024 06:43:42 GMT, Alan Bateman wrote: >> Why does it need to clear `moduleToReader` only for app loader and not for >> platform loader? Is it because the `moduleToReader` for the app loader may >> contain reference to jar files that indirectly references some file system >> obj

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v4]

2024-10-01 Thread Calvin Cheung
On Sun, 29 Sep 2024 04:11:53 GMT, Ioi Lam wrote: >> It should work because the jmod file won't be added to the `module_paths`. > > In my scenario, will the FMG be used? If so, the program won't be able to > load the code in mod2.jmod, so the behavior will be wrong. Could you add a > test case f

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v8]

2024-10-01 Thread Calvin Cheung
gs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) > in the bug report regarding some changes in the corelib classes. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revi

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v7]

2024-09-27 Thread Calvin Cheung
gs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) > in the bug report regarding some changes in the corelib classes. Calvin Cheung has updated the pull request with a new target base due to a merge or a rebase. The pull

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v6]

2024-09-27 Thread Calvin Cheung
gs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) > in the bug report regarding some changes in the corelib classes. Calvin Cheung has updated the pull request incrementally with one additional commit since the last rev

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v5]

2024-09-27 Thread Calvin Cheung
On Fri, 27 Sep 2024 11:11:20 GMT, Alan Bateman wrote: > Do you remember why resetArchivedStates resets the resource cache? I would > expected it to be cleared for all class loaders. > I think it is because `resourceCache` is a `SoftReference` and it will fail the check in `JavaClasses::is_sup

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v4]

2024-09-25 Thread Calvin Cheung
On Wed, 25 Sep 2024 00:11:32 GMT, Ioi Lam wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix indentation > > src/hotspot/share/cds/filemap.cpp line 956: > >> 954: }

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v5]

2024-09-25 Thread Calvin Cheung
gs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) > in the bug report regarding some changes in the corelib classes. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revi

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v3]

2024-09-24 Thread Calvin Cheung
On Tue, 24 Sep 2024 05:06:50 GMT, David Holmes wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> trailing whitespace > > src/java.base/share/classes/jdk/internal/module/ModuleBoot

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v4]

2024-09-24 Thread Calvin Cheung
gs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) > in the bug report regarding some changes in the corelib classes. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revi

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v3]

2024-09-22 Thread Calvin Cheung
On Sat, 21 Sep 2024 06:31:16 GMT, Alan Bateman wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> trailing whitespace > > src/java.base/share/classes/jdk/internal/module/ModuleReferenc

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v3]

2024-09-20 Thread Calvin Cheung
On Wed, 18 Sep 2024 01:15:40 GMT, David Holmes wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> trailing whitespace > > src/hotspot/share/cds/filemap.cpp line 931: > >> 929

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v3]

2024-09-20 Thread Calvin Cheung
gs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) > in the bug report regarding some changes in the corelib classes. Calvin Cheung has updated the pull request incrementally with one additional commit since the last r

Re: RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v2]

2024-09-20 Thread Calvin Cheung
gs.openjdk.org/browse/JDK-8328313?focusedId=14699275&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14699275) > in the bug report regarding some changes in the corelib classes. Calvin Cheung has updated the pull request incrementally with one additional commi

RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time

2024-09-17 Thread Calvin Cheung
Prior to this patch, if `--module-path` is specified in the command line: during CDS dump time, full module graph will not be included in the CDS archive; during run time, full module graph will not be used. With this patch, the full module graph will be included in the CDS archive with the `--mo

Re: RFR: 8338747: hasIncubatorModules needs to be generated when module resolution required at startup

2024-09-11 Thread Calvin Cheung
On Mon, 2 Sep 2024 12:27:21 GMT, Alan Bateman wrote: > This PR proposes changes to the ModuleBootstrap code that is used with CDS > (Ahead-of-Time Class Loading & Linking in the future). At things stand, the > module graph and boot layer can be archived at dump time (-Xshare:dump) when > the i

Re: RFR: 8332340: Add JavacBench as a test case for CDS [v3]

2024-05-21 Thread Calvin Cheung
On Mon, 20 May 2024 17:24:22 GMT, Ioi Lam wrote: >> JavacBench is a test program that compiles 90 Java source files. It uses a >> fair amount of invokedynamic callsites, so it's good for testing CDS support >> for indy and lambda expressions. >> >> This test was first integrated into the >> [

Re: RFR: 8332340: Add JavacBench as a test case for CDS [v2]

2024-05-17 Thread Calvin Cheung
On Thu, 16 May 2024 17:44:22 GMT, Ioi Lam wrote: >> JavacBench is a test program that compiles 90 Java source files. It uses a >> fair amount of invokedynamic callsites, so it's good for testing CDS support >> for indy and lambda expressions. >> >> This test was first integrated into the >> [

Integrated: 8314250: CDS dump error message: Invoker type parameter must start and end with Object: L3I_L

2024-03-11 Thread Calvin Cheung
On Wed, 21 Feb 2024 19:10:16 GMT, Calvin Cheung wrote: > While generating holder classes (in `generateHolderClasses()`), don't add the > `MethodType` to the `invokerTypes` if will fail the check in the `build()` > method which would result in a `RuntimeException`. > &

Re: RFR: 8314250: CDS dump error message: Invoker type parameter must start and end with Object: L3I_L [v2]

2024-03-11 Thread Calvin Cheung
On Fri, 8 Mar 2024 15:58:27 GMT, Ioi Lam wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @iklam comments and copyright update > > Looks good. Just a small nit. Thanks @ikla

Re: RFR: 8314250: CDS dump error message: Invoker type parameter must start and end with Object: L3I_L [v3]

2024-03-11 Thread Calvin Cheung
ethodHandles` to check > that the "Failed to generate LambdaForm holder classes" error is not in the > output; > > Passed tiers 1 - 3 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: remove unused import

Re: RFR: 8314250: CDS dump error message: Invoker type parameter must start and end with Object: L3I_L [v2]

2024-03-11 Thread Calvin Cheung
On Fri, 8 Mar 2024 15:58:16 GMT, Ioi Lam wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @iklam comments and copyright update > > src/java.base/share/classes/java/lang/invoke/Generat

Re: RFR: 8314250: CDS dump error message: Invoker type parameter must start and end with Object: L3I_L [v2]

2024-03-07 Thread Calvin Cheung
ethodHandles` to check > that the "Failed to generate LambdaForm holder classes" error is not in the > output; > > Passed tiers 1 - 3 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: @iklam co

Re: RFR: 8314250: CDS dump error message: Invoker type parameter must start and end with Object: L3I_L

2024-03-07 Thread Calvin Cheung
On Wed, 6 Mar 2024 22:00:42 GMT, Ioi Lam wrote: >> To avoid the CDS dump error message, a fix is during dumping a classlist, >> check if an invoker can be archived. >> If not, don't write the invoker info into the classlist, i.e. don't call >> `logLambdaFormInvoker()`. While generating holder

Re: RFR: 8327138: Clean up status management in cdsConfig.hpp and CDS.java [v4]

2024-03-07 Thread Calvin Cheung
On Thu, 7 Mar 2024 21:00:01 GMT, Ioi Lam wrote: >> A few clean ups: >> >> 1. Rename functions like "`s_loading_full_module_graph()` to >> `is_using_full_module_graph()`. The meaning of "loading" is not clear: it >> might be interpreted as to cover only the period where the artifact is being >

Re: RFR: 8327138: Clean up status management in cdsConfig.hpp and CDS.java

2024-03-05 Thread Calvin Cheung
On Wed, 6 Mar 2024 01:58:26 GMT, Ioi Lam wrote: >> I meant the following. Just the last line #94 needs to be changed - shift >> one space to the left after `bool`. >> >> static bool is_dumping_heap() >> NOT_CDS_JAVA_HEAP_RETURN_(false); >> static void stop_dumping_

RFR: 8314250: CDS dump error message: Invoker type parameter must start and end with Object: L3I_L

2024-03-05 Thread Calvin Cheung
To avoid the CDS dump error message, a fix is during dumping a classlist, check if an invoker can be archived. If not, don't write the invoker info into the classlist, i.e. don't call `logLambdaFormInvoker()`. While generating holder classes (in `generateHolderClasses()`), don't add the `Method

Re: RFR: 8327138: Clean up status management in cdsConfig.hpp and CDS.java

2024-03-05 Thread Calvin Cheung
On Tue, 5 Mar 2024 23:38:21 GMT, Ioi Lam wrote: >> src/hotspot/share/cds/cdsConfig.hpp line 94: >> >>> 92: static bool is_dumping_full_module_graph() { return >>> CDS_ONLY(_is_dumping_full_module_graph) NOT_CDS(false); } >>> 93: static void stop_using_full_module_graph(con

Re: RFR: 8327138: Clean up status management in cdsConfig.hpp and CDS.java

2024-03-05 Thread Calvin Cheung
On Sat, 2 Mar 2024 01:18:06 GMT, Ioi Lam wrote: > A few clean ups: > > 1. Rename functions like "`s_loading_full_module_graph()` to > `is_using_full_module_graph()`. The meaning of "loading" is not clear: it > might be interpreted as to cover only the period where the artifact is being > load

Integrated: 8322322: Support archived full module graph when -Xbootclasspath/a is used

2024-01-04 Thread Calvin Cheung
On Thu, 21 Dec 2023 19:10:59 GMT, Calvin Cheung wrote: > Please review this change for enabling full module graph even when > -Xbootclasspath/a is specified. The validation of -Xbootclasspath/a is > already being done in `FileMapInfo::validate_boot_class_paths()`. The full > modul

Re: RFR: 8322322: Support archived full module graph when -Xbootclasspath/a is used [v2]

2024-01-04 Thread Calvin Cheung
On Sat, 23 Dec 2023 08:08:35 GMT, Alan Bateman wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> comments from Alan and Ioi > > Marked as reviewed by alanb (Reviewer). Thanks @AlanBa

Re: RFR: 8322322: Support archived full module graph when -Xbootclasspath/a is used [v3]

2024-01-02 Thread Calvin Cheung
would > fail without the change. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: tests update per discussion with Ioi - Changes: - all: https://git.openjdk.org/jdk/pull/17178/f

Re: RFR: 8322322: Support archived full module graph when -Xbootclasspath/a is used [v2]

2023-12-22 Thread Calvin Cheung
On Fri, 22 Dec 2023 08:40:08 GMT, Alan Bateman wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> comments from Alan and Ioi > > src/java.base/share/classes/jdk/internal/loader/Class

Re: RFR: 8322322: Support archived full module graph when -Xbootclasspath/a is used [v2]

2023-12-22 Thread Calvin Cheung
would > fail without the change. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: comments from Alan and Ioi - Changes: - all: https://git.openjdk.org/jdk/pull/17178/files

RFR: 8322322: Support archived full module graph when -Xbootclasspath/a is used

2023-12-21 Thread Calvin Cheung
Please review this change for enabling full module graph even when -Xbootclasspath/a is specified. The validation of -Xbootclasspath/a is already being done in `FileMapInfo::validate_boot_class_paths()`. The full module graph will be disabled if there's a mismatch in -Xbootclasspath/a between du

Integrated: 8316969: Improve CDS module graph support for --module option

2023-11-02 Thread Calvin Cheung
On Mon, 2 Oct 2023 22:17:34 GMT, Calvin Cheung wrote: > Please review this changeset for adding support for `--module` (-m) option > for CDS. > Changes in the `ModuleBootstrap.java` are needed so that the > `ArchivedModuleGraph.archive` and `ArchivedBootLayer.archive` are called if

Re: RFR: 8316969: Improve CDS module graph support for --module option [v8]

2023-11-02 Thread Calvin Cheung
On Wed, 1 Nov 2023 11:26:48 GMT, Alan Bateman wrote: >> Calvin Cheung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> more comments from Alan and Ioi; copyright year update > > Marked as reviewe

Re: RFR: 8316969: Improve CDS module graph support for --module option [v9]

2023-11-01 Thread Calvin Cheung
://bugs.openjdk.org/browse/JDK-8266329). More subtask(s) > will be created to support other options such as `--add-modules`. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: cleanup suggested

Re: RFR: 8316969: Improve CDS module graph support for --module option [v6]

2023-10-31 Thread Calvin Cheung
On Fri, 27 Oct 2023 16:34:20 GMT, Ioi Lam wrote: >> Calvin Cheung has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains ten commits: >> >> - Merge master >> - skip archiving full module graph is there is

Re: RFR: 8316969: Improve CDS module graph support for --module option [v8]

2023-10-31 Thread Calvin Cheung
://bugs.openjdk.org/browse/JDK-8266329). More subtask(s) > will be created to support other options such as `--add-modules`. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: more co

Re: RFR: 8316969: Improve CDS module graph support for --module option [v3]

2023-10-31 Thread Calvin Cheung
On Tue, 31 Oct 2023 09:09:37 GMT, Alan Bateman wrote: > Thanks, it looks correctly now. Thanks! > > One small question. At ModuleBootstrap L235 we set canArchive as it's okay to > archive under specific restrictions. For completeness, shouldn't this set > canArchive to CDS.isDumpingStaticArc

Re: RFR: 8316969: Improve CDS module graph support for --module option [v3]

2023-10-30 Thread Calvin Cheung
On Sat, 28 Oct 2023 06:37:00 GMT, Alan Bateman wrote: >> The `ArchivedModuleGraph.java` wasn't changed. So if `-m` is not specified, >> the `archivedModuleGraph` is non-null; if `-m` is specified, the >> `archivedModuleGraph` is null. >> So running `java -version`, the archivedModuleGraph is no

Re: RFR: 8316969: Improve CDS module graph support for --module option [v6]

2023-10-30 Thread Calvin Cheung
On Fri, 27 Oct 2023 16:28:10 GMT, Ioi Lam wrote: >> Calvin Cheung has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains ten commits: >> >> - Merge master >> - skip archiving full module graph is there is

Re: RFR: 8316969: Improve CDS module graph support for --module option [v7]

2023-10-30 Thread Calvin Cheung
://bugs.openjdk.org/browse/JDK-8266329). More subtask(s) > will be created to support other options such as `--add-modules`. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: comments from Ioi a

Re: RFR: 8316969: Improve CDS module graph support for --module option [v3]

2023-10-27 Thread Calvin Cheung
On Fri, 27 Oct 2023 17:40:12 GMT, Alan Bateman wrote: >> I reran the script you sent me few days ago and got the expected results >> with the latest changes. >> The checking of the main module name matches between dump time and runtime >> is performed in the VM code. If an archive (even the def

Re: RFR: 8316969: Improve CDS module graph support for --module option [v3]

2023-10-27 Thread Calvin Cheung
On Fri, 27 Oct 2023 13:57:38 GMT, Alan Bateman wrote: >> I've pushed another update with the following changes: >> >> - in the VM code, skip archiving full module graph if there's an incubator >> module by checking if the ArchivedBootLayer::archivedBootLayer is available; >> - included your sug

Re: RFR: 8316969: Improve CDS module graph support for --module option [v6]

2023-10-26 Thread Calvin Cheung
://bugs.openjdk.org/browse/JDK-8266329). More subtask(s) > will be created to support other options such as `--add-modules`. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits:

Re: RFR: 8316969: Improve CDS module graph support for --module option [v3]

2023-10-26 Thread Calvin Cheung
On Sat, 21 Oct 2023 07:51:42 GMT, Alan Bateman wrote: >>> > Yes, because of the following code further up in the same method: >>> >>> I think what you are actually doing here is supporting archiving of the >>> boot layer when the main module transitively depends on an incubator >>> module. We

Re: RFR: 8316969: Improve CDS module graph support for --module option [v5]

2023-10-26 Thread Calvin Cheung
://bugs.openjdk.org/browse/JDK-8266329). More subtask(s) > will be created to support other options such as `--add-modules`. > > Passed tiers 1 - 4 testing. Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision: skip archiving fu

  1   2   >