-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8332176: Refactor ClassListParser::parse() #19225
8332176: Refactor ClassListParser::parse() #19225
Conversation
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
@iklam 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
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.
Thanks for the refactor, this is a bit easier to read now! I have a couple of considerations below:
} | ||
|
||
void ClassListParser::split_tokens_by_whitespace(int offset) { | ||
void ClassListParser::split_tokens_by_whitespace(int offset, GrowableArray<const char*>* items) { |
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.
Unless I'm mistaken, split_tokens_by_whitespace
is only called once byparse_at_tags
. Do you anticipate that this will be called with multiple "item" lists in the future? If not I think you can leave _indy_items
in this method as before.
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.
I changed this function as its name is confusing. If we want to keep the existing code that operates on _indy_items
, we have to rename it accordingly, as split_tokens_by_whitespace
doesn't mention anything about _indy_items
. But that seems to be going the wrong direction, making it more difficult to reuse this function in the future, if such need arises.
I think it's a good idea to reduce coupling in the code. This function splits a line into multiple parts, so we shouldn't make it depend on _indy_items
.
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 overall. Found an outdated comment.
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.
Updates look good, thanks!
…refactor-class-list-parser-parse
Thanks @calvinccheung and @matias9927 for the review |
Going to push as commit b687aa5. |
The handling of
@
tags inClassListParser::parse()
is quite convoluted. As we expect to add more@
tags in Project Leyden, we should refactor this code to make it more maintainable.It's easier to review the changes by ignoring the whitespace changes.
parse_at_tags()
andparse_class_name_and_attributes()
ClassListParser::parse()
to no longer return the number of classes loaded -- some@
tags can cause many classes to be loaded as a side effect (e.g.,@lambda-form-invoker
), so the number returned byClassListParser::parse()
is not accurate. There are other CDS logs that print out the exact number of classes stored in the archive.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19225/head:pull/19225
$ git checkout pull/19225
Update a local copy of the PR:
$ git checkout pull/19225
$ git pull https://git.openjdk.org/jdk.git pull/19225/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19225
View PR using the GUI difftool:
$ git pr show -t 19225
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19225.diff
Webrev
Link to Webrev Comment