Skip to content

Commit 7420ef9

Browse files
committed
Merge master jdk-24+35 into openj9-staging
Signed-off-by: J9 Build <[email protected]>
2 parents 5619cb2 + c1902c8 commit 7420ef9

File tree

22 files changed

+599
-3197
lines changed

22 files changed

+599
-3197
lines changed

make/common/Modules.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -92,7 +92,7 @@ SRC_SUBDIRS += share/classes
9292

9393
SPEC_SUBDIRS += share/specs
9494

95-
MAN_SUBDIRS += share/man
95+
MAN_SUBDIRS += share/man windows/man
9696

9797
# Find all module-info.java files for the current build target platform and
9898
# configuration.

src/java.base/share/classes/java/util/Formatter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2023, Alibaba Group Holding Limited. All Rights Reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -432,7 +432,7 @@
432432
* prefix {@code 'T'} forces this output to upper case.
433433
*
434434
* <tr><th scope="row" style="vertical-align:top">{@code 'z'}
435-
* <td> <a href="http://www.ietf.org/rfc/rfc0822.txt">RFC&nbsp;822</a>
435+
* <td> <a href="https://www.ietf.org/rfc/rfc822.txt">RFC&nbsp;822</a>
436436
* style numeric time zone offset from GMT, e.g. {@code -0800}. This
437437
* value will be adjusted as necessary for Daylight Saving Time. For
438438
* {@code long}, {@link Long}, and {@link Date} the time zone used is
@@ -1720,7 +1720,7 @@
17201720
*
17211721
* <tr><th scope="row" style="vertical-align:top">{@code 'z'}
17221722
* <td style="vertical-align:top"> <code>'&#92;u007a'</code>
1723-
* <td> <a href="http://www.ietf.org/rfc/rfc0822.txt">RFC&nbsp;822</a>
1723+
* <td> <a href="https://www.ietf.org/rfc/rfc822.txt">RFC&nbsp;822</a>
17241724
* style numeric time zone offset from GMT, e.g. {@code -0800}. This
17251725
* value will be adjusted as necessary for Daylight Saving Time. For
17261726
* {@code long}, {@link Long}, and {@link Date} the time zone used is

src/java.base/share/man/java.md

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4011,12 +4011,12 @@ The values for these options (if specified), should be identical when creating a
40114011
CDS archive. Otherwise, if there is a mismatch of any of these options, the CDS archive may be
40124012
partially or completely disabled, leading to lower performance.
40134013

4014-
- If the -XX:+AOTClassLinking options *was* used during CDS archive creation, the CDS archive
4014+
- If the `AOTClassLinking` option (see below) *was* enabled during CDS archive creation, the CDS archive
40154015
cannot be used, and the following error message is printed:
40164016

40174017
`CDS archive has aot-linked classes. It cannot be used when archived full module graph is not used`
40184018

4019-
- If the -XX:+AOTClassLinking options *was not* used during CDS archive creation, the CDS archive
4019+
- If the `AOTClassLinking` option *was not* enabled during CDS archive creation, the CDS archive
40204020
can be used, but the "archived module graph" feature will be disabled. This can lead to increased
40214021
start-up time.
40224022

@@ -4037,6 +4037,115 @@ JVM will execute without loading any CDS archives. In addition, if
40374037
you try to create a CDS archive with any of these 3 options specified,
40384038
the JVM will report an error.
40394039

4040+
## Ahead-of-Time Cache
4041+
4042+
The JDK supports ahead-of-time (AOT) optimizations that can be performed before an
4043+
application is executed. One example is Class Data Sharing (CDS), as described above,
4044+
that parses classes ahead of time. AOT optimizations can improve the start-up and
4045+
warm-up performance of Java applications.
4046+
4047+
The Ahead-of-Time Cache (AOT cache) is a container introduced in JDK 24 for
4048+
storing artifacts produced by AOT optimizations. The AOT cache currently contains
4049+
Java classes and heap objects. In future JDK releases, the AOT cache may contain additional
4050+
artifacts, such as execution profiles and compiled methods.
4051+
4052+
An AOT cache is specific to a combination of the following:
4053+
4054+
- A particular application (as expressed by `-classpath`, `-jar`, or `--module-path`.)
4055+
- A particular JDK release.
4056+
- A particular OS and CPU architecture.
4057+
4058+
If any of the above changes, you must recreate the AOT cache.
4059+
4060+
The deployment of the AOT cache is divided into three phases:
4061+
4062+
- **Training:** We execute the application with a representative work-load
4063+
to gather statistical data that tell us what artifacts should be included
4064+
into the AOT cache. The data are saved in an *AOT Configuration* file.
4065+
4066+
- **Assembly:** We use the AOT Configuration file to produce an AOT cache.
4067+
4068+
- **Production:** We execute the application with the AOT cache for better
4069+
start-up and warm-up performance.
4070+
4071+
The AOT cache can be used with the following command-line options:
4072+
4073+
`-XX:AOTCache:=`*cachefile*
4074+
: Specifies the location of the AOT cache. The standard extension for *cachefile* is `.aot`.
4075+
If `-XX:AOTCache` is specified but `-XX:AOTMode` is not specified,
4076+
then `AOTMode` will be given the value of `auto`.
4077+
4078+
`-XX:AOTConfiguration:=`*configfile*
4079+
: Specifies the AOT Configuration file for the JVM to write to or read from.
4080+
This option can be used only with `-XX:AOTMode=record` and `-XX:AOTMode=create`.
4081+
The standard extension for *configfile* is `.aotconfig`.
4082+
4083+
`-XX:+AOTMode:=`*mode*
4084+
: *mode* must be one of the following: `off`, `record`, `create`, `auto`, or `on`.
4085+
4086+
- `off`: no AOT cache is used.
4087+
4088+
- `record`: Execute the application in the Training phase.
4089+
`-XX:AOTConfiguration=`*configfile* must be specified. The JVM gathers
4090+
statistical data and stores them into *configfile*.
4091+
4092+
- `create`: Perform the Assembly phase. `-XX:AOTConfiguration=`*configfile*
4093+
and `-XX:AOTCache=`*cachefile* must be specified. The JVM reads the statistical
4094+
data from *configfile* and writes the optimization artifacts into *cachefile*.
4095+
Note that the application itself is not executed in this phase.
4096+
4097+
- `auto` or `on`: These modes should be used in the Production phase.
4098+
If `-XX:AOTCache=`*cachefile* is specified, the JVM tries to
4099+
load *cachefile* as the AOT cache. Otherwise, the JVM tries to load
4100+
a *default CDS archive* from the JDK installation directory as the AOT cache.
4101+
4102+
The loading of an AOT cache can fail for a number of reasons:
4103+
4104+
- You are trying to use the AOT cache with an incompatible application, JDK release,
4105+
or OS/CPU.
4106+
4107+
- The specified *cachefile* does not exist or is not accessible.
4108+
4109+
- Incompatible JVM options are used (for example, certain JVMTI options).
4110+
4111+
Since the AOT cache is an optimization feature, there's no guarantee that it will be
4112+
compatible with all possible JVM options. See [JEP 483](https://openjdk.org/jeps/483),
4113+
section **Consistency of training and subsequent runs** for a representative
4114+
list of scenarios that may be incompatible with the AOT cache for JDK 24.
4115+
4116+
These scenarios usually involve arbitrary modification of classes for diagnostic
4117+
purposes and are typically not relevant for production environments.
4118+
4119+
When the AOT cache fails to load:
4120+
4121+
- If `AOTMode` is `auto`, the JVM will continue execution without using the
4122+
AOT cache. This is the recommended mode for production environments, especially
4123+
when you may not have complete control of the command-line (e.g., your
4124+
application's launch script may allow users to inject options to the command-line).
4125+
This allows your application to function correctly, although sometimes it may not
4126+
benefit from the AOT cache.
4127+
4128+
- If `AOTMode` is `on`, the JVM will print an error message and exit immediately. This
4129+
mode should be used only as a "fail-fast" debugging aid to check if your command-line
4130+
options are compatible with the AOT cache. An alternative is to run your application with
4131+
`-XX:AOTMode=auto -Xlog:cds` to see if the AOT cache can be used or not.
4132+
4133+
`-XX:+AOTClassLinking`
4134+
: If this option is enabled, the JVM will perform more advanced optimizations (such
4135+
as ahead-of-time resolution of invokedynamic instructions)
4136+
when creating the AOT cache. As a result, the application will see further improvements
4137+
in start-up and warm-up performance. However, an AOT cache created with this option
4138+
cannot be used when certain command-line parameters are specified in
4139+
the Production phase. Please see [JEP 483](https://openjdk.org/jeps/483) for a
4140+
detailed discussion of `-XX:+AOTClassLinking` and its restrictions.
4141+
4142+
When `-XX:AOTMode` *is used* in the command-line, `AOTClassLinking` is automatically
4143+
enabled. To disable it, you must explicitly pass the `-XX:-AOTClassLinking` option.
4144+
4145+
When `-XX:AOTMode` *is not used* in the command-line, `AOTClassLinking` is disabled by
4146+
default to provide full compatibility with traditional CDS options such as `-Xshare:dump.
4147+
4148+
40404149
## Performance Tuning Examples
40414150

40424151
You can use the Java advanced runtime options to optimize the performance of

src/java.naming/share/classes/com/sun/jndi/ldap/DefaultResponseControlFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* <ul>
3737
* <li>
3838
* Paged results, as defined in
39-
* <a href="http://www.ietf.org/rfc/rfc2696.txt">RFC 2696</a>.
39+
* <a href="https://www.ietf.org/rfc/rfc2696.txt">RFC 2696</a>.
4040
* <li>
4141
* Server-side sorting, as defined in
4242
* <a href="http://www.ietf.org/rfc/rfc2891.txt">RFC 2891</a>.

src/java.naming/share/classes/javax/naming/ldap/PagedResultsControl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
* } </pre>
9393
* <p>
9494
* This class implements the LDAPv3 Control for paged-results as defined in
95-
* <a href="http://www.ietf.org/rfc/rfc2696.txt">RFC 2696</a>.
95+
* <a href="https://www.ietf.org/rfc/rfc2696.txt">RFC 2696</a>.
9696
*
9797
* The control's value has the following ASN.1 definition:
9898
* <pre>{@code

src/java.naming/share/classes/javax/naming/ldap/PagedResultsResponseControl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
4040
* <p>
4141
* This class implements the LDAPv3 Response Control for
4242
* paged-results as defined in
43-
* <a href="http://www.ietf.org/rfc/rfc2696">RFC 2696</a>.
43+
* <a href="https://www.ietf.org/rfc/rfc2696.txt">RFC 2696</a>.
4444
*
4545
* The control's value has the following ASN.1 definition:
4646
* <pre>

src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@
6464
* but may involve techniques such as the <i>positive
6565
* acknowledgment with retransmission</i> technique used in
6666
* protocols such as the Transmission Control Protocol (TCP)
67-
* (see <a href="http://www.ietf.org/rfc/rfc0793.txt"> RFC 793
67+
* (see <a href="https://www.ietf.org/rfc/rfc793.txt"> RFC 793
6868
* </a>).
6969
*
7070
* <p> A transport service can be used to initiate a connection

test/docs/jdk/javadoc/doccheck/ExtLinksJdk.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ http://www.iana.org/assignments/character-sets/character-sets.xhtml
4343
http://www.iana.org/assignments/media-types/
4444
http://www.iana.org/assignments/uri-schemes.html
4545
http://www.ietf.org/
46-
http://www.ietf.org/rfc/rfc0793.txt
47-
http://www.ietf.org/rfc/rfc0822.txt
46+
https://www.ietf.org/rfc/rfc793.txt
47+
https://www.ietf.org/rfc/rfc822.txt
4848
http://www.ietf.org/rfc/rfc1122.txt
4949
http://www.ietf.org/rfc/rfc1123.txt
5050
http://www.ietf.org/rfc/rfc1323.txt
@@ -83,8 +83,7 @@ http://www.ietf.org/rfc/rfc2440.txt
8383
http://www.ietf.org/rfc/rfc2474.txt
8484
http://www.ietf.org/rfc/rfc2609.txt
8585
http://www.ietf.org/rfc/rfc2616.txt
86-
http://www.ietf.org/rfc/rfc2696
87-
http://www.ietf.org/rfc/rfc2696.txt
86+
https://www.ietf.org/rfc/rfc2696.txt
8887
http://www.ietf.org/rfc/rfc2710.txt
8988
http://www.ietf.org/rfc/rfc2732.txt
9089
http://www.ietf.org/rfc/rfc2743.txt

test/hotspot/jtreg/TEST.groups

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -531,14 +531,21 @@ hotspot_aot_classlinking = \
531531
-runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java \
532532
-runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java \
533533
-runtime/cds/appcds/CDSandJFR.java \
534+
-runtime/cds/appcds/customLoader/CustomClassListDump.java \
534535
-runtime/cds/appcds/customLoader/HelloCustom_JFR.java \
536+
-runtime/cds/appcds/customLoader/OldClassAndInf.java \
535537
-runtime/cds/appcds/customLoader/ParallelTestMultiFP.java \
536538
-runtime/cds/appcds/customLoader/ParallelTestSingleFP.java \
537539
-runtime/cds/appcds/customLoader/SameNameInTwoLoadersTest.java \
538540
-runtime/cds/appcds/DumpClassListWithLF.java \
539541
-runtime/cds/appcds/dynamicArchive/ModulePath.java \
542+
-runtime/cds/appcds/dynamicArchive/LambdaCustomLoader.java \
543+
-runtime/cds/appcds/dynamicArchive/LambdaForOldInfInBaseArchive.java \
540544
-runtime/cds/appcds/dynamicArchive/LambdaInBaseArchive.java \
541545
-runtime/cds/appcds/dynamicArchive/LambdasInTwoArchives.java \
546+
-runtime/cds/appcds/dynamicArchive/OldClassAndInf.java \
547+
-runtime/cds/appcds/dynamicArchive/OldClassInBaseArchive.java \
548+
-runtime/cds/appcds/dynamicArchive/OldClassVerifierTrouble.java \
542549
-runtime/cds/appcds/HelloExtTest.java \
543550
-runtime/cds/appcds/javaldr/AnonVmClassesDuringDump.java \
544551
-runtime/cds/appcds/javaldr/GCDuringDump.java \
@@ -559,6 +566,13 @@ hotspot_aot_classlinking = \
559566
-runtime/cds/appcds/jvmti \
560567
-runtime/cds/appcds/LambdaProxyClasslist.java \
561568
-runtime/cds/appcds/loaderConstraints/LoaderConstraintsTest.java \
569+
-runtime/cds/appcds/NestHostOldInf.java \
570+
-runtime/cds/appcds/OldClassTest.java \
571+
-runtime/cds/appcds/OldClassWithjsr.java \
572+
-runtime/cds/appcds/OldInfExtendsInfDefMeth.java \
573+
-runtime/cds/appcds/OldSuperClass.java \
574+
-runtime/cds/appcds/OldSuperInfIndirect.java \
575+
-runtime/cds/appcds/OldSuperInf.java \
562576
-runtime/cds/appcds/redefineClass \
563577
-runtime/cds/appcds/resolvedConstants/AOTLinkedLambdas.java \
564578
-runtime/cds/appcds/resolvedConstants/AOTLinkedVarHandles.java \

test/hotspot/jtreg/runtime/cds/appcds/AOTFlags.java

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -59,7 +59,7 @@ static void positiveTests() throws Exception {
5959
out.shouldContain("Hello World");
6060
out.shouldHaveExitValue(0);
6161

62-
// (2) Assembly Phase
62+
// (2) Assembly Phase (AOTClassLinking unspecified -> should be enabled by default)
6363
pb = ProcessTools.createLimitedTestJavaProcessBuilder(
6464
"-XX:AOTMode=create",
6565
"-XX:AOTConfiguration=" + aotConfigFile,
@@ -77,6 +77,7 @@ static void positiveTests() throws Exception {
7777
"-Xlog:cds",
7878
"-cp", appJar, helloClass);
7979
out = CDSTestUtils.executeAndLog(pb, "prod");
80+
out.shouldContain("Using AOT-linked classes: true (static archive: has aot-linked classes)");
8081
out.shouldContain("Opened archive hello.aot.");
8182
out.shouldContain("Hello World");
8283
out.shouldHaveExitValue(0);
@@ -107,7 +108,7 @@ static void positiveTests() throws Exception {
107108
out.shouldContain("Hello World");
108109
out.shouldHaveExitValue(0);
109110

110-
// (5) AOTMode=on
111+
// (6) AOTMode=on
111112
pb = ProcessTools.createLimitedTestJavaProcessBuilder(
112113
"-XX:AOTCache=" + aotCacheFile,
113114
"--show-version",
@@ -119,6 +120,30 @@ static void positiveTests() throws Exception {
119120
out.shouldContain("Opened archive hello.aot.");
120121
out.shouldContain("Hello World");
121122
out.shouldHaveExitValue(0);
123+
124+
// (7) Assembly Phase with -XX:-AOTClassLinking
125+
pb = ProcessTools.createLimitedTestJavaProcessBuilder(
126+
"-XX:AOTMode=create",
127+
"-XX:-AOTClassLinking",
128+
"-XX:AOTConfiguration=" + aotConfigFile,
129+
"-XX:AOTCache=" + aotCacheFile,
130+
"-Xlog:cds",
131+
"-cp", appJar);
132+
out = CDSTestUtils.executeAndLog(pb, "asm");
133+
out.shouldContain("Dumping shared data to file:");
134+
out.shouldMatch("cds.*hello[.]aot");
135+
out.shouldHaveExitValue(0);
136+
137+
// (8) Production Run with AOTCache, which was created with -XX:-AOTClassLinking
138+
pb = ProcessTools.createLimitedTestJavaProcessBuilder(
139+
"-XX:AOTCache=" + aotCacheFile,
140+
"-Xlog:cds",
141+
"-cp", appJar, helloClass);
142+
out = CDSTestUtils.executeAndLog(pb, "prod");
143+
out.shouldContain("Using AOT-linked classes: false (static archive: no aot-linked classes)");
144+
out.shouldContain("Opened archive hello.aot.");
145+
out.shouldContain("Hello World");
146+
out.shouldHaveExitValue(0);
122147
}
123148

124149
static void negativeTests() throws Exception {

0 commit comments

Comments
 (0)