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
8262328: Templatize JVMFlag boilerplate access methods #3318
8262328: Templatize JVMFlag boilerplate access methods #3318
Conversation
|
Webrevs
|
I need to work on this PR some more. Closing it for now. |
…ypes (i.e., cannot mix size_t and uintx even they might be the same type of some platforms)
I've updated the patch and the JVMFlagAccess API should have identical behavior as before. Now it's ready to be reviewed again. |
Hi Ioi,
In terms of readability and writeability I prefer <type>AtPut() over set<JVM_FLAG_TYPE(type)>(). Is there any way to push the JVM_FLAG_TYPE down a level so it doesn't shout at you when reading the code? set<type>() would look much much better.
Thanks,
David
I added the Now I use the more low-level A related note: in an earlier version, I tried to get rid of the
However, this may allow type mismatch like the following, on platforms that use the exact same type for
but you will get a runtime failure on platforms where |
Hi Ioi,
This latest version looks good to me.
Thanks,
David
@iklam This change now passes all automated pre-integration checks. 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 no new commits pushed to the
|
I'm taking a look at your fix Ioi. Building it locally, wanted to check out a few things... |
Very nice! With all this reduction and "templatization" effort, soon we will be left with one line of a template code at this rate :-)
The only feedback I have is that I wish we could replace int type_enum
with FlagType type_enum
Hi Gerard, thanks for the review. Replacing the int with enum will cause quite a bit of changes, so I would probably do that in a separate RFE. |
Thanks @dholmes-ora and @gerard-ziemski for the review! |
We have a bunch of boilerplate method like:
Similarly, we also have 8 different functions: JVMFlag::{set_bool, set_int, set_intx, ...}
We should replace such patterns with
This would allow us to templatize the 8x boilerplate functions in writeableFlags.cpp.
The flag access code in whitebox.cpp can also be improved.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3318/head:pull/3318
$ git checkout pull/3318
Update a local copy of the PR:
$ git checkout pull/3318
$ git pull https://git.openjdk.java.net/jdk pull/3318/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3318
View PR using the GUI difftool:
$ git pr show -t 3318
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3318.diff