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

8307423: [s390x] Represent Registers as values #13805

Closed
wants to merge 4 commits into from

Conversation

offamitkumar
Copy link
Member

@offamitkumar offamitkumar commented May 4, 2023

The recent Register implementation uses wild pointer (including null pointer) dereferences which exhibit undefined behavior. We should migrate away from pointer-based representation of Register values as it was done for x86 (JDK-8292153). Problems exist when trying to build with GCC 11.3.0 (JDK-8307093).

Tested fastdebug, slowdebug, optimized, release build , tier1-test on fastdebug build and build with GCC-9.5.0 as well.


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

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13805

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 4, 2023

👋 Welcome back amitkumar! 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 openjdk bot changed the title 8307423 8307423: s390x: Represent Registers as values May 4, 2023
@openjdk openjdk bot added the rfr Pull request is ready for review label May 4, 2023
@openjdk
Copy link

openjdk bot commented May 4, 2023

@offamitkumar 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 May 4, 2023
@mlbridge
Copy link

mlbridge bot commented May 4, 2023

Webrevs

@offamitkumar offamitkumar changed the title 8307423: s390x: Represent Registers as values 8307423: [s390x] Represent Registers as values May 4, 2023
@offamitkumar offamitkumar changed the title 8307423: [s390x] Represent Registers as values 8307423 May 4, 2023
@openjdk openjdk bot changed the title 8307423 8307423: [s390x] Represent Registers as values May 4, 2023
@offamitkumar
Copy link
Member Author

Hi @RealLucy, @TheRealMDoerr

Please review the changes.
Thank you

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

LGTM. Please consider my minor suggestions.

src/hotspot/cpu/s390/register_s390.hpp Outdated Show resolved Hide resolved
src/hotspot/cpu/s390/assembler_s390.hpp Show resolved Hide resolved
src/hotspot/cpu/s390/register_s390.hpp Outdated Show resolved Hide resolved
@openjdk
Copy link

openjdk bot commented May 4, 2023

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

8307423: [s390x] Represent Registers as values

Reviewed-by: mdoerr, lucy

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 116 new commits pushed to the master branch:

  • ad0e5a9: 8304720: SuperWord::schedule should rebuild C2-graph from SuperWord dependency-graph
  • 495f268: 8306966: RISC-V: Support vector cast node for Vector API
  • 0dca573: 8301739: AArch64: Add optimized rules for vector compare with immediate for SVE
  • 3d3eaed: 8306941: Open source several datatransfer and dnd AWT tests
  • 1f57ce0: 8307446: RISC-V: Improve performance of floating point to integer conversion
  • 4e4828e: 8307553: Remove dead code MetaspaceClosure::push_method_entry
  • 7d58978: 8280031: Deprecate GTK2 for removal
  • b5922c3: 8305846: Support compilation in Proc test utility
  • 73ac710: 8307425: Socket input stream read burns CPU cycles with back-to-back poll(0) calls
  • e2b1013: 8306326: [BACKOUT] 8277573: VmObjectAlloc is not generated by intrinsics methods which allocate objects
  • ... and 106 more: https://git.openjdk.org/jdk/compare/cf799ba232dcacd1d91a7dab4dc4bf8de9ac258e...master

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TheRealMDoerr, @RealLucy) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 4, 2023
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed ready Pull request is ready to be integrated labels May 5, 2023
Copy link
Contributor

@RealLucy RealLucy left a comment

Choose a reason for hiding this comment

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

Your changes look good to me.

There is one fact I do not like. It was not introduced by this PR, but could easily be fixed now.

The value to indicate "this is not a register" is "-1", used as a literal in multiple places. I would rather see
#define NOREG_ENCODING -1
and then
constexpr Register(int encoding = NOREG_ENCODING) : _encoding(encoding) {}

Searching for "-1" in register_s390.hpp will reveal all affected locations.

@offamitkumar offamitkumar requested a review from RealLucy May 5, 2023 12:47
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed ready Pull request is ready to be integrated labels May 5, 2023
@offamitkumar
Copy link
Member Author

@TheRealMDoerr, do you think applying #define NOREG_ENCODING -1 change to PPC as well, will be a good idea ?

@RealLucy
Copy link
Contributor

RealLucy commented May 5, 2023

@TheRealMDoerr, do you think applying #define NOREG_ENCODING -1 change to PPC as well, will be a good idea ?

If so, it should be done in a separate PR.

Copy link
Contributor

@RealLucy RealLucy left a comment

Choose a reason for hiding this comment

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

Even more requests - sorry.

src/hotspot/cpu/s390/register_s390.hpp Outdated Show resolved Hide resolved
src/hotspot/cpu/s390/register_s390.hpp Outdated Show resolved Hide resolved
src/hotspot/cpu/s390/register_s390.hpp Outdated Show resolved Hide resolved
src/hotspot/cpu/s390/register_s390.hpp Outdated Show resolved Hide resolved
src/hotspot/cpu/s390/register_s390.hpp Outdated Show resolved Hide resolved
@offamitkumar offamitkumar requested a review from RealLucy May 6, 2023 02:26
Copy link
Contributor

@RealLucy RealLucy left a comment

Choose a reason for hiding this comment

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

LGTM
Thank you for fixing, and for taking my requests into consideration.

Copy link
Contributor

@RealLucy RealLucy left a comment

Choose a reason for hiding this comment

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

LGTM
Thank you for fixing, and for taking my requests into consideration.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed ready Pull request is ready to be integrated labels May 8, 2023
@offamitkumar
Copy link
Member Author

Thanks @RealLucy @TheRealMDoerr

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 8, 2023
@openjdk
Copy link

openjdk bot commented May 8, 2023

@offamitkumar
Your change (at version 514d7d8) is now ready to be sponsored by a Committer.

@RealLucy
Copy link
Contributor

RealLucy commented May 8, 2023

/sponsor

@openjdk
Copy link

openjdk bot commented May 8, 2023

Going to push as commit 8bbd264.
Since your change was applied there have been 117 commits pushed to the master branch:

  • 959e62c: 8307521: Introduce check_oop infrastructure to check oops in the oop class
  • ad0e5a9: 8304720: SuperWord::schedule should rebuild C2-graph from SuperWord dependency-graph
  • 495f268: 8306966: RISC-V: Support vector cast node for Vector API
  • 0dca573: 8301739: AArch64: Add optimized rules for vector compare with immediate for SVE
  • 3d3eaed: 8306941: Open source several datatransfer and dnd AWT tests
  • 1f57ce0: 8307446: RISC-V: Improve performance of floating point to integer conversion
  • 4e4828e: 8307553: Remove dead code MetaspaceClosure::push_method_entry
  • 7d58978: 8280031: Deprecate GTK2 for removal
  • b5922c3: 8305846: Support compilation in Proc test utility
  • 73ac710: 8307425: Socket input stream read burns CPU cycles with back-to-back poll(0) calls
  • ... and 107 more: https://git.openjdk.org/jdk/compare/cf799ba232dcacd1d91a7dab4dc4bf8de9ac258e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 8, 2023
@openjdk openjdk bot closed this May 8, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels May 8, 2023
@openjdk
Copy link

openjdk bot commented May 8, 2023

@RealLucy @offamitkumar Pushed as commit 8bbd264.

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

@offamitkumar offamitkumar deleted the JDK-8307423 branch May 24, 2023 09:05
@offamitkumar
Copy link
Member Author

/backport jdk17u-dev

@openjdk
Copy link

openjdk bot commented May 8, 2024

@offamitkumar Could not automatically backport 8bbd264c to openjdk/jdk17u-dev due to conflicts in the following files:

  • src/hotspot/cpu/s390/interpreterRT_s390.cpp
  • src/hotspot/cpu/s390/methodHandles_s390.cpp
  • src/hotspot/cpu/s390/sharedRuntime_s390.cpp

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk17u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk17u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b backport-offamitkumar-8bbd264c

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git 8bbd264c6e4b4045a218f11ae6b5b4f395bc2aa9

# Backport the commit
$ git cherry-pick --no-commit 8bbd264c6e4b4045a218f11ae6b5b4f395bc2aa9
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 8bbd264c6e4b4045a218f11ae6b5b4f395bc2aa9'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk17u-dev with the title Backport 8bbd264c6e4b4045a218f11ae6b5b4f395bc2aa9.

Below you can find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 8bbd264c from the openjdk/jdk repository.

The commit being backported was authored by Amit Kumar on 8 May 2023 and was reviewed by Martin Doerr and Lutz Schmidt.

Thanks!

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