Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8265052: Break circular include dependency in objArrayOop.inline.hpp #3431

Conversation

@stefank
Copy link
Member

@stefank stefank commented Apr 12, 2021

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


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8265052: Break circular include dependency in objArrayOop.inline.hpp

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3431/head:pull/3431
$ git checkout pull/3431

Update a local copy of the PR:
$ git checkout pull/3431
$ git pull https://git.openjdk.java.net/jdk pull/3431/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3431

View PR using the GUI difftool:
$ git pr show -t 3431

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3431.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 12, 2021

👋 Welcome back stefank! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Apr 12, 2021

@stefank The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

Loading

@openjdk openjdk bot added the hotspot label Apr 12, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 12, 2021

Webrevs

Loading

Copy link
Contributor

@tschatzl tschatzl left a comment

Lgtm.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Apr 12, 2021

@stefank This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8265052: Break circular include dependency in objArrayOop.inline.hpp

Reviewed-by: tschatzl, egahlin, dholmes

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 4 new commits pushed to the master branch:

  • e604320: 8264783: G1 BOT verification should not verify beyond allocation threshold
  • cb2806d: 8265018: [AIX] FileDispatcherImpl.c:31:10: fatal error: 'sys/mount.h' file not found
  • ecef1fc: 8264972: Unused TypeFunc declared in OptoRuntime
  • 440c34a: 8264644: Add PrintClassLoaderDataGraphAtExit to print the detailed CLD graph

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

Loading

@openjdk openjdk bot added the ready label Apr 12, 2021
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Hi Stefan,

Fix seems fine. Though it seems somewhat fortuitous that the inline functions used by this inline header file are actually declared in the non-inline version of the access header file.

Thanks,
David

Loading

@stefank
Copy link
Member Author

@stefank stefank commented Apr 12, 2021

Fix seems fine. Though it seems somewhat fortuitous that the inline functions used by this inline header file are actually declared in the non-inline version of the access header file.

Yes, I agree.

Thanks for reviewing @dholmes-ora, @egahlin and @tschatzl

Loading

@stefank
Copy link
Member Author

@stefank stefank commented Apr 12, 2021

Build testing passed
/integrate

Loading

@openjdk openjdk bot closed this Apr 12, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Apr 12, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 12, 2021

@stefank Since your change was applied there have been 9 commits pushed to the master branch:

  • b90ad76: 8233567: [TESTBUG] FocusSubRequestTest.java fails on macos
  • 125184e: 8265012: Shenandoah: Backout JDK-8264718
  • be0d46c: 8262068: Improve G1 Full GC by skipping compaction for regions with high survival ratio
  • f71be8b: 8264954: unified handling for VectorMask object re-materialization during de-optimization
  • 3c9858d: 8264827: Large mapped buffer/segment crash the VM when calling isLoaded
  • e604320: 8264783: G1 BOT verification should not verify beyond allocation threshold
  • cb2806d: 8265018: [AIX] FileDispatcherImpl.c:31:10: fatal error: 'sys/mount.h' file not found
  • ecef1fc: 8264972: Unused TypeFunc declared in OptoRuntime
  • 440c34a: 8264644: Add PrintClassLoaderDataGraphAtExit to print the detailed CLD graph

Your commit was automatically rebased without conflicts.

Pushed as commit 7c20d97.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Loading

@stefank stefank deleted the 8265052_objArrayOop_inline_hpp_circular_dependency branch May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants