-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8346990: Remove INTX_FORMAT and UINTX_FORMAT macros #22916
Conversation
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
@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:
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 136 new commits pushed to the
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 |
@coleenp The following labels will be automatically applied to this pull request:
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. |
Webrevs
|
Speaking of %z, there is a non Standard %Ix in os_windows.cpp tty->print_cr("reserve_memory of %Ix bytes took " JLONG_FORMAT " ms (" JLONG_FORMAT " ticks)", bytes,
reserveTimer.milliseconds(), reserveTimer.ticks()); Could changing that to %zu be trivial enough to fit into this change? |
I was going to take on the other FORMAT ones in separate PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uses of [U]INTX_FORMAT_X
have been replaced with 0x%zx
. I mentioned the
possibility of instead using %#zx
. I don't know if we really want to use some of
the (to me) more obscure flag options though.
Kim, thanks for slogging through this change. I've updated the patch with your suggested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've looked at so far it looks good! I noticed there are several cases where you mix format specifiers with macros. I understand that replacing other macros may not be in the scope of this change but I find it inconsistent in places where we have both.
I listed out some of the cases below, but if you don't believe this to be necessary you can ignore me.
The intention is to keep INTPTR_FORMAT and some of the other format specifiers that vary by platform. I have another issue to remove the SIZE_FORMAT ones but that's a bigger change. So this mixture is intentional. JLONG_FORMAT might be something we can remove too but I didn't want to do it all at once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I saw the discussion on UINTPTR_FORMAT_X_0
so I left it alone.
@@ -2497,7 +2497,7 @@ void ObjectMonitor::Initialize2() { | |||
void ObjectMonitor::print_on(outputStream* st) const { | |||
// The minimal things to print for markWord printing, more can be added for debugging and logging. | |||
st->print("{contentions=0x%08x,waiters=0x%08x" | |||
",recursions=" INTX_FORMAT ",owner=" INT64_FORMAT "}", | |||
",recursions=%zd,owner=" INT64_FORMAT "}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is INT64_FORMAT
different from INTX_FORMAT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently yes. The type underlying [u]intx varies by platform, being a 32-bit type on 32-bit platforms and a
64-bit type on 64-bit platforms. We've been trimming the set of supported 32-bit platforms though, so maybe
someday we won't need that distinction any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for a "dumb" question but %z
is for size_t arguments, so why are we using it to replace INTX/UINTX_FORMAT ??? I get that size_t and intx happen to be the same size but still ... if I see %z
I expect to see a size_t argument passed in.
They are interchangeable and some places used UINTX_FORMAT when they should have used SIZE_FORMAT. The error message can be confusing though because the error message for %z refers to size_t. But some of our use of intx should probably be size_t. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still good.
Thank you Matias, Kim and David. |
Going to push as commit 379d05b.
Your commit was automatically rebased without conflicts. |
We have belatedly discovered that |
There are a lot of format modifiers that are noisy and unnecessary in the code. This change removes the INTX variants. It's not that disruptive even for backporting because %z modifier has been available for a long time so should backport fine. This was mostly done with a sed script plus some hand fixups.
Testing mach5 and other platform cross compilations in progress. Opening this for GHA testing.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22916/head:pull/22916
$ git checkout pull/22916
Update a local copy of the PR:
$ git checkout pull/22916
$ git pull https://git.openjdk.org/jdk.git pull/22916/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22916
View PR using the GUI difftool:
$ git pr show -t 22916
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22916.diff
Using Webrev
Link to Webrev Comment