RFR: 8263399: CDS should archive only classes allowed by module system [v3]

Ioi Lam iklam at openjdk.java.net
Sun Mar 14 06:05:26 UTC 2021


> `ClassListParser::load_current_class()` tries to archive a boot class from `-Xbootclasspath/a` into the unnamed package, even if the module system forbids this class from being defined in the unnamed package.
> 
> Such classes, even if archived, won't be usable at runtime anyway. The only test case affected by this code is test/hotspot/jtreg/runtime/cds/appcds/jigsaw/classpathtests/BootAppendTests.java, which asserts that such class must be archived, but also asserts that such archived classes cannot be used at runtime. So the first assert seems unnecessary and should be removed.
> 
> The main change is in classListParser.cpp.
> 
> The change in metaspaceShared.cpp is necessary because the `Preload Warning: Cannot find %s"` message was sometimes printed only in the code path that I've deleted.

Ioi Lam 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 five additional commits since the last revision:

 - Merge branch 'master' into 8263399-archive-only-classes-allowed-by-modules
 - Merge branch 'master' into 8263399-archive-only-classes-allowed-by-modules
 - improved comments per @calvinccheung review
 - Merge branch 'master' of https://github.com/openjdk/jdk into 8263399-archive-only-classes-allowed-by-modules
 - 8263399: CDS should archive only classes allowed by module system

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2929/files
  - new: https://git.openjdk.java.net/jdk/pull/2929/files/597e115f..41511fcf

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2929&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2929&range=01-02

  Stats: 7192 lines in 1055 files changed: 3425 ins; 1598 del; 2169 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2929.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2929/head:pull/2929

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


More information about the hotspot-runtime-dev mailing list