Skip to content

Conversation

@coleenp
Copy link
Contributor

@coleenp coleenp commented May 18, 2023

Please review this change to use ByteSize and byte_offset_of() to refer to offsets to metadata and other types that are used in generated code. This avoids the int narrowing conversion warning for -Wconversion. There were a couple that I just added an (int) cast instead because these offsets are either being used in other code currently being changed (in oopDesc) or there are too many (like displaced_header_offset_in_bytes) and should be their own change.

This change takes a chunk out of the -Wconversion warnings - see CR for more info.

It might be easier and less tedious to review the commits separately. One commit renames blah_offset_in_bytes to blah_offset, since in_bytes(blah_offset()) is typically used (except in Address constructor which has an overload for ByteSize).

Tested with tier1-4, x86 and aarch64, and built linux-x64-zero linux-x64-zero-debug linux-aarch64-debug linux-s390x-open linux-arm32-debug linux-ppc64le-debug linux-riscv64-debug locally.


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-8308396: Fix offset_of conversion warnings in runtime code

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14053

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 18, 2023

👋 Welcome back coleenp! 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 added the rfr Pull request is ready for review label May 18, 2023
@openjdk
Copy link

openjdk bot commented May 18, 2023

@coleenp The following labels will be automatically applied to this pull request:

  • graal
  • hotspot

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

@openjdk openjdk bot added graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels May 18, 2023
@mlbridge
Copy link

mlbridge bot commented May 18, 2023

Webrevs

Copy link
Member

@offamitkumar offamitkumar left a comment

Choose a reason for hiding this comment

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

Testing for fastdebug build/ tier1 tests looks good on s390x.

I've given my suggestion for fixing the build-break, but I leave that upto you :-)

Copy link
Contributor

@jdksjolen jdksjolen left a comment

Choose a reason for hiding this comment

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

Hi,

This looks good to me, with one small nit.

@openjdk
Copy link

openjdk bot commented May 19, 2023

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

8308396: Fix offset_of conversion warnings in runtime code

Reviewed-by: amitkumar, jsjolen, fparain

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

  • a5343fa: 8281149: (fs) java/nio/file/FileStore/Basic.java fails with java.lang.RuntimeException: values differ by more than 1GB
  • 44218b1: 8308248: Revisit alignment of layout constants on 32-bit platforms
  • 80ef5c2: 8308410: broken compilation of test\jdk\tools\launcher\exeJliLaunchTest.c
  • 326d778: 8306057: False arguments calling dispatch_base for aarch64
  • 690d396: 8308408: Build failure with -Werror=maybe-uninitialized in libjli/java.c with GCC8
  • fa14314: 8303669: SelectVersion indexes past the end of the argv array
  • 25868b9: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage
  • 6765761: 8308118: Avoid multiarray allocations in AESCrypt.makeSessionKey
  • 97ade57: 8307609: RISC-V: Added support for Extract, Compress, Expand and other nodes for Vector API
  • e520cdc: 8308277: RISC-V: Improve vectorization of Match.sqrt() on floats
  • ... and 52 more: https://git.openjdk.org/jdk/compare/72294c5402dd11e3eb4922ad26e1b153098495ff...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.

➡️ 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 May 19, 2023
Copy link
Contributor

@fparain fparain left a comment

Choose a reason for hiding this comment

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

Looks good to me, only a few comments on the style.

@coleenp
Copy link
Contributor Author

coleenp commented May 19, 2023

Thank you for reviewing Amit, Johan and Fred.
/integrate

@openjdk
Copy link

openjdk bot commented May 19, 2023

Going to push as commit 265f40b.
Since your change was applied there have been 62 commits pushed to the master branch:

  • a5343fa: 8281149: (fs) java/nio/file/FileStore/Basic.java fails with java.lang.RuntimeException: values differ by more than 1GB
  • 44218b1: 8308248: Revisit alignment of layout constants on 32-bit platforms
  • 80ef5c2: 8308410: broken compilation of test\jdk\tools\launcher\exeJliLaunchTest.c
  • 326d778: 8306057: False arguments calling dispatch_base for aarch64
  • 690d396: 8308408: Build failure with -Werror=maybe-uninitialized in libjli/java.c with GCC8
  • fa14314: 8303669: SelectVersion indexes past the end of the argv array
  • 25868b9: 8132995: Matcher$ImmutableMatchResult should be optimized to reduce space usage
  • 6765761: 8308118: Avoid multiarray allocations in AESCrypt.makeSessionKey
  • 97ade57: 8307609: RISC-V: Added support for Extract, Compress, Expand and other nodes for Vector API
  • e520cdc: 8308277: RISC-V: Improve vectorization of Match.sqrt() on floats
  • ... and 52 more: https://git.openjdk.org/jdk/compare/72294c5402dd11e3eb4922ad26e1b153098495ff...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 19, 2023

@coleenp Pushed as commit 265f40b.

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

@coleenp coleenp deleted the Wconversion branch May 19, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants