@@ -207,23 +207,31 @@ <h3 id="source-files">Source Files</h3>
207
207
< ul >
208
208
< li > < p > All source files must have a globally unique basename. The build
209
209
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
216
< 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 >
213
219
< li > < p > .inline.hpp files should only be included in .cpp or .inline.hpp
214
220
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 >
220
231
< li > < p > Some build configurations use precompiled headers to speed up the
221
232
build times. The precompiled headers are included in the precompiled.hpp
222
233
file. Note that precompiled.hpp is just a build time optimization, so
223
234
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 >
227
235
</ ul >
228
236
< h3 id ="jtreg-tests "> JTReg Tests</ h3 >
229
237
< ul >
0 commit comments