JDK-8154079 : Catch incorrectly included .inline.hpp files
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2016-04-12
  • Updated: 2019-02-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
To minimize include dependencies we have a rule on our style guide page stating that .inline.hpp files should not be included in .hpp files:

https://wiki.openjdk.java.net/display/HotSpot/StyleGuide
* .inline.hpp files should only be included in .cpp or .inline.hpp files.

I propose that we use the include list in precompiled.hpp, some preprocessor checks, and a way to "tag" specific .inline.hpp to check for "incorrect" includes of these .inline.hpp checks.


Comments
Maybe this can be done as a sanity check by the build system? I just tried this naive command line: grep "inline.hpp\"" -r src/hotspot/ | grep hpp: | grep -v inline.hpp: | grep -v precompiled.hpp: And got the following list of offenders: src/hotspot//share/memory/metaspaceClosure.hpp:#include "utilities/hashtable.inline.hpp" src/hotspot//share/jfr/writers/jfrNativeEventWriter.hpp:#include "jfr/writers/jfrEventWriterHost.inline.hpp" src/hotspot//share/jfr/writers/jfrNativeEventWriter.hpp:#include "jfr/writers/jfrMemoryWriterHost.inline.hpp" src/hotspot//share/jfr/writers/jfrStorageHost.hpp:#include "jfr/writers/jfrPosition.inline.hpp" src/hotspot//share/jfr/writers/jfrMemoryWriterHost.hpp:#include "jfr/writers/jfrStorageHost.inline.hpp" src/hotspot//share/jfr/writers/jfrStreamWriterHost.hpp:#include "jfr/writers/jfrMemoryWriterHost.inline.hpp" src/hotspot//share/jfr/writers/jfrBigEndianWriter.hpp:#include "jfr/writers/jfrMemoryWriterHost.inline.hpp" src/hotspot//share/jfr/writers/jfrBigEndianWriter.hpp:#include "jfr/writers/jfrWriterHost.inline.hpp" src/hotspot//share/jfr/writers/jfrEventWriterHost.hpp:#include "jfr/writers/jfrWriterHost.inline.hpp" src/hotspot//share/jfr/utilities/jfrHashtable.hpp:#include "memory/allocation.inline.hpp" src/hotspot//share/jfr/recorder/repository/jfrChunkWriter.hpp:#include "jfr/writers/jfrStreamWriterHost.inline.hpp" src/hotspot//share/jfr/recorder/repository/jfrChunkWriter.hpp:#include "jfr/writers/jfrWriterHost.inline.hpp" src/hotspot//share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp:#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp" src/hotspot//share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp:#include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp" src/hotspot//share/jfr/recorder/checkpoint/jfrCheckpointWriter.hpp:#include "jfr/writers/jfrEventWriterHost.inline.hpp" src/hotspot//share/jfr/recorder/checkpoint/jfrCheckpointWriter.hpp:#include "jfr/writers/jfrMemoryWriterHost.inline.hpp" src/hotspot//share/jfr/recorder/service/jfrEvent.hpp:#include "jfr/recorder/jfrEventSetting.inline.hpp" src/hotspot//share/jfr/leakprofiler/utilities/unifiedOop.hpp:#include "oops/oop.inline.hpp" src/hotspot//share/jfr/leakprofiler/chains/bitset.hpp:#include "utilities/bitMap.inline.hpp" src/hotspot//share/classfile/classListParser.hpp:#include "utilities/hashtable.inline.hpp" src/hotspot//share/gc/shared/workerManager.hpp:#include "runtime/os.inline.hpp" src/hotspot//share/gc/shared/workerManager.hpp:#include "runtime/thread.inline.hpp" src/hotspot//share/gc/shared/parallelCleaning.hpp:#include "classfile/classLoaderDataGraph.inline.hpp" src/hotspot//share/gc/shenandoah/shenandoahTaskqueue.hpp:#include "gc/shared/taskqueue.inline.hpp" src/hotspot//share/gc/shenandoah/shenandoahStringDedup.hpp:#include "classfile/javaClasses.inline.hpp" I could make a somewhat nicer looking version of this, and add as part of the build system, failing the build if it finds anything. But then, someone would need to fix these offenders before I can activate it.
15-01-2019

See the discussion in this mail thread for more information: http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-April/022626.html
07-03-2018