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
8276093: Improve naming in closures to iterate over card sets #6430
8276093: Improve naming in closures to iterate over card sets #6430
Conversation
|
Webrevs
|
Looks good, some additional iter -> closure renames suggested below.
@@ -821,21 +821,22 @@ void G1CardSet::iterate_cards_during_transfer(CardSetPtr const card_set, CardVis | |||
} | |||
} | |||
|
|||
void G1CardSet::iterate_containers(G1CardSetPtrIterator* found, bool at_safepoint) { | |||
void G1CardSet::iterate_containers(CardSetPtrClosure* found, bool at_safepoint) { |
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.
Please change found
to closure or cl as well.
Closure& _iter; | ||
uint _region_idx; | ||
|
||
public: | ||
G1ContainerCards(Closure& iter, uint region_idx) : _iter(iter), _region_idx(region_idx) { } | ||
G1ContainerCardsClosure(Closure& iter, uint region_idx) : _iter(iter), _region_idx(region_idx) { } |
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.
Maybe change _iter
and iter
to _closure
and closure
?
G1CardSet* _card_set; | ||
Closure& _iter; | ||
|
||
public: | ||
|
||
G1CardSetIterateCardsIterator(G1CardSet* card_set, | ||
Closure& iter) : | ||
G1CardSetContainersClosure(G1CardSet* card_set, |
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.
Same as above.
@@ -868,8 +869,8 @@ class G1CardSetIterateCardsIterator : public G1CardSet::G1CardSetPtrIterator { | |||
} | |||
}; | |||
|
|||
void G1CardSet::iterate_cards(G1CardSetCardIterator& iter) { | |||
G1CardSetIterateCardsIterator<G1CardSetCardIterator, G1ContainerCards> cl(this, iter); | |||
void G1CardSet::iterate_cards(CardClosure& iter) { |
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.
iter -> closure
public: | ||
virtual void do_cardsetptr(uint region_idx, size_t num_occupied, CardSetPtr card_set) = 0; | ||
}; | ||
|
||
void iterate_containers(G1CardSetPtrIterator* iter, bool safepoint = false); | ||
void iterate_containers(CardSetPtrClosure* iter, bool safepoint = false); |
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.
iter -> closure
public: | ||
virtual void do_card(uint region_idx, uint card_idx) = 0; | ||
}; | ||
|
||
void iterate_cards(G1CardSetCardIterator& iter); | ||
void iterate_cards(CardClosure& iter); |
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.
iter -> closure
@@ -87,7 +87,7 @@ class G1HeapRegionRemSetMergeCardIterator : public G1CardSet::G1CardSetPtrIterat | |||
|
|||
public: | |||
|
|||
G1HeapRegionRemSetMergeCardIterator(G1CardSet* card_set, | |||
G1HeapRegionRemSetMergeCardClosure(G1CardSet* card_set, |
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.
(_)iter
-> (_)closure
@tschatzl This change now passes all automated pre-integration checks. 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 25 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.
|
Thanks @albertnetymk @kstefanj for your reviews |
Going to push as commit ce0f00f.
Your commit was automatically rebased without conflicts. |
Hi all,
can I have reviews for this renaming change that tries to change naming for some remembered set closures to include
Closure
instead ofIterator
in their names. Additionally I removed two or soG1
prefixes for nested classes. Hopefully this improves the situation a bit, although it's still a mess of nested closures.Testing: local compilation, gha
Thanks,
Thomas
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6430/head:pull/6430
$ git checkout pull/6430
Update a local copy of the PR:
$ git checkout pull/6430
$ git pull https://git.openjdk.java.net/jdk pull/6430/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6430
View PR using the GUI difftool:
$ git pr show -t 6430
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6430.diff