RFR: 8338530: CDS warning Skipping java/lang/invoke/BoundMethodHandle$Species_LLLL [v2]

Claes Redestad redestad at openjdk.org
Wed Sep 4 22:19:59 UTC 2024


On Wed, 4 Sep 2024 16:29:51 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> Since [JDK-8336856](https://bugs.openjdk.org/browse/JDK-8336856), `java -Xshare:dump` reports a warning where a dynamically generated class, java/lang/invoke/BoundMethodHandle$Species_LLLL, is excluded. This patch silently excludes the class as it cannot be archived. Verified with tier 1-5 tests
>
> Matias Saavedra Silva has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Updated test copyright
>  - Added to test

So there is a method reference to `Class::getClassLoader()` (which is `@CallerSensitive`) in `KnownLevel`, and the bootstrapping and linking for that leads to spinning up of a set of MHs and the `Species_LLLL` class. Desugaring that lambda gets rid of the warning. It seems we take slightly different paths when running `-Xshare:dump` than when we run the `HelloClasslist` since it appears this is a lambda the build time thing captures. Different privileges of the `Lookup` object could explain this.

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

PR Comment: https://git.openjdk.org/jdk/pull/20799#issuecomment-2330248731


More information about the hotspot-dev mailing list