-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8336267: Method and Constructor signature parsing can be shared on the root object #20179
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 liach! A progress list of the required criteria for merging this PR into |
@liach 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 50 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@liach This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Keep alive. |
There are a lot of transient volatile fields in this code. Could anything be done to make the various |
Yep, there's #19281 exactly for that purpose: https://github.com/openjdk/jdk/pull/19281/files#diff-5106bd8a6cf3197be7eaee467983c8992981a615bedb66efa50dd97c60cb0041 Uses |
…member-sig-share
@liach This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@liach This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
/open |
@liach This pull request is now open |
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.
It's okay to extend the root object to share genericInfo
besides the accessor. But we need to update the comment to make that clear.
@Stable
private ConstructorAccessor constructorAccessor;
// For sharing of ConstructorAccessors. This branching structure
// is currently only two levels deep (i.e., one root Constructor
// and potentially many Constructor objects pointing to it.)
//
// If this branching structure would ever contain cycles, deadlocks can
// occur in annotation code.
private Constructor<T> root;
The comment for root
should be extended to cover the generics repository. In addition, I suggest to move the declaration of instance variable genericInfo
closer to the accessor and root
.
genericInfo = | ||
ConstructorRepository.make(getSignature(), | ||
getFactory()); |
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.
genericInfo = | |
ConstructorRepository.make(getSignature(), | |
getFactory()); | |
genericInfo = ConstructorRepository.make(getSignature(), getFactory()); |
Nit: This fits well in one line.
genericInfo = FieldRepository.make(getGenericSignature(), | ||
getFactory()); |
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.
genericInfo = FieldRepository.make(getGenericSignature(), | |
getFactory()); | |
genericInfo = FieldRepository.make(getGenericSignature(), getFactory()); |
genericInfo = MethodRepository.make(getGenericSignature(), | ||
getFactory()); |
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.
genericInfo = MethodRepository.make(getGenericSignature(), | |
getFactory()); | |
genericInfo = MethodRepository.make(getGenericSignature(), getFactory()); |
Thanks; I have simplified the existing comments and grouped the lazy shareable fields together. |
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.
Looks good.
Co-authored-by: Mandy Chung <mandy.chung@oracle.com>
Applied this minor patch. java/lang/reflect tests are still all fine. |
/integrate |
Going to push as commit 8d6cfba.
Your commit was automatically rebased without conflicts. |
A straightforward optimization, to share the signature parsing of method, constructor, and field between the root and the copied objects, like how method handle accessors are shared.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20179/head:pull/20179
$ git checkout pull/20179
Update a local copy of the PR:
$ git checkout pull/20179
$ git pull https://git.openjdk.org/jdk.git pull/20179/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20179
View PR using the GUI difftool:
$ git pr show -t 20179
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20179.diff
Using Webrev
Link to Webrev Comment