Skip to content

Commit b696941

Browse files
committed
Merge from openjdk.
2 parents 2ada91b + a3540be commit b696941

File tree

8,691 files changed

+160696
-116221
lines changed

Some content is hidden

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

8,691 files changed

+160696
-116221
lines changed

.github/actions/config/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2022, 2024, 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

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2022, 2024, 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

.github/actions/get-bootjdk/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2022, 2024, 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

.github/actions/get-bundles/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2022, 2024, 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

.github/actions/get-gtest/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ runs:
4949
- name: 'Export path to where GTest is installed'
5050
id: path-name
5151
run: |
52-
# Export the path
53-
echo 'path=gtest' >> $GITHUB_OUTPUT
52+
# Export the absolute path
53+
echo "path=`pwd`/gtest" >> $GITHUB_OUTPUT
5454
shell: bash

.github/actions/get-jtreg/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ runs:
4949
- name: 'Export path to where JTReg is installed'
5050
id: path-name
5151
run: |
52-
# Export the path
53-
echo 'path=jtreg/installed' >> $GITHUB_OUTPUT
52+
# Export the absolute path
53+
echo "path=`pwd`/jtreg/installed" >> $GITHUB_OUTPUT
5454
shell: bash

.github/actions/get-msys2/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2022, 2024, 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

.github/actions/upload-bundles/action.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ inputs:
3232
debug-suffix:
3333
description: 'File name suffix denoting debug level, possibly empty'
3434
required: false
35+
bundle-suffix:
36+
description: 'Bundle name suffix, possibly empty'
37+
required: false
3538

3639
runs:
3740
using: composite
@@ -75,7 +78,7 @@ runs:
7578
- name: 'Upload bundles artifact'
7679
uses: actions/upload-artifact@v4
7780
with:
78-
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
81+
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.bundle-suffix }}
7982
path: bundles
8083
retention-days: 1
8184
if: steps.bundles.outputs.bundles-found == 'true'

.github/scripts/gen-build-failure-report.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it

.github/scripts/gen-test-summary.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it

.github/workflows/build-cross-compile.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2022, 2024, 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

.github/workflows/build-linux.yml

+8-12
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ on:
6161
make-arguments:
6262
required: false
6363
type: string
64+
bundle-suffix:
65+
required: false
66+
type: string
6467

6568
jobs:
6669
build-linux:
@@ -71,10 +74,6 @@ jobs:
7174
fail-fast: false
7275
matrix:
7376
debug-level: ${{ fromJSON(inputs.debug-levels) }}
74-
include:
75-
- debug-level: debug
76-
flags: --with-debug-level=fastdebug
77-
suffix: -debug
7877

7978
steps:
8079
- name: 'Checkout the JDK source'
@@ -118,7 +117,7 @@ jobs:
118117
run: >
119118
bash configure
120119
--with-conf-name=${{ inputs.platform }}
121-
${{ matrix.flags }}
120+
${{ matrix.debug-level == 'debug' && '--with-debug-level=fastdebug' || '' }}
122121
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
123122
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
124123
--with-jtreg=${{ steps.jtreg.outputs.path }}
@@ -133,17 +132,14 @@ jobs:
133132
- name: 'Build'
134133
id: build
135134
uses: ./.github/actions/do-build
136-
env:
137-
# Only build static-libs-bundles for release builds.
138-
# For debug builds, building static-libs often exceeds disk space.
139-
STATIC_LIBS: ${{ matrix.debug-level == 'release' && 'static-libs-bundles' }}
140135
with:
141-
make-target: '${{ inputs.make-target }} ${STATIC_LIBS} ${{ inputs.make-arguments }}'
136+
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
142137
platform: ${{ inputs.platform }}
143-
debug-suffix: '${{ matrix.suffix }}'
138+
debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}"
144139

145140
- name: 'Upload bundles'
146141
uses: ./.github/actions/upload-bundles
147142
with:
148143
platform: ${{ inputs.platform }}
149-
debug-suffix: '${{ matrix.suffix }}'
144+
debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}"
145+
bundle-suffix: ${{ inputs.bundle-suffix }}

.github/workflows/main.yml

+37-11
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,43 @@ jobs:
229229
make-arguments: ${{ github.event.inputs.make-arguments }}
230230
if: needs.prepare.outputs.linux-x64-variants == 'true'
231231

232+
build-linux-x64-static:
233+
name: linux-x64-static
234+
needs: prepare
235+
uses: ./.github/workflows/build-linux.yml
236+
with:
237+
platform: linux-x64
238+
make-target: 'static-jdk-image'
239+
# There are issues with fastdebug static build in GHA due to space limit.
240+
# Only do release build for now.
241+
debug-levels: '[ "release" ]'
242+
gcc-major-version: '10'
243+
configure-arguments: ${{ github.event.inputs.configure-arguments }}
244+
make-arguments: ${{ github.event.inputs.make-arguments }}
245+
# It currently doesn't produce any bundles, but probably will do in
246+
# the future.
247+
bundle-suffix: "-static"
248+
if: needs.prepare.outputs.linux-x64 == 'true'
249+
250+
build-linux-x64-static-libs:
251+
name: linux-x64-static-libs
252+
needs: prepare
253+
uses: ./.github/workflows/build-linux.yml
254+
with:
255+
platform: linux-x64
256+
make-target: 'static-libs-bundles'
257+
# Only build static-libs-bundles for release builds.
258+
# For debug builds, building static-libs often exceeds disk space.
259+
debug-levels: '[ "release" ]'
260+
gcc-major-version: '10'
261+
configure-arguments: ${{ github.event.inputs.configure-arguments }}
262+
make-arguments: ${{ github.event.inputs.make-arguments }}
263+
# Upload static libs bundles separately to avoid interference with normal linux-x64 bundle.
264+
# This bundle is not used by testing jobs, but downstreams use it to check that
265+
# dependent projects, e.g. libgraal, builds fine.
266+
bundle-suffix: "-static-libs"
267+
if: needs.prepare.outputs.linux-x64-variants == 'true'
268+
232269
build-linux-cross-compile:
233270
name: linux-cross-compile
234271
needs: prepare
@@ -329,17 +366,6 @@ jobs:
329366
bootjdk-platform: linux-x64
330367
runs-on: ubuntu-22.04
331368

332-
test-macos-x64:
333-
name: macos-x64
334-
needs:
335-
- build-macos-x64
336-
uses: ./.github/workflows/test.yml
337-
with:
338-
platform: macos-x64
339-
bootjdk-platform: macos-x64
340-
runs-on: macos-13
341-
xcode-toolset-version: '14.3.1'
342-
343369
test-macos-aarch64:
344370
name: macos-aarch64
345371
needs:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ nbproject/private/
1818
/.cache
1919
/.gdbinit
2020
/.lldbinit
21+
**/core.[0-9]*

.jcheck/conf

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jbs=JDK
44
version=25
55

66
[checks]
7-
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
7+
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists,copyright
88
warning=issuestitle,binary
99

1010
[repository]
@@ -34,3 +34,8 @@ pattern=^([124-8][0-9]{6}): (\S.*)$
3434

3535
[checks "problemlists"]
3636
dirs=test/jdk|test/langtools|test/lib-test|test/hotspot/jtreg|test/jaxp
37+
38+
[checks "copyright"]
39+
files=^(?!LICENSE|license\.txt|.*\.bin|.*\.gif|.*\.jpg|.*\.png|.*\.icon|.*\.tiff|.*\.dat|.*\.patch|.*\.wav|.*\.class|.*-header|.*\.jar).*
40+
oracle_locator=.*Copyright \(c\)(.*)Oracle and/or its affiliates\. All rights reserved\.
41+
oracle_validator=.*Copyright \(c\) (\d{4})(?:, (\d{4}))?, Oracle and/or its affiliates\. All rights reserved\.

Makefile

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2012, 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
@@ -24,8 +24,9 @@
2424
#
2525

2626
###
27-
### This file is just a very small wrapper needed to run the real make/Init.gmk.
28-
### It also performs some sanity checks on make.
27+
### This file is just a very small wrapper which will include make/PreInit.gmk,
28+
### where the real work is done. This wrapper also performs some sanity checks
29+
### on make that must be done before we can include another file.
2930
###
3031

3132
# The shell code below will be executed on /usr/bin/make on Solaris, but not in GNU Make.
@@ -58,7 +59,7 @@ ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
5859
else
5960
makefile_path := $(lastword $(MAKEFILE_LIST))
6061
endif
61-
topdir := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
62+
TOPDIR := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
6263

63-
# ... and then we can include the real makefile
64-
include $(topdir)/make/Init.gmk
64+
# ... and then we can include the real makefile to bootstrap the build
65+
include $(TOPDIR)/make/PreInit.gmk

bin/idea.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it
@@ -99,7 +99,7 @@ if [ "$VERBOSE" = "true" ] ; then
9999
echo "idea template dir: $IDEA_TEMPLATE"
100100
fi
101101

102-
cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" $CONF_ARG || exit 1
102+
cd $TOP ; make idea-gen-config ALLOW=IDEA_OUTPUT,MODULES IDEA_OUTPUT=$IDEA_OUTPUT MODULES="$*" $CONF_ARG || exit 1
103103
cd $SCRIPT_DIR
104104

105105
. $IDEA_OUTPUT/env.cfg

doc/hotspot-style.html

+22-14
Original file line numberDiff line numberDiff line change
@@ -207,23 +207,31 @@ <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>
210216
<li><p>Do not put non-trivial function implementations in .hpp files. If
211-
the implementation depends on other .hpp files, put it in a .cpp or a
212-
.inline.hpp file.</p></li>
217+
the implementation depends on other .hpp files, put it in a .cpp or
218+
a .inline.hpp file.</p></li>
213219
<li><p>.inline.hpp files should only be included in .cpp or .inline.hpp
214220
files.</p></li>
215-
<li><p>All .inline.hpp files should include their corresponding .hpp
216-
file as the first include line. Declarations needed by other files
217-
should be put in the .hpp file, and not in the .inline.hpp file. This
218-
rule exists to resolve problems with circular dependencies between
219-
.inline.hpp files.</p></li>
220-
<li><p>All .cpp files include precompiled.hpp as the first include
221-
line.</p></li>
222-
<li><p>precompiled.hpp is just a build time optimization, so don't rely
223-
on it to resolve include problems.</p></li>
224-
<li><p>Keep the include lines alphabetically sorted.</p></li>
225-
<li><p>Put conditional inclusions (<code>#if ...</code>) at the end of
226-
the include list.</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>
231+
<li><p>Some build configurations use precompiled headers to speed up the
232+
build times. The precompiled headers are included in the precompiled.hpp
233+
file. Note that precompiled.hpp is just a build time optimization, so
234+
don't rely on it to resolve include problems.</p></li>
227235
</ul>
228236
<h3 id="jtreg-tests">JTReg Tests</h3>
229237
<ul>

doc/hotspot-style.md

+26-13
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,18 @@ change should be done with a "setter" accessor matched to the simple
135135

136136
### Source Files
137137

138-
* All source files must have a globally unique basename. The build
138+
* 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.
142+
143+
* Put conditional inclusions (`#if ...`) at the end of the section of HotSpot
144+
include lines. This also applies to macro-expanded includes of platform
145+
dependent files.
146+
147+
* Put system includes in a section after the HotSpot include lines with a blank
148+
line separating the two sections.
149+
141150
* Do not put non-trivial function implementations in .hpp files. If
142151
the implementation depends on other .hpp files, put it in a .cpp or
143152
a .inline.hpp file.
@@ -146,18 +155,22 @@ a .inline.hpp file.
146155
files.
147156

148157
* All .inline.hpp files should include their corresponding .hpp file as
149-
the first include line. Declarations needed by other files should be put
150-
in the .hpp file, and not in the .inline.hpp file. This rule exists to
151-
resolve problems with circular dependencies between .inline.hpp files.
152-
153-
* All .cpp files include precompiled.hpp as the first include line.
154-
155-
* precompiled.hpp is just a build time optimization, so don't rely on
156-
it to resolve include problems.
157-
158-
* Keep the include lines alphabetically sorted.
159-
160-
* Put conditional inclusions (`#if ...`) at the end of the include list.
158+
the first include line with a blank line separating it from the rest of the
159+
include lines. Declarations needed by other files should be put in the .hpp
160+
file, and not in the .inline.hpp file. This rule exists to resolve problems
161+
with circular dependencies between .inline.hpp files.
162+
163+
* Do not include a .hpp file if the corresponding .inline.hpp file is included.
164+
165+
* Use include guards for .hpp and .inline.hpp files. The name of the defined
166+
guard should be derived from the full search path of the file relative to the
167+
hotspot source directory. The guard should be all upper case with all paths
168+
separators and periods replaced by underscores.
169+
170+
* Some build configurations use precompiled headers to speed up the
171+
build times. The precompiled headers are included in the precompiled.hpp
172+
file. Note that precompiled.hpp is just a build time optimization, so
173+
don't rely on it to resolve include problems.
161174

162175
### JTReg Tests
163176

doc/hotspot-unit-tests.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ <h3 id="error-messages">Error messages</h3>
245245
<p>All GoogleTest asserts print compared expressions and their values,
246246
so there is no need to have them in error messages. Asserts print only
247247
compared values, they do not print any of interim variables, e.g.
248-
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8)) || i == 18)</code>
248+
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8))) || i == 18)</code>
249249
prints only one value. If you use some complex predicates, please
250250
consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code>
251251
assertions family, they check that a predicate returns true/success and

doc/hotspot-unit-tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Provide informative, but not too verbose error messages.
172172
All GoogleTest asserts print compared expressions and their values, so
173173
there is no need to have them in error messages. Asserts print only
174174
compared values, they do not print any of interim variables, e.g.
175-
`ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)` prints only
175+
`ASSERT_TRUE((val1 == val2 && isFail(foo(8))) || i == 18)` prints only
176176
one value. If you use some complex predicates, please consider
177177
`EXPECT_PRED*` or `EXPECT_FORMAT_PRED` assertions family, they check that
178178
a predicate returns true/success and print out all parameters values.

0 commit comments

Comments
 (0)