Skip to content

Commit 1bd5c5d

Browse files
authored
Merge pull request #70 from openjdk/master
Merge
2 parents a875733 + 8c1b915 commit 1bd5c5d

File tree

4,914 files changed

+144148
-258151
lines changed

Some content is hidden

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

4,914 files changed

+144148
-258151
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*.{cpp,hpp,c,h,java,cc,hh,m,mm,S,md,properties,gmk,m4,ac}]
4+
trim_trailing_whitespace = true
5+
6+
[Makefile]
7+
trim_trailing_whitespace = true
8+
9+
[src/hotspot/**.{cpp,hpp,h}]
10+
indent_style = space
11+
indent_size = 2

.github/actions/do-build/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2022, 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
@@ -42,7 +42,7 @@ runs:
4242
- name: 'Build'
4343
id: build
4444
run: >
45-
make LOG=info ${{ inputs.make-target }}
45+
make -k LOG=info ${{ inputs.make-target }}
4646
|| bash ./.github/scripts/gen-build-failure-report.sh "$GITHUB_STEP_SUMMARY"
4747
shell: bash
4848

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Contributing to the JDK
22

3-
Please see the [OpenJDK Developers Guide](https://openjdk.org/guide/).
3+
Please see the [OpenJDK Developers' Guide](https://openjdk.org/guide/).

doc/building.html

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h2 id="operating-system-requirements">Operating System
376376
</tr>
377377
<tr class="odd">
378378
<td>macOS</td>
379-
<td>macOS 13.x (Ventura)</td>
379+
<td>macOS 14.x</td>
380380
</tr>
381381
<tr class="even">
382382
<td>Windows</td>
@@ -513,8 +513,8 @@ <h3 id="macos">macOS</h3>
513513
a continuously updated machine running macOS. See the section on <a
514514
href="#apple-xcode">Apple Xcode</a> on some strategies to deal with
515515
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>
516+
<p>It is recommended that you use at least macOS 14 and Xcode 15.4, but
517+
earlier versions may also work.</p>
518518
<p>The standard macOS environment contains the basic tooling needed to
519519
build, but for external libraries a package manager is recommended. The
520520
JDK uses <a href="https://brew.sh/">homebrew</a> in the examples, but
@@ -586,15 +586,15 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler
586586
<tbody>
587587
<tr class="odd">
588588
<td>Linux</td>
589-
<td>gcc 13.2.0</td>
589+
<td>gcc 14.2.0</td>
590590
</tr>
591591
<tr class="even">
592592
<td>macOS</td>
593-
<td>Apple Xcode 14.3.1 (using clang 14.0.3)</td>
593+
<td>Apple Xcode 15.4 (using clang 15.0.0)</td>
594594
</tr>
595595
<tr class="odd">
596596
<td>Windows</td>
597-
<td>Microsoft Visual Studio 2022 version 17.6.5</td>
597+
<td>Microsoft Visual Studio 2022 version 17.13.2</td>
598598
</tr>
599599
</tbody>
600600
</table>
@@ -604,7 +604,7 @@ <h3 id="gcc">gcc</h3>
604604
<p>The minimum accepted version of gcc is 10.0. Older versions will not
605605
be accepted by <code>configure</code>.</p>
606606
<p>The JDK is currently known to compile successfully with gcc version
607-
13.2 or newer.</p>
607+
14.2 or newer.</p>
608608
<p>In general, any version between these two should be usable.</p>
609609
<h3 id="clang">clang</h3>
610610
<p>The minimum accepted version of clang is 13. Older versions will not
@@ -1722,6 +1722,20 @@ <h4 id="building-for-musl">Building for musl</h4>
17221722
--with-devkit=$DEVKIT \
17231723
--with-sysroot=$SYSROOT</code></pre>
17241724
<p>and run <code>make</code> normally.</p>
1725+
<h4 id="building-for-windows-aarch64">Building for Windows AArch64</h4>
1726+
<p>The Visual Studio Build Tools can be used for building the JDK
1727+
without a full Visual Studio installation. To set up the Visual Studio
1728+
2022 Build Tools on a Windows AArch64 machine for a native build, launch
1729+
the installer as follows in a Windows command prompt:</p>
1730+
<pre><code>vs_buildtools.exe --quiet --wait --norestart --nocache ^
1731+
--installPath &quot;%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools&quot; ^
1732+
--add Microsoft.VisualStudio.Component.VC.CoreBuildTools ^
1733+
--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ^
1734+
--add Microsoft.VisualStudio.Component.Windows11SDK.22621</code></pre>
1735+
<p>To generate Windows AArch64 builds using Cygwin on a Windows x64
1736+
machine, you must set the proper target platform by adding
1737+
<code>--openjdk-target=aarch64-unknown-cygwin</code> to your configure
1738+
command line.</p>
17251739
<h2 id="build-performance">Build Performance</h2>
17261740
<p>Building the JDK requires a lot of horsepower. Some of the build
17271741
tools can be adjusted to utilize more or less of resources such as

doc/building.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ time of writing.
175175
| ----------------- | ---------------------------------- |
176176
| Linux/x64 | Oracle Enterprise Linux 6.4 / 8.x |
177177
| Linux/aarch64 | Oracle Enterprise Linux 7.6 / 8.x |
178-
| macOS | macOS 13.x (Ventura) |
178+
| macOS | macOS 14.x |
179179
| Windows | Windows Server 2016 |
180180

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

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

333333
The standard macOS environment contains the basic tooling needed to build, but
@@ -390,11 +390,11 @@ possible to compile the JDK with both older and newer versions, but the closer
390390
you stay to this list, the more likely you are to compile successfully without
391391
issues.
392392

393-
| Operating system | Toolchain version |
394-
| ------------------ | ------------------------------------------- |
395-
| Linux | gcc 13.2.0 |
396-
| macOS | Apple Xcode 14.3.1 (using clang 14.0.3) |
397-
| Windows | Microsoft Visual Studio 2022 version 17.6.5 |
393+
| Operating system | Toolchain version |
394+
| ------------------ | -------------------------------------------- |
395+
| Linux | gcc 14.2.0 |
396+
| macOS | Apple Xcode 15.4 (using clang 15.0.0) |
397+
| Windows | Microsoft Visual Studio 2022 version 17.13.2 |
398398

399399
All compilers are expected to be able to handle the C11 language standard for
400400
C, and C++14 for C++.
@@ -404,7 +404,7 @@ C, and C++14 for C++.
404404
The minimum accepted version of gcc is 10.0. Older versions will not be accepted
405405
by `configure`.
406406

407-
The JDK is currently known to compile successfully with gcc version 13.2 or
407+
The JDK is currently known to compile successfully with gcc version 14.2 or
408408
newer.
409409

410410
In general, any version between these two should be usable.
@@ -1457,6 +1457,24 @@ sh ./configure --with-jvm-variants=server \
14571457

14581458
and run `make` normally.
14591459

1460+
#### Building for Windows AArch64
1461+
The Visual Studio Build Tools can be used for building the JDK without a full
1462+
Visual Studio installation. To set up the Visual Studio 2022 Build Tools on a
1463+
Windows AArch64 machine for a native build, launch the installer as follows
1464+
in a Windows command prompt:
1465+
1466+
```
1467+
vs_buildtools.exe --quiet --wait --norestart --nocache ^
1468+
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^
1469+
--add Microsoft.VisualStudio.Component.VC.CoreBuildTools ^
1470+
--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ^
1471+
--add Microsoft.VisualStudio.Component.Windows11SDK.22621
1472+
```
1473+
1474+
To generate Windows AArch64 builds using Cygwin on a Windows x64 machine,
1475+
you must set the proper target platform by adding
1476+
`--openjdk-target=aarch64-unknown-cygwin` to your configure command line.
1477+
14601478
## Build Performance
14611479

14621480
Building the JDK requires a lot of horsepower. Some of the build tools can be

doc/hotspot-style.html

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -207,27 +207,34 @@ <h3 id="source-files">Source Files</h3>
207207
<ul>
208208
<li><p>All source files must have a globally unique basename. The build
209209
system depends on this uniqueness.</p></li>
210-
<li><p>Keep the include lines within a section alphabetically sorted.</p></li>
211-
<li><p>Put conditional inclusions (`#if ...`) at the end of the section of HotSpot
212-
include lines. This also applies to macro-expanded includes of platform
213-
dependent files.</p></li>
214-
<li><p>Put system includes in a section after the HotSpot include lines with a blank
215-
line separating the two sections.</p></li>
210+
<li><p>Keep the include lines within a section alphabetically sorted by
211+
their lowercase value. If an include must be out of order for
212+
correctness, suffix with it a comment such as
213+
<code>// do not reorder</code>. Source code processing tools can also
214+
use this hint.</p></li>
215+
<li><p>Put conditional inclusions (<code>#if ...</code>) at the end of
216+
the section of HotSpot include lines. This also applies to
217+
macro-expanded includes of platform dependent files.</p></li>
218+
<li><p>Put system includes in a section after the HotSpot include lines
219+
with a blank line separating the two sections.</p></li>
216220
<li><p>Do not put non-trivial function implementations in .hpp files. If
217-
the implementation depends on other .hpp files, put it in a .cpp or
218-
a .inline.hpp file.</p></li>
221+
the implementation depends on other .hpp files, put it in a .cpp or a
222+
.inline.hpp file.</p></li>
219223
<li><p>.inline.hpp files should only be included in .cpp or .inline.hpp
220224
files.</p></li>
221-
<li><p>All .inline.hpp files should include their corresponding .hpp file as
222-
the first include line with a blank line separating it from the rest of the
223-
include lines. Declarations needed by other files should be put in the .hpp
224-
file, and not in the .inline.hpp file. This rule exists to resolve problems
225-
with circular dependencies between .inline.hpp files.</p></li>
226-
<li><p>Do not include a .hpp file if the corresponding .inline.hpp file is included.</p></li>
227-
<li><p>Use include guards for .hpp and .inline.hpp files. The name of the defined
228-
guard should be derived from the full search path of the file relative to the
229-
hotspot source directory. The guard should be all upper case with all paths
230-
separators and periods replaced by underscores.</p></li>
225+
<li><p>All .inline.hpp files should include their corresponding .hpp
226+
file as the first include line with a blank line separating it from the
227+
rest of the include lines. Declarations needed by other files should be
228+
put in the .hpp file, and not in the .inline.hpp file. This rule exists
229+
to resolve problems with circular dependencies between .inline.hpp
230+
files.</p></li>
231+
<li><p>Do not include a .hpp file if the corresponding .inline.hpp file
232+
is included.</p></li>
233+
<li><p>Use include guards for .hpp and .inline.hpp files. The name of
234+
the defined guard should be derived from the full search path of the
235+
file relative to the hotspot source directory. The guard should be all
236+
upper case with all paths separators and periods replaced by
237+
underscores.</p></li>
231238
<li><p>Some build configurations use precompiled headers to speed up the
232239
build times. The precompiled headers are included in the precompiled.hpp
233240
file. Note that precompiled.hpp is just a build time optimization, so

doc/hotspot-style.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ change should be done with a "setter" accessor matched to the simple
138138
* All source files must have a globally unique basename. The build
139139
system depends on this uniqueness.
140140

141-
* Keep the include lines within a section alphabetically sorted.
141+
* Keep the include lines within a section alphabetically sorted by their
142+
lowercase value. If an include must be out of order for correctness,
143+
suffix with it a comment such as `// do not reorder`. Source code
144+
processing tools can also use this hint.
142145

143146
* Put conditional inclusions (`#if ...`) at the end of the section of HotSpot
144147
include lines. This also applies to macro-expanded includes of platform

doc/hotspot-unit-tests.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Prefer having checks inside test code.
106106

107107
Not only does having test logic outside, e.g. verification method,
108108
depending on asserts in product code contradict with several items
109-
above but also decreases tests readability and stability. It is much
109+
above but also decreases test's readability and stability. It is much
110110
easier to understand that a test is testing when all testing logic is
111111
located inside a test or nearby in shared test libraries. As a rule of
112112
thumb, the closer a check to a test, the better.
@@ -119,7 +119,7 @@ Prefer `EXPECT` over `ASSERT` if possible.
119119

120120
This is related to the [informativeness](#informativeness) property of
121121
tests, information for other checks can help to better localize a
122-
defects root-cause. One should use `ASSERT` if it is impossible to
122+
defect's root-cause. One should use `ASSERT` if it is impossible to
123123
continue test execution or if it does not make much sense. Later in
124124
the text, `EXPECT` forms will be used to refer to both
125125
`ASSERT/EXPECT`.
@@ -160,7 +160,7 @@ value of the difference between `v1` and `v2` is not greater than `eps`.
160160

161161
Use string special macros for C strings comparisons.
162162

163-
`EXPECT_EQ` just compares pointers values, which is hardly what one
163+
`EXPECT_EQ` just compares pointers' values, which is hardly what one
164164
wants comparing C strings. GoogleTest provides `EXPECT_STREQ` and
165165
`EXPECT_STRNE` macros to compare C string contents. There are also
166166
case-insensitive versions `EXPECT_STRCASEEQ`, `EXPECT_STRCASENE`.
@@ -226,7 +226,7 @@ subsystem, etc.
226226

227227
This naming scheme helps to find tests, filter them and simplifies
228228
test failure analysis. For example, class `Foo` - test group `Foo`,
229-
compiler logging subsystem - test group `CompilerLogging`, G1 GC test
229+
compiler logging subsystem - test group `CompilerLogging`, G1 GC - test
230230
group `G1GC`, and so forth.
231231

232232
### Filename
@@ -287,7 +287,7 @@ Fixture classes should be named after tested classes, subsystems, etc
287287

288288
All test purpose friends should have either `Test` or `Testable` suffix.
289289

290-
It greatly simplifies understanding of friendships purpose and allows
290+
It greatly simplifies understanding of friendship's purpose and allows
291291
statically check that private members are not exposed unexpectedly.
292292
Having `FooTest` as a friend of `Foo` without any comments will be
293293
understood as a necessary evil to get testability.
@@ -397,7 +397,7 @@ and filter out inapplicable tests.
397397
Restore changed flags.
398398

399399
It is quite common for tests to configure JVM in a certain way
400-
changing flags values. GoogleTest provides two ways to set up
400+
changing flags' values. GoogleTest provides two ways to set up
401401
environment before a test and restore it afterward: using either
402402
constructor and destructor or `SetUp` and `TearDown` functions. Both ways
403403
require to use a test fixture class, which sometimes is too wordy. The
@@ -406,7 +406,7 @@ be used in such cases to restore/set values.
406406

407407
Caveats:
408408

409-
* Changing a flags value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
409+
* Changing a flag's value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
410410

411411
* `FLAG_SET_*` macros can change more than one flag (in order to
412412
maintain invariants) so it is hard to predict what flags will be

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.

0 commit comments

Comments
 (0)