-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8294698: Remove unused 'checkedExceptions' param from MethodAccessorGenerator.generateMethod() #10526
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
…enerator.generateMethod()
👋 Welcome back stsypanov! A progress list of the required criteria for merging this PR into |
@stsypanov The following label 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 list. If you would like to change these labels, use the /label pull request command. |
Seems reasonable, although these generators should only rarely be used when doing reflection. I'm curious if you have some test or micro where the improvement shows? |
@cl4es this code is frequently invoked in Spring-based applications at start-up time. I couldn't design the benchmark for this particular case, assuming that in majority of cases @State(Scope.Thread)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@BenchmarkMode(value = Mode.AverageTime)
public class ArrayCloneBenchmark {
private final Object[] array = new Object[0];
@Benchmark
public Object[] cloneArray() {
return array.clone();
}
}
|
I agree that getting rid of the clone can help -- but since JEP 416 the generators modified here is mostly a fallback and the bulk of the use will use |
Approving since changes are trivial and having less code never hurts |
|
@stsypanov 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 8 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) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@stsypanov |
/sponsor |
Going to push as commit 46633e6.
Your commit was automatically rebased without conflicts. |
@cl4es @stsypanov Pushed as commit 46633e6. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
@stsypanov like @cl4es said, I expect these dynamically generated methods should only be generated during very early VM startup. Once the module system is initialized, it will use method handles. How do you run the spring-based applications when you observe these methods being called? While this change is trivial and no harm to include this change, this code is planned to be removed in a future release. |
@mlchung I can put here a stack trace of the application invoking the code if you are interested |
@stsypanov would be helpful to understand when this code still gets executed. Also note that JEP 416 was integrated in JDK 18 so some details about the runtime would be necessary to get a complete picture. |
@cl4es @mlchung here's the stacktrace of my app running on Java 19:
|
Thanks. This is for serialization and not the use of the core reflection which is what JEP 416 covered. |
Is it going to be covered with new reflection sometimes? You mentioned above that "this code is planned to be removed in a future release" so some substitution must be provided, right? |
checkedExceptions
param ofMethodAccessorGenerator.generateMethod()
is unused and should be removed in order to prevent allocations fromMethod.getExceptionTypes()
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10526/head:pull/10526
$ git checkout pull/10526
Update a local copy of the PR:
$ git checkout pull/10526
$ git pull https://git.openjdk.org/jdk pull/10526/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10526
View PR using the GUI difftool:
$ git pr show -t 10526
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10526.diff