-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8359227: Code cache/heap size options should be size_t #25791
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
Conversation
👋 Welcome back kbarrett! A progress list of the required criteria for merging this PR into |
@kimbarrett 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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
@kimbarrett 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. |
In addition to adjusting the types, there are some code changes to deal with One change in particular to note is the change in compilationPolicy.cpp. The The reason for my looking at these options in the first place is the incorrect |
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.
Thank you for working on this, @kimbarrett. Good to see more consistent types here.
The changes overall look good to me. I only have a question and some minor suggestions.
One change in particular to note is the change in compilationPolicy.cpp. The
calculation of max_count, depending on explicit option values and such, could
potentially overflow its prior int type, effectively having a random value.
There is still a possibility of a nonsense result if ReservedCodeCacheSize and
CodeCacheMinimumUseSpace are poorly chosen. I'm leaving that pre-existing
issue to the compiler team to deal with.
Thank you for pointing this out. I'm currently looking at that part of the code in #25770 and will fix it there.
#include <type_traits> | ||
|
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 this related to this change? I cannot find any usages from this header in the diff.
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.
Oops. Leftover from an abandoned idea. Removed now.
#define ADD_BOOL_FLAG(name) ADD_FLAG(bool, name, BOXED_BOOLEAN) | ||
#define ADD_INT_FLAG(name) ADD_FLAG(int, name, BOXED_LONG) | ||
#define ADD_SIZE_T_FLAG(name) ADD_FLAG(size_t, name, BOXED_LONG) | ||
#define ADD_INTX_FLAG(name) ADD_FLAG(intx, name, BOXED_LONG) | ||
#define ADD_UINTX_FLAG(name) ADD_FLAG(uintx, name, BOXED_LONG) |
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.
#define ADD_BOOL_FLAG(name) ADD_FLAG(bool, name, BOXED_BOOLEAN) | |
#define ADD_INT_FLAG(name) ADD_FLAG(int, name, BOXED_LONG) | |
#define ADD_SIZE_T_FLAG(name) ADD_FLAG(size_t, name, BOXED_LONG) | |
#define ADD_INTX_FLAG(name) ADD_FLAG(intx, name, BOXED_LONG) | |
#define ADD_UINTX_FLAG(name) ADD_FLAG(uintx, name, BOXED_LONG) | |
#define ADD_BOOL_FLAG(name) ADD_FLAG(bool, name, BOXED_BOOLEAN) | |
#define ADD_INT_FLAG(name) ADD_FLAG(int, name, BOXED_LONG) | |
#define ADD_SIZE_T_FLAG(name) ADD_FLAG(size_t, name, BOXED_LONG) | |
#define ADD_INTX_FLAG(name) ADD_FLAG(intx, name, BOXED_LONG) | |
#define ADD_UINTX_FLAG(name) ADD_FLAG(uintx, name, BOXED_LONG) |
Feel free to ignore, but since you are already touching this, we might as well align it.
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.
I'd rather not. I'm not a fan of this kind of formatting. I moved the ADD_FLAG
calls over to
maintain the pre-existing formatting after adding the longer than anything else ADD_SIZE_T_FLAG
,
but the ADD_FLAG
arguments were not lined up and I'd just as soon leave them that way.
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.
not sure being a fan or not is sufficient reason...
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.
Leaving it as is maintains the status quo. I'm not proposing to delete the extra whitespace in front of
ADD_FLAG
, which would be my preferred layout. And the comment does say "feel free to ignore".
@@ -2448,7 +2448,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, JVMFlagOrigin | |||
"Invalid maximum code cache size: %s.\n", option->optionString); | |||
return JNI_EINVAL; | |||
} | |||
if (FLAG_SET_CMDLINE(ReservedCodeCacheSize, (uintx)long_ReservedCodeCacheSize) != JVMFlag::SUCCESS) { | |||
if (FLAG_SET_CMDLINE(ReservedCodeCacheSize, (size_t)long_ReservedCodeCacheSize) != JVMFlag::SUCCESS) { |
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 this cast correct on a 32-bit platform, where size_t
is not the same as uint64_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.
This isn't any different from the previous code, as uintx is also a 32/64 bit
type on 32/64 bit platforms. And it's fine, as the default for the maximum
value for parse_memory_size is max_uintx.
@@ -37,7 +37,7 @@ | |||
|
|||
public class UintxTest { | |||
private static final String FLAG_NAME = "VerifyGCStartAt"; | |||
private static final String FLAG_DEBUG_NAME = "CodeCacheMinimumUseSpace"; | |||
private static final String FLAG_DEBUG_NAME = "StopInterpreterAt"; |
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.
Hi, Does this change is a mistake. Why do we change the FLAG_DEBUG_NAME
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.
Because CodeCacheMinimumUseSpace is no longer uintx-typed, it's now size_t. So the test needs to use
some other uintx-typed option.
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.
Thank you for addressing the comments. Looks good to me!
@kimbarrett this pull request can not be integrated into git checkout code-cache-sizes
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
Sigh, there are new merge conflicts after the one I just pushed a fix for. |
Sorry to request re-review, but there was a merge conflict, which I fixed, and |
/integrate |
@kimbarrett Pushed as commit 7bc0d82. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this change that makes the various code cache/heap size options
consistently be of type size_t.
The shared declarations for these options were all uintx. These options all
may have platform-defined values. Some of those platform-specific definitions
were uintx, some were size_t, and some were intx(!). This change makes them
all consistently size_t.
More details in the first comment.
Testing: mach5 tier1-6
GHA testing in-progress
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25791/head:pull/25791
$ git checkout pull/25791
Update a local copy of the PR:
$ git checkout pull/25791
$ git pull https://git.openjdk.org/jdk.git pull/25791/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25791
View PR using the GUI difftool:
$ git pr show -t 25791
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25791.diff
Using Webrev
Link to Webrev Comment