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

8288623: Move Continuation classes out of javaClasses.hpp #9191

Conversation

iklam
Copy link
Member

@iklam iklam commented Jun 16, 2022

javaClasses.hpp is getting too big - it contains the C++ representation of over 50 Java classes.

The RFE moves the following classes into a new file, continuationJavaClasses.hpp. The naming follows the same pattern as the existing header share/jvmci/jvmciJavaClasses.hpp.

  • jdk_internal_vm_ContinuationScope
  • jdk_internal_vm_Continuation
  • jdk_internal_vm_StackChunk

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8288623: Move Continuation classes out of javaClasses.hpp

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9191/head:pull/9191
$ git checkout pull/9191

Update a local copy of the PR:
$ git checkout pull/9191
$ git pull https://git.openjdk.org/jdk pull/9191/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9191

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9191.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 16, 2022

👋 Welcome back iklam! 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.

@openjdk
Copy link

openjdk bot commented Jun 16, 2022

@iklam 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.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Jun 16, 2022
@iklam iklam marked this pull request as ready for review June 16, 2022 19:56
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 16, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 16, 2022

Copy link
Member

@stefank stefank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are about to start to squirrel away parts of javaClasses into new files, I wonder if the discoverability of these functions will be better if we use this naming instead:

javaClasses.hpp
javaClassesContinuation.hpp
javaClassesInvoke.hpp
...

instead of:

javaClasses.hpp
continuationJavaClasses.hpp
invokeJavaClasses.hpp
...

Comment on lines 25 to 26
#ifndef SHARE_CLASSFILE_JDK_INTERNAL_VM_STACKCHUNK_INLINE_HPP
#define SHARE_CLASSFILE_JDK_INTERNAL_VM_STACKCHUNK_INLINE_HPP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This include guard doesn't follow the current naming convention.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been resolved.

@coleenp
Copy link
Contributor

coleenp commented Jun 17, 2022

The naming of this follows what jvmci did - they have jvmciJavaClasses.hpp/cpp. Discovering continuation* is also something useful.

@iklam
Copy link
Member Author

iklam commented Jun 17, 2022

If we are about to start to squirrel away parts of javaClasses into new files, I wonder if the discoverability of these functions will be better if we use this naming instead:

javaClasses.hpp
javaClassesContinuation.hpp
javaClassesInvoke.hpp
...

instead of:

javaClasses.hpp
continuationJavaClasses.hpp
invokeJavaClasses.hpp
...

I am not in love with either naming convention (the names are too long), but the latter sounds more grammatically correct. Also, as Coleen mentioned, if we choose the former, we need to rename jvmciJavaClasses.hpp as well.

The former can be discovered as javaClasses* and the latter as *avaClasses*, so there's not much difference.

Comment on lines 28 to 29
#include "classfile/javaClasses.hpp"
#include "classfile/continuationJavaClasses.hpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include order

Comment on lines 30 to 31
#include "oops/stackChunkOop.hpp"
#include "gc/g1/g1BarrierSet.hpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include order

Comment on lines 25 to 26
#ifndef SHARE_CLASSFILE_JAVACLASSES_IMPL_HPP
#define SHARE_CLASSFILE_JAVACLASSES_IMPL_HPP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convention is to name this:
SHARE_CLASSFILE_JAVACLASSESIMPL_HPP

Comment on lines 26 to 28
#include "classfile/javaClassesImpl.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/continuationJavaClasses.hpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include order

@stefank
Copy link
Member

stefank commented Jun 17, 2022

I've talked to Ioi and Coleen about whether javaClasses or continuations should be considered as the most relevant subsystem. Their take is that continuations is. I'm warming up to that thought, but I think I'd then would prefer if continuationsJavaClasses.hpp etc. get moved to where the other continuation files are, in the runtime/ directory.

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this split very much. JavaClasses was getting too unwieldy. I'm ambivalent whether continuationJavaClasses.cpp/hpp should go in the runtime directory, so please take Stefan's recommendation and move it there. Tnanks.

@openjdk
Copy link

openjdk bot commented Jun 21, 2022

@iklam 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:

8288623: Move Continuation classes out of javaClasses.hpp

Reviewed-by: stefank, coleenp

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 21, 2022
Copy link
Member

@stefank stefank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started to add comments to the PR, but then realized it would be easier to just provide a patch with my suggestions. Please take a look at:
https://github.com/stefank/jdk/tree/pr_9191

Comment on lines 28 to 32
#include "classfile/javaClasses.hpp"
#include "classfile/continuationJavaClasses.hpp"
#include "oops/access.inline.hpp"
#include "oops/stackChunkOop.hpp"
#include "logging/log.hpp"
#include "oops/access.inline.hpp"
#include "oops/stackChunkOop.inline.hpp"
#include "runtime/continuationJavaClasses.hpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .inline.hpp files should include the corresponding .hpp file as the first included file. This is a fairly recently addition to the style guide, that we did to resolve the compilation problems with circular dependencies between the .inline.hpp files. So, please change this to:

#include "runtime/continuationJavaClasses.hpp"

#include "classfile/javaClasses.hpp"
#include "logging/log.hpp"
#include "oops/access.inline.hpp"
#include "oops/stackChunkOop.inline.hpp"

Comment on lines 25 to 26
#ifndef SHARE_CLASSFILE_JDK_INTERNAL_VM_STACKCHUNK_INLINE_HPP
#define SHARE_CLASSFILE_JDK_INTERNAL_VM_STACKCHUNK_INLINE_HPP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been resolved.

*/

#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is classfile/javaClasses.hpp included in this file?

#define SHARE_CLASSFILE_CONTINUATIONJAVACLASSES_HPP

#include "memory/allStatic.hpp"
#include "oops/oop.hpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oop isn't used in this function, include oopsHierarchy.hpp instead. This file should also include globalDefinitions.hpp and macros.hpp

Comment on lines 25 to 26
#ifndef SHARE_CLASSFILE_CONTINUATIONJAVACLASSES_HPP
#define SHARE_CLASSFILE_CONTINUATIONJAVACLASSES_HPP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include guard needs to be updated.

Comment on lines +63 to +64


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spurious newline

@@ -220,159 +218,6 @@ inline void java_lang_Thread::set_jfr_epoch(oop ref, u2 epoch) {
}
#endif // INCLUDE_JFR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spurious newline

@@ -0,0 +1,110 @@
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should also move to runtime/

@openjdk
Copy link

openjdk bot commented Jun 22, 2022

@iklam this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout 8288623-move-continuation-out-of-javaClasses-hpp
git fetch https://git.openjdk.org/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed ready Pull request is ready to be integrated labels Jun 22, 2022
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels Jun 22, 2022
@iklam
Copy link
Member Author

iklam commented Jun 22, 2022

Hi @stefank, thank you so much for providing the additional fixes. I have incorporated them into my PR and also synced with Coleen's javaThread.hpp split PR (#9218). Doing more thorough build testing now.

@iklam
Copy link
Member Author

iklam commented Jun 24, 2022

Thanks to @stefank and @coleenp for the review.

  • Passes our CI tier1 and build-tier5.
  • GHA linux-x86 errors are unrelated to my changes.

/integrate

@openjdk
Copy link

openjdk bot commented Jun 24, 2022

Going to push as commit 64782a7.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 24, 2022
@openjdk openjdk bot closed this Jun 24, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 24, 2022
@openjdk
Copy link

openjdk bot commented Jun 24, 2022

@iklam Pushed as commit 64782a7.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
4 participants