8341755: Optimize argNames in InnerClassLambdaMetafactory#21399
8341755: Optimize argNames in InnerClassLambdaMetafactory#21399wenshao wants to merge 10 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back swen! A progress list of the required criteria for merging this PR into |
|
public static String argName(int i) {
if (i < 8)
return ARG_NAME_CACHE[i];
return "arg$" + (i + 1);
} |
|
@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 3 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 ➡️ To integrate this PR with the above commit message to the |
|
/contributor add liach |
|
@wenshao |
|
Can we change the name to "Optimize argNames in InnerClassLambdaMetafactory"? |
Webrevs
|
src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
Outdated
Show resolved
Hide resolved
…etafactory.java Co-authored-by: Claes Redestad <claes.redestad@oracle.com>
liach
left a comment
There was a problem hiding this comment.
Trivial merge.
/reviewers 1 reviewer
| } | ||
|
|
||
| private static String argName(int i) { | ||
| String argName = i < ARG_NAME_CACHE_SIZE ? ARG_NAME_CACHE[i] : null; |
There was a problem hiding this comment.
Just an idea, but perhaps could constant init ARG_NAME_CACHE = { "arg$0", "arg$1", .. , "arg$7" }; and simplify this?
liach
left a comment
There was a problem hiding this comment.
Back to precomputed constants :)
Manual shift computation! The code is also simplified based on precomputed constants. |
|
/integrate |
|
Going to push as commit c850ecb.
Your commit was automatically rebased without conflicts. |
A simple optimization that eliminates the allocation of the MethodTypeDescImpl object when parameterCount is equal to 0 and eliminates the allocation of argNames when parameterCount is equal to 1
Progress
Issue
Reviewers
Contributors
<liach@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21399/head:pull/21399$ git checkout pull/21399Update a local copy of the PR:
$ git checkout pull/21399$ git pull https://git.openjdk.org/jdk.git pull/21399/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21399View PR using the GUI difftool:
$ git pr show -t 21399Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21399.diff
Webrev
Link to Webrev Comment