RFR: 8334898: Resolve static field/method references at CDS dump time

Ioi Lam iklam at openjdk.org
Fri Oct 24 05:40:01 UTC 2025


On Thu, 23 Oct 2025 18:56:44 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:

> This patch pre-resolves constant pool entries referred by getstatic, putstatic and invokestatic bytecodes in the assembly phase.
> It also extends ResolvedConstants.java test to run in AOT mode workflow and additional test for checking resolution of static CP entries.
> 
> Before this PR, stats on pre-resolved CP entries in the assembly phase reported by -Xlog:aot=info:
> 
> [2.161s][info ][aot        ] Class  CP entries =  12553, archived =   3707 ( 29.5%), reverted =      0
> [2.161s][info ][aot        ] Field  CP entries =   5236, archived =   1355 ( 25.9%), reverted =      0
> [2.161s][info ][aot        ] Method CP entries =   3835, archived =   3818 ( 99.6%), reverted =     17
> [2.161s][info ][aot        ] Indy   CP entries =      9, archived =      9 (100.0%), reverted =      0
> 
> 
> After this PR:
> 
> 2.323s][info ][aot        ] Class  CP entries =  12553, archived =   3700 ( 29.5%), reverted =      0
> [2.323s][info ][aot        ] Field  CP entries =   5236, archived =   3519 ( 67.2%), reverted =      0
> [2.323s][info ][aot        ] Method CP entries =  21027, archived =   5527 ( 26.3%), reverted =     17
> [2.323s][info ][aot        ] Indy   CP entries =    353, archived =      9 (  2.5%), reverted =      0

The zero builds fail with the following:


Creating jdk-26-internal_linux-x64_bin-tests-debug.tar.gz
Creating interim jimage
Compiling up to 2 files for CLASSLIST_JAR
Creating support/classlist.jar
ERROR: Failed to generate link optimization data. This is likely a problem with the newly built JVM/JDK.
Error occurred during initialization of VM
java.lang.InternalError: platform encoding not initialized
	at jdk.internal.util.SystemProps$Raw.platformProperties(java.base/Native Method)
	at jdk.internal.util.SystemProps$Raw.<init>(java.base/SystemProps.java:266)
	at jdk.internal.util.SystemProps.initProperties(java.base/SystemProps.java:67)
	at java.lang.System.initPhase1(java.base/System.java:1784)

GenerateLinkOptData.gmk:74: recipe for target '/workspace/build/linux-x64-zero-debug/support/link_opt/classlist' failed
make[3]: *** [/workspace/build/linux-x64-zero-debug/support/link_opt/classlist] Error 1
make/Main.gmk:657: recipe for target 'generate-link-opt-data' failed
make[2]: *** [generate-link-opt-data] Error 2

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

PR Comment: https://git.openjdk.org/jdk/pull/27958#issuecomment-3441133131


More information about the hotspot-dev mailing list