Skip to content

Commit 45dbdb5

Browse files
authored
Merge pull request #1965 from SAP/pr-jdk-25+22
Merge to tag jdk-25+22
2 parents d843acf + f9b351c commit 45dbdb5

File tree

667 files changed

+17711
-8428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

667 files changed

+17711
-8428
lines changed

doc/building.html

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,29 @@ <h3 id="special-considerations">Special Considerations</h3>
282282
having slow disk access will significantly increase build times. If you
283283
need to use a network share for the source code, see below for
284284
suggestions on how to keep the build artifacts on a local disk.</p></li>
285-
<li><p>On Windows, if using <a href="#cygwin">Cygwin</a>, extra care
286-
must be taken to make sure the environment is consistent. It is
287-
recommended that you follow this procedure:</p>
285+
<li><p>On Windows, extra care must be taken to have a smooth building
286+
experience:</p>
287+
<ul>
288+
<li><p>Make sure that all relevant paths have short names. Short names
289+
are used by the build system to create space-free alternative paths.
290+
Short name creation is enabled per volume. The default setting can be
291+
checked with the command: <code>fsutil 8dot3name query</code>. If short
292+
name creation was turned off when a directory was created, it will not
293+
have a short name. Whether a short name exists can be checked by running
294+
<code>dir /X</code> in the containing directory (in cmd.exe). If a short
295+
path is present you should see something like 'ASDF~1' being displayed
296+
in one of the columns of the ouput. If a directory is missing a short
297+
name, the safest way to get one is to enable short names for that
298+
particular volume with
299+
<code>fsutil 8dot3name set &lt;drive letter&gt;: 0</code> (note that
300+
you need to run as administrator for this), and then re-create the
301+
particular directory. A short name should be generated automatically
302+
then. Another option is to manually assign a short name to the directory
303+
using
304+
<code>fsutil file setShortName &lt;path&gt; &lt;short name&gt;</code>.</p></li>
305+
<li><p>If using <a href="#cygwin">Cygwin</a>, you must make sure the
306+
file permissions and attributes between Windows and Cygwin are
307+
consistent. It is recommended that you follow this procedure:</p>
288308
<ul>
289309
<li><p>Create the directory that is going to contain the top directory
290310
of the JDK clone by using the <code>mkdir</code> command in the Cygwin
@@ -294,6 +314,9 @@ <h3 id="special-considerations">Special Considerations</h3>
294314
<li><p>Do not put the JDK clone in a path under your Cygwin home
295315
directory. This is especially important if your user name contains
296316
spaces and/or mixed upper and lower case letters.</p></li>
317+
</ul>
318+
<p>Failure to follow these procedures might result in hard-to-debug
319+
build problems.</p></li>
297320
<li><p>You need to install a git client. You have two choices, Cygwin
298321
git or Git for Windows. Unfortunately there are pros and cons with each
299322
choice.</p>
@@ -311,9 +334,7 @@ <h3 id="special-considerations">Special Considerations</h3>
311334
line ending problems, make sure you set <code>core.autocrlf</code> to
312335
<code>false</code> (this is asked during installation).</p></li>
313336
</ul></li>
314-
</ul>
315-
<p>Failure to follow this procedure might result in hard-to-debug build
316-
problems.</p></li>
337+
</ul></li>
317338
</ul>
318339
<h2 id="build-hardware-requirements">Build Hardware Requirements</h2>
319340
<p>The JDK is a massive project, and require machines ranging from
@@ -376,7 +397,7 @@ <h2 id="operating-system-requirements">Operating System
376397
</tr>
377398
<tr class="odd">
378399
<td>macOS</td>
379-
<td>macOS 13.x (Ventura)</td>
400+
<td>macOS 14.x</td>
380401
</tr>
381402
<tr class="even">
382403
<td>Windows</td>
@@ -513,8 +534,8 @@ <h3 id="macos">macOS</h3>
513534
a continuously updated machine running macOS. See the section on <a
514535
href="#apple-xcode">Apple Xcode</a> on some strategies to deal with
515536
this.</p>
516-
<p>It is recommended that you use at least macOS 13 (Ventura) and Xcode
517-
14, but earlier versions may also work.</p>
537+
<p>It is recommended that you use at least macOS 14 and Xcode 15.4, but
538+
earlier versions may also work.</p>
518539
<p>The standard macOS environment contains the basic tooling needed to
519540
build, but for external libraries a package manager is recommended. The
520541
JDK uses <a href="https://brew.sh/">homebrew</a> in the examples, but
@@ -590,7 +611,7 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler
590611
</tr>
591612
<tr class="even">
592613
<td>macOS</td>
593-
<td>Apple Xcode 14.3.1 (using clang 14.0.3)</td>
614+
<td>Apple Xcode 15.4 (using clang 15.0.0)</td>
594615
</tr>
595616
<tr class="odd">
596617
<td>Windows</td>

doc/building.md

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,39 @@ on where and how to check out the source code.
8383
for the source code, see below for suggestions on how to keep the build
8484
artifacts on a local disk.
8585

86-
* On Windows, if using [Cygwin](#cygwin), extra care must be taken to make sure
87-
the environment is consistent. It is recommended that you follow this
88-
procedure:
89-
90-
* Create the directory that is going to contain the top directory of the JDK
91-
clone by using the `mkdir` command in the Cygwin bash shell. That is, do
92-
*not* create it using Windows Explorer. This will ensure that it will have
93-
proper Cygwin attributes, and that it's children will inherit those
94-
attributes.
95-
96-
* Do not put the JDK clone in a path under your Cygwin home directory. This
97-
is especially important if your user name contains spaces and/or mixed
98-
upper and lower case letters.
86+
* On Windows, extra care must be taken to have a smooth building experience:
87+
88+
* Make sure that all relevant paths have short names. Short names are used by
89+
the build system to create space-free alternative paths. Short name
90+
creation is enabled per volume. The default setting can be checked with the
91+
command: `fsutil 8dot3name query`. If short name creation was turned off
92+
when a directory was created, it will not have a short name. Whether a
93+
short name exists can be checked by running `dir /X` in the containing
94+
directory (in cmd.exe). If a short path is present you should see something
95+
like 'ASDF~1' being displayed in one of the columns of the ouput. If a
96+
directory is missing a short name, the safest way to get one is to enable
97+
short names for that particular volume with `fsutil 8dot3name set <drive
98+
letter>: 0` (note that you need to run as administrator for this), and then
99+
re-create the particular directory. A short name should be generated
100+
automatically then. Another option is to manually assign a short name to
101+
the directory using `fsutil file setShortName <path> <short name>`.
102+
103+
* If using [Cygwin](#cygwin), you must make sure the file permissions and
104+
attributes between Windows and Cygwin are consistent. It is recommended
105+
that you follow this procedure:
106+
107+
* Create the directory that is going to contain the top directory of the
108+
JDK clone by using the `mkdir` command in the Cygwin bash shell. That is,
109+
do *not* create it using Windows Explorer. This will ensure that it will
110+
have proper Cygwin attributes, and that it's children will inherit those
111+
attributes.
112+
113+
* Do not put the JDK clone in a path under your Cygwin home directory. This
114+
is especially important if your user name contains spaces and/or mixed
115+
upper and lower case letters.
116+
117+
Failure to follow these procedures might result in hard-to-debug build
118+
problems.
99119

100120
* You need to install a git client. You have two choices, Cygwin git or Git
101121
for Windows. Unfortunately there are pros and cons with each choice.
@@ -113,9 +133,6 @@ on where and how to check out the source code.
113133
make sure you set `core.autocrlf` to `false` (this is asked during
114134
installation).
115135

116-
Failure to follow this procedure might result in hard-to-debug build
117-
problems.
118-
119136
## Build Hardware Requirements
120137

121138
The JDK is a massive project, and require machines ranging from decent to
@@ -175,7 +192,7 @@ time of writing.
175192
| ----------------- | ---------------------------------- |
176193
| Linux/x64 | Oracle Enterprise Linux 6.4 / 8.x |
177194
| Linux/aarch64 | Oracle Enterprise Linux 7.6 / 8.x |
178-
| macOS | macOS 13.x (Ventura) |
195+
| macOS | macOS 14.x |
179196
| Windows | Windows Server 2016 |
180197

181198
The double version numbers for Linux are due to the hybrid model used at
@@ -327,7 +344,7 @@ difficult for a project such as the JDK to keep pace with a continuously
327344
updated machine running macOS. See the section on [Apple Xcode](#apple-xcode)
328345
on some strategies to deal with this.
329346

330-
It is recommended that you use at least macOS 13 (Ventura) and Xcode 14, but
347+
It is recommended that you use at least macOS 14 and Xcode 15.4, but
331348
earlier versions may also work.
332349

333350
The standard macOS environment contains the basic tooling needed to build, but
@@ -393,7 +410,7 @@ issues.
393410
| Operating system | Toolchain version |
394411
| ------------------ | -------------------------------------------- |
395412
| Linux | gcc 14.2.0 |
396-
| macOS | Apple Xcode 14.3.1 (using clang 14.0.3) |
413+
| macOS | Apple Xcode 15.4 (using clang 15.0.0) |
397414
| Windows | Microsoft Visual Studio 2022 version 17.13.2 |
398415

399416
All compilers are expected to be able to handle the C11 language standard for

doc/hotspot-unit-tests.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ <h3 id="nearness">Nearness</h3>
189189
<p>Prefer having checks inside test code.</p>
190190
<p>Not only does having test logic outside, e.g. verification method,
191191
depending on asserts in product code contradict with several items above
192-
but also decreases tests readability and stability. It is much easier
192+
but also decreases test's readability and stability. It is much easier
193193
to understand that a test is testing when all testing logic is located
194194
inside a test or nearby in shared test libraries. As a rule of thumb,
195195
the closer a check to a test, the better.</p>
@@ -198,7 +198,7 @@ <h3 id="several-checks">Several checks</h3>
198198
<p>Prefer <code>EXPECT</code> over <code>ASSERT</code> if possible.</p>
199199
<p>This is related to the <a href="#informativeness">informativeness</a>
200200
property of tests, information for other checks can help to better
201-
localize a defects root-cause. One should use <code>ASSERT</code> if it
201+
localize a defect's root-cause. One should use <code>ASSERT</code> if it
202202
is impossible to continue test execution or if it does not make much
203203
sense. Later in the text, <code>EXPECT</code> forms will be used to
204204
refer to both <code>ASSERT/EXPECT</code>.</p>
@@ -235,7 +235,7 @@ <h3 id="floating-point-comparison">Floating-point comparison</h3>
235235
<code>eps</code>.</p>
236236
<h3 id="c-string-comparison">C string comparison</h3>
237237
<p>Use string special macros for C strings comparisons.</p>
238-
<p><code>EXPECT_EQ</code> just compares pointers values, which is
238+
<p><code>EXPECT_EQ</code> just compares pointers' values, which is
239239
hardly what one wants comparing C strings. GoogleTest provides
240240
<code>EXPECT_STREQ</code> and <code>EXPECT_STRNE</code> macros to
241241
compare C string contents. There are also case-insensitive versions
@@ -293,7 +293,7 @@ <h3 id="test-group-names">Test group names</h3>
293293
<p>This naming scheme helps to find tests, filter them and simplifies
294294
test failure analysis. For example, class <code>Foo</code> - test group
295295
<code>Foo</code>, compiler logging subsystem - test group
296-
<code>CompilerLogging</code>, G1 GC test group <code>G1GC</code>, and
296+
<code>CompilerLogging</code>, G1 GC - test group <code>G1GC</code>, and
297297
so forth.</p>
298298
<h3 id="filename">Filename</h3>
299299
<p>A test file must have <code>test_</code> prefix and <code>.cpp</code>
@@ -345,7 +345,7 @@ <h3 id="fixture-classes">Fixture classes</h3>
345345
<h3 id="friend-classes">Friend classes</h3>
346346
<p>All test purpose friends should have either <code>Test</code> or
347347
<code>Testable</code> suffix.</p>
348-
<p>It greatly simplifies understanding of friendships purpose and
348+
<p>It greatly simplifies understanding of friendship's purpose and
349349
allows statically check that private members are not exposed
350350
unexpectedly. Having <code>FooTest</code> as a friend of
351351
<code>Foo</code> without any comments will be understood as a necessary
@@ -435,7 +435,7 @@ <h3 id="test-specific-flags">Test-specific flags</h3>
435435
<h3 id="flag-restoring">Flag restoring</h3>
436436
<p>Restore changed flags.</p>
437437
<p>It is quite common for tests to configure JVM in a certain way
438-
changing flags values. GoogleTest provides two ways to set up
438+
changing flags' values. GoogleTest provides two ways to set up
439439
environment before a test and restore it afterward: using either
440440
constructor and destructor or <code>SetUp</code> and
441441
<code>TearDown</code> functions. Both ways require to use a test fixture
@@ -444,7 +444,7 @@ <h3 id="flag-restoring">Flag restoring</h3>
444444
be used in such cases to restore/set values.</p>
445445
<p>Caveats:</p>
446446
<ul>
447-
<li><p>Changing a flags value could break the invariants between flags'
447+
<li><p>Changing a flag's value could break the invariants between flags'
448448
values and hence could lead to unexpected/unsupported JVM
449449
state.</p></li>
450450
<li><p><code>FLAG_SET_*</code> macros can change more than one flag (in

doc/testing.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,13 @@ <h4 id="jcov">JCOV</h4>
411411
special target <code>jcov-test</code> instead of <code>test</code>, e.g.
412412
<code>make jcov-test TEST=jdk_lang</code>. This will make sure the JCov
413413
image is built, and that JCov reporting is enabled.</p>
414+
<p>To include JCov coverage for just a subset of all modules, you can
415+
use the <code>--with-jcov-modules</code> arguments to
416+
<code>configure</code>, e.g.
417+
<code>--with-jcov-modules=jdk.compiler,java.desktop</code>.</p>
418+
<p>For more fine-grained control, you can pass arbitrary filters to JCov
419+
using <code>--with-jcov-filters</code>, and you can specify a specific
420+
JDK to instrument using <code>--with-jcov-input-jdk</code>.</p>
414421
<p>The JCov report is stored in
415422
<code>build/$BUILD/test-results/jcov-output/report</code>.</p>
416423
<p>Please note that running with JCov reporting can be very memory

doc/testing.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,14 @@ The simplest way to run tests with JCov coverage report is to use the special
345345
target `jcov-test` instead of `test`, e.g. `make jcov-test TEST=jdk_lang`. This
346346
will make sure the JCov image is built, and that JCov reporting is enabled.
347347

348+
To include JCov coverage for just a subset of all modules, you can use the
349+
`--with-jcov-modules` arguments to `configure`, e.g.
350+
`--with-jcov-modules=jdk.compiler,java.desktop`.
351+
352+
For more fine-grained control, you can pass arbitrary filters to JCov using
353+
`--with-jcov-filters`, and you can specify a specific JDK to instrument
354+
using `--with-jcov-input-jdk`.
355+
348356
The JCov report is stored in `build/$BUILD/test-results/jcov-output/report`.
349357

350358
Please note that running with JCov reporting can be very memory intensive.

make/Coverage.gmk

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,28 @@ else
3434
JCOV_INPUT_IMAGE_DIR := $(JDK_IMAGE_DIR)
3535
endif
3636

37+
JCOV_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/jcov
38+
3739
#moving instrumented jdk image in and out of jcov_temp because of CODETOOLS-7902299
38-
JCOV_TEMP := $(SUPPORT_OUTPUTDIR)/jcov_temp
40+
JCOV_TEMP := $(JCOV_SUPPORT_DIR)/temp
41+
42+
ifneq ($(JCOV_MODULES), )
43+
JCOV_MODULES_FILTER := $(foreach m, $(JCOV_MODULES), -include_module $m)
44+
endif
3945

4046
$(JCOV_IMAGE_DIR)/release: $(JCOV_INPUT_IMAGE_DIR)/release
4147
$(call LogWarn, Creating instrumented jdk image with JCov)
4248
$(call MakeDir, $(JCOV_TEMP) $(IMAGES_OUTPUTDIR))
4349
$(RM) -r $(JCOV_IMAGE_DIR) $(JCOV_TEMP)/*
4450
$(CP) -r $(JCOV_INPUT_IMAGE_DIR) $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
45-
$(JAVA) -Xmx3g -jar $(JCOV_HOME)/lib/jcov.jar JREInstr \
51+
$(call ExecuteWithLog, $(JCOV_SUPPORT_DIR)/run-jcov, \
52+
$(JAVA) -Xmx3g -jar $(JCOV_HOME)/lib/jcov.jar JREInstr \
4653
-t $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)/template.xml \
4754
-rt $(JCOV_HOME)/lib/jcov_network_saver.jar \
4855
-exclude 'java.lang.Object' \
4956
-exclude jdk.test.Main -exclude '**\$Proxy*' \
50-
$(JCOV_FILTERS) \
51-
$(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
57+
$(JCOV_MODULES_FILTER) $(JCOV_FILTERS) \
58+
$(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR))
5259
$(MV) $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR) $(JCOV_IMAGE_DIR)
5360
$(RMDIR) $(JCOV_TEMP)
5461

make/GenerateLinkOptData.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ endif
6666
# default classlist is minimal, let's filter out the '@cp' lines until we can
6767
# find a proper solution.
6868
CLASSLIST_FILE_VM_OPTS = \
69-
-Duser.language=en -Duser.country=US --enable-native-access=ALL-UNNAMED
69+
-Duser.language=en -Duser.country=US
7070

7171
# Save the stderr output of the command and print it along with stdout in case
7272
# something goes wrong.

make/RunTests.gmk

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ JTREG_COV_OPTIONS :=
115115

116116
ifeq ($(TEST_OPTS_JCOV), true)
117117
JCOV_OUTPUT_DIR := $(TEST_RESULTS_DIR)/jcov-output
118+
JCOV_SUPPORT_DIR := $(TEST_SUPPORT_DIR)/jcov-support
118119
JCOV_GRABBER_LOG := $(JCOV_OUTPUT_DIR)/grabber.log
119120
JCOV_RESULT_FILE := $(JCOV_OUTPUT_DIR)/result.xml
120121
JCOV_REPORT := $(JCOV_OUTPUT_DIR)/report
@@ -1343,12 +1344,14 @@ TARGETS += run-all-tests pre-run-test post-run-test run-test-report run-test
13431344

13441345
ifeq ($(TEST_OPTS_JCOV), true)
13451346

1347+
JCOV_VM_OPTS := -Xmx4g -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.maxGeneralEntitySizeLimit=0
1348+
13461349
jcov-do-start-grabber:
13471350
$(call MakeDir, $(JCOV_OUTPUT_DIR))
13481351
if $(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -status 1>/dev/null 2>&1 ; then \
13491352
$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600 ; \
13501353
fi
1351-
$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar Grabber -v -t \
1354+
$(JAVA) $(JCOV_VM_OPTS) -jar $(JCOV_HOME)/lib/jcov.jar Grabber -v -t \
13521355
$(JCOV_IMAGE_DIR)/template.xml -o $(JCOV_RESULT_FILE) \
13531356
1>$(JCOV_GRABBER_LOG) 2>&1 &
13541357

@@ -1361,18 +1364,23 @@ ifeq ($(TEST_OPTS_JCOV), true)
13611364
$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600
13621365

13631366
JCOV_REPORT_TITLE := JDK code coverage report<br/>
1367+
ifneq ($(JCOV_MODULES), )
1368+
JCOV_MODULES_FILTER := $(foreach m, $(JCOV_MODULES), -include_module $m)
1369+
JCOV_REPORT_TITLE += Included modules: $(JCOV_MODULES)<br>
1370+
endif
13641371
ifneq ($(JCOV_FILTERS), )
13651372
JCOV_REPORT_TITLE += Code filters: $(JCOV_FILTERS)<br>
13661373
endif
13671374
JCOV_REPORT_TITLE += Tests: $(TEST)
13681375

13691376
jcov-gen-report: jcov-stop-grabber
13701377
$(call LogWarn, Generating JCov report ...)
1371-
$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar RepGen -sourcepath \
1378+
$(call ExecuteWithLog, $(JCOV_SUPPORT_DIR)/run-jcov-repgen, \
1379+
$(JAVA) $(JCOV_VM_OPTS) -jar $(JCOV_HOME)/lib/jcov.jar RepGen -sourcepath \
13721380
`$(ECHO) $(TOPDIR)/src/*/share/classes/ | $(TR) ' ' ':'` -fmt html \
1373-
$(JCOV_FILTERS) \
1381+
$(JCOV_MODULES_FILTER) $(JCOV_FILTERS) \
13741382
-mainReportTitle "$(JCOV_REPORT_TITLE)" \
1375-
-o $(JCOV_REPORT) $(JCOV_RESULT_FILE)
1383+
-o $(JCOV_REPORT) $(JCOV_RESULT_FILE))
13761384

13771385
TARGETS += jcov-do-start-grabber jcov-start-grabber jcov-stop-grabber \
13781386
jcov-gen-report
@@ -1392,7 +1400,7 @@ ifeq ($(TEST_OPTS_JCOV), true)
13921400
jcov-gen-diffcoverage: jcov-stop-grabber
13931401
$(call LogWarn, Generating diff coverage with changeset $(TEST_OPTS_JCOV_DIFF_CHANGESET) ... )
13941402
$(DIFF_COMMAND)
1395-
$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar \
1403+
$(JAVA) $(JCOV_VM_OPTS) -jar $(JCOV_HOME)/lib/jcov.jar \
13961404
DiffCoverage -replaceDiff "src/.*/classes/:" -all \
13971405
$(JCOV_RESULT_FILE) $(JCOV_SOURCE_DIFF) > \
13981406
$(JCOV_DIFF_COVERAGE_REPORT)

make/RunTestsPrebuilt.gmk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx)
217217
else ifeq ($(OPENJDK_TARGET_OS), windows)
218218
NUM_CORES := $(NUMBER_OF_PROCESSORS)
219219
MEMORY_SIZE := $(shell \
220-
$(EXPR) `wmic computersystem get totalphysicalmemory -value \
221-
| $(GREP) = | $(SED) 's/\\r//g' \
222-
| $(CUT) -d "=" -f 2-` / 1024 / 1024 \
220+
$(EXPR) `powershell -Command \
221+
"(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory" \
222+
| $(SED) 's/\\r//g' ` / 1024 / 1024 \
223223
)
224224
endif
225225
ifeq ($(NUM_CORES), )

0 commit comments

Comments
 (0)