Skip to content

Commit 4c9d063

Browse files
authoredMar 20, 2025
Merge pull request #1939 from SAP/pr-jdk-25+14
Merge to tag jdk-25+14
2 parents 2a2cbbf + 51dcc96 commit 4c9d063

File tree

624 files changed

+28504
-23058
lines changed

Some content is hidden

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

624 files changed

+28504
-23058
lines changed
 

‎doc/hotspot-style.html

+18-10
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>
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>
220231
<li><p>Some build configurations use precompiled headers to speed up the
221232
build times. The precompiled headers are included in the precompiled.hpp
222233
file. Note that precompiled.hpp is just a build time optimization, so
223234
don't rely 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>
227235
</ul>
228236
<h3 id="jtreg-tests">JTReg Tests</h3>
229237
<ul>

‎doc/hotspot-style.md

+21-8
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,19 +155,23 @@ 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.
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.
152169

153170
* Some build configurations use precompiled headers to speed up the
154171
build times. The precompiled headers are included in the precompiled.hpp
155172
file. Note that precompiled.hpp is just a build time optimization, so
156173
don't rely on it to resolve include problems.
157174

158-
* Keep the include lines alphabetically sorted.
159-
160-
* Put conditional inclusions (`#if ...`) at the end of the include list.
161-
162175
### JTReg Tests
163176

164177
* JTReg tests should have meaningful names.

0 commit comments

Comments
 (0)
Please sign in to comment.