JDK-8191102 : Incorrect include file use in classLoader.hpp
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-11-12
  • Updated: 2019-06-20
  • Resolved: 2018-03-05
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.
JDK 11
11 b07Fixed
Related Reports
Relates :  
Relates :  
Description
In classLoader.hpp we have:

class ClassPathEntry : public CHeapObj<mtClass> {
...
  ClassPathEntry* next() const { return OrderAccess::load_acquire(&_next); }
...
  void set_next(ClassPathEntry* next) {
    OrderAccess::release_store(&_next, next);
  }

these are inline functions which in turn use inline functions of OrderAccess. However, classLoader.hpp only includes orderAccess.hpp while the definitions of the used functions are in orderAccess.inline.hpp. This is incorrect and may be causing problems with the latest VS2017 compiler:

http://mail.openjdk.java.net/pipermail/hotspot-dev/2017-November/029037.html
http://mail.openjdk.java.net/pipermail/hotspot-dev/2017-November/029043.html

However we can't include the .inline.hpp file in a .hpp file. Some refactoring needs to done if we are to preserve the inline definitions of these methods.
Comments
I still consider it a bug. If you don't include the definitions you may be relying on accidental behaviour.
24-02-2018

Changing this from bug to enhancement because it is more of a source restructure and cleanup than a bug fix.
23-02-2018

Overall our use of .inline.hpp versus .hpp remains quite a mess. Also this issue doesn't seem to be the cause of the VS2017 problem.
13-11-2017

There are some false positives in that list. The javaFrameAnchor_XXX.hpp are included in javaFrameAnchor.hpp which does (although it shouldn't!) include orderAccess.inline.hpp. atomic.hpp refers to OrderAccess:fence in a comment. Some files, eg method.hpp, don't include orderAccess*.hpp at all, so presumably there's an indirect include that needs to be tracked down. I didn't examine them all
13-11-2017

Searching the hotspot directory with egrep -r -H "OrderAccess::" . | egrep -v "\.inline\.hpp:" | egrep "\.hpp:" | sed 's/:.*$//' | uniq found 20 files with this issue.
12-11-2017