-
Notifications
You must be signed in to change notification settings - Fork 6.3k
8338936: StringConcatFactory optimize the construction of MethodType and MethodTypeDesc #20704
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
8338936: StringConcatFactory optimize the construction of MethodType and MethodTypeDesc #20704
Conversation
👋 Welcome back wenshao! A progress list of the required criteria for merging this PR into |
@wenshao 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 7 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the 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 (@cl4es, @liach) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
* Construct the MethodType of the coder method, if there are no parameters it may be UTF16, return null. | ||
* The first parameter is the initialized coder, Only parameter types that can be UTF16 are added. |
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.
* Construct the MethodType of the coder method, if there are no parameters it may be UTF16, return null. | |
* The first parameter is the initialized coder, Only parameter types that can be UTF16 are added. | |
* Construct the MethodType of the coder method. The first parameter is the initialized coder. | |
* Only parameter types which can be UTF16 are added. Returns null if no such parameter exists. |
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.
Something to consider (for a follow up) is to not add the initial coder as an argument but test that in the outer method: No point calling the coder
method if we already know that we're UTF-16.
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.
If initCoder is UTF16, the coder method does not need to be generated. This is an optimization and may be a separate PR. Of course, if you agree, I can also put it here.
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.
Right, if initCoder
is always UTF16 (-XX:-CompactStrings
) then we never need the coder
method. Nor really if any of the constants have UTF-16 chars, but in those cases it might be more appropriate to inject the derived value and have a runtime test - as long as it get optimized away. Otherwise we might need to generate two different classes per shape.
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.
If we're to pre-generate code for concats when linking JDK images (something that might be a big help for startup) then it'd be nice to be agnostic regarding CompactStrings
…ry.java Co-authored-by: Claes Redestad <claes.redestad@oracle.com>
Webrevs
|
@wenshao Can you change all |
CONSTRUCTOR_METHOD_TYPE The current strategy is optimization: MethodType CONSTRUCTOR_METHOD_TYPE = MethodType.methodType(void.class, String[].class);
-> static MethodType methodType(Class<?> rtype, Class<?> ptype0) {
-> makeImpl(rtype, new Class<?>[]{ ptype0 }, true); |
/integrate |
/sponsor Thanks! |
Going to push as commit 5ecbecf.
Your commit was automatically rebased without conflicts. |
optimize the construction of MethodType and MethodTypeDesc to reduce memory allocate
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20704/head:pull/20704
$ git checkout pull/20704
Update a local copy of the PR:
$ git checkout pull/20704
$ git pull https://git.openjdk.org/jdk.git pull/20704/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20704
View PR using the GUI difftool:
$ git pr show -t 20704
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20704.diff
Webrev
Link to Webrev Comment