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
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