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

Break circular include dependency in objArrayOop.inline.hpp

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • None
    • hotspot
    • None
    • gc
    • b18

    Description

      There's a circular dependency of the includes in objArrayOop.inline.hpp. This does not show up in the current main line, but caused compilation errors in a JFR enhancement.

      The objArrayOop.inline.hpp can't even be compiled by itself:

      In file included from /home/stefank/git/alt2/open/src/hotspot/share/oops/access.inline.hpp:28,
                       from /home/stefank/git/alt2/open/src/hotspot/share/oops/objArrayOop.inline.hpp:28:
      /home/stefank/git/alt2/open/src/hotspot/share/gc/shared/barrierSet.inline.hpp: In static member function 'static bool BarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_arraycopy_in_heap(arrayOop, size_t, T*, arrayOop, size_t, T*, size_t)':
      /home/stefank/git/alt2/open/src/hotspot/share/gc/shared/barrierSet.inline.hpp:48:48: error: invalid use of incomplete type 'class objArrayOopDesc' [-Werror]
         48 | Klass* const dst_klass = objArrayOop(dst_obj)->element_klass();

      objArrayOop.inline.hpp includes access.inline.hpp, which in turn
      includes barrierSet.inline.hpp, which includes objArrayOop.inline.hpp. This means oopsHierarchy.hpp, that is supposed to be included by objArrayOop.inline.hpp, isn't included before it is then used by barrierSet.inline.hpp.

      The proposed fix is to change the inclusion of access.inline.hpp to access.hpp, in objArrayOop.inline.hpp

      Attachments

        Issue Links

          Activity

            People

              stefank Stefan Karlsson
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: