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

8252182: [JEP 390] Diagnose synchronization on @ValueBased classes #274

Closed
wants to merge 8 commits into from

Conversation

@lfoltan
Copy link
Member

@lfoltan lfoltan commented Nov 20, 2020

Please review the following changes to add JVM support for @ValueBased class annotation.


Progress

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

Testing

Linux x64 Linux x86 Windows x64 macOS x64
Build (4/6 running) (2/2 running) (2/2 running) (2/2 running)

Issue

  • JDK-8252182: [JEP 390] Diagnose synchronization on @ValueBased classes

Reviewers

Download

$ git fetch https://git.openjdk.java.net/valhalla pull/274/head:pull/274
$ git checkout pull/274

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 20, 2020

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

@openjdk openjdk bot added the rfr label Nov 20, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 20, 2020

Copy link
Collaborator

@fparain fparain left a comment

Looks good to me.
Just one comment: The ValueBased annotation is ignored for non-privileged classes, this would prevent users from testing their own code with the DiagnoseSyncOnValueBasedClasses flag. Is there a particular reason to not enforce the ValueBased annotation on user code?

Fred

@openjdk
Copy link

@openjdk openjdk bot commented Nov 23, 2020

@lfoltan this pull request can not be integrated into jep390 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 bug_8252182
git fetch https://git.openjdk.java.net/valhalla jep390
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge jep390"
git push

Copy link
Member

@hseigel hseigel left a comment

The changes look good! Can the check for "DiagnoseSyncOnValueBasedClasses != 0" be removed from lines 330 and 442? I don't think "obj->klass()->is_value_based()" will be TRUE unless "DiagnoseSyncOnValueBasedClasses != 0".

Perhaps do an assert instead?

@RogerRiggs
Copy link
Collaborator

@RogerRiggs RogerRiggs commented Nov 23, 2020

Looks good to me.
Just one comment: The ValueBased annotation is ignored for non-privileged classes, this would prevent users from testing their own code with the DiagnoseSyncOnValueBasedClasses flag. Is there a particular reason to not enforce the ValueBased annotation on user code?

Fred

The jdk.internal.ValueBased annotation is internal to the base module and only defined for use by the JDK implementation as per JEP 390. It is intended to indicate that an application or library is using a system class instance incorrectly.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 23, 2020

Mailing list message from Frederic Parain on valhalla-dev:

Thank you for the explanation.

Fred

@openjdk openjdk bot removed the merge-conflict label Nov 23, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Nov 23, 2020

⚠️ @lfoltan This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@lfoltan
Copy link
Member Author

@lfoltan lfoltan commented Nov 23, 2020

Thank you Harold, I have made your suggested changes to runtime/synchronizer.cpp

@lfoltan
Copy link
Member Author

@lfoltan lfoltan commented Nov 23, 2020

Thank you Fred for the review.

Copy link
Member

@hseigel hseigel left a comment

Changes look good. Thanks for doing this!

@openjdk
Copy link

@openjdk openjdk bot commented Nov 24, 2020

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

8252182: [JEP 390] Diagnose synchronization on @ValueBased classes

Reviewed-by: fparain, hseigel

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 jep390 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 jep390 branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Nov 24, 2020
@lfoltan
Copy link
Member Author

@lfoltan lfoltan commented Nov 24, 2020

/integrate

@openjdk openjdk bot closed this Nov 24, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Nov 24, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Nov 24, 2020

@lfoltan Pushed as commit eec3823.

💡 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
4 participants