Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8233787

Break cycle in vm_version* includes

XMLWordPrintable

    • b24
    • generic
    • generic

        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.

              lucy Lutz Schmidt
              lucy Lutz Schmidt
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: