Details
-
Bug
-
Resolution: Fixed
-
P4
-
11, 13, 14
-
b24
-
generic
-
generic
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8248550 | 13.0.5 | Vladimir Kempik | P4 | Resolved | Fixed | b01 |
JDK-8267727 | 11.0.13-oracle | Harold Seigel | P4 | Resolved | Fixed | b01 |
JDK-8265306 | 11.0.12 | Lucy Schmidt | P4 | Resolved | Fixed | b01 |
Description
Status quo:
In many platform files, vm_version_<CPU>.hpp is included instead of runtime/vm_version.hpp. To make that work, vm_version_<CPU>.hpp has to include runtime/vm_version.hpp. For all those who (correctly) include runtime/vm_version.hpp, this file needs to include CPU_HEADER(vm_version). And here we have the cycle!
Thanks to the include guards, this cycle does not pop up as an issue.
It becomes a real problem when trying to extend runtime/vm_version.hpp by relying on declarations from vm_version_<CPU>.hpp. You would intuitively assume those declarations to be available after returning from include CPU_HEADER(vm_version). Intuition fools you if the include sequence is as above: vm_version_<CPU>.hpp -> runtime/vm_version.hpp -> CPU_HEADER(vm_version).
It seems beneficial not to include vm_version<CPU>.hpp directly, but only via runtime/vm_version.hpp. The proposed fix will do exactly that.
In many platform files, vm_version_<CPU>.hpp is included instead of runtime/vm_version.hpp. To make that work, vm_version_<CPU>.hpp has to include runtime/vm_version.hpp. For all those who (correctly) include runtime/vm_version.hpp, this file needs to include CPU_HEADER(vm_version). And here we have the cycle!
Thanks to the include guards, this cycle does not pop up as an issue.
It becomes a real problem when trying to extend runtime/vm_version.hpp by relying on declarations from vm_version_<CPU>.hpp. You would intuitively assume those declarations to be available after returning from include CPU_HEADER(vm_version). Intuition fools you if the include sequence is as above: vm_version_<CPU>.hpp -> runtime/vm_version.hpp -> CPU_HEADER(vm_version).
It seems beneficial not to include vm_version<CPU>.hpp directly, but only via runtime/vm_version.hpp. The proposed fix will do exactly that.
Attachments
Issue Links
- backported by
-
JDK-8248550 Break cycle in vm_version* includes
- Resolved
-
JDK-8265306 Break cycle in vm_version* includes
- Resolved
-
JDK-8267727 Break cycle in vm_version* includes
- Resolved
- relates to
-
JDK-8283614 [11] Repair compiler versions handling after backport of 8233787
- Resolved