Skip to content
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

Closed

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Nov 17, 2021

Hi all,

can I have reviews for this renaming change that tries to change naming for some remembered set closures to include Closure instead of Iterator in their names. Additionally I removed two or so G1 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

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8276093: Improve naming in closures to iterate over card sets

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 17, 2021

👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Nov 17, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 17, 2021

@tschatzl The following label will be automatically applied to this pull request:

  • hotspot-gc

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.

@openjdk openjdk bot added the hotspot-gc label Nov 17, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 17, 2021

Webrevs

Copy link
Contributor

@kstefanj kstefanj left a comment

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) {
Copy link
Contributor

@kstefanj kstefanj Nov 17, 2021

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) { }
Copy link
Contributor

@kstefanj kstefanj Nov 17, 2021

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,
Copy link
Contributor

@kstefanj kstefanj Nov 17, 2021

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) {
Copy link
Contributor

@kstefanj kstefanj Nov 17, 2021

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);
Copy link
Contributor

@kstefanj kstefanj Nov 17, 2021

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);
Copy link
Contributor

@kstefanj kstefanj Nov 17, 2021

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,
Copy link
Contributor

@kstefanj kstefanj Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(_)iter -> (_)closure

@openjdk
Copy link

@openjdk openjdk bot commented Nov 17, 2021

@tschatzl 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:

8276093: Improve naming in closures to iterate over card sets

Reviewed-by: sjohanss, ayang

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 master branch:

  • a44b45f: 4337793: Mark non-serializable fields of java.security.cert.Certificate and CertPath
  • b3a62b4: 8276795: Deprecate seldom used CDS flags
  • 38345bd: 8277137: Set OnSpinWaitInst/OnSpinWaitInstCount defaults to "isb"/1 for Arm Neoverse N1
  • 2c06bca: 8266368: Inaccurate after_unwind hook in C2 exception handler
  • 77cc508: 8277215: Remove redundancy in ReferenceProcessor constructor args
  • 0a65e8b: 8276794: Change nested classes in java.desktop to static nested classes
  • db55f92: 8277343: dynamicArchive/SharedArchiveFileOption.java failed: '-XX:+RecordDynamicDumpInfo is unsupported when a dynamic CDS archive is specified in -XX:SharedArchiveFile:' missing
  • 2f4b540: 8276314: [JVMCI] check alignment of call displacement during code installation
  • 9160743: 8276058: Some swing test fails on specific CI macos system
  • 8193800: 8274179: AArch64: Support SVE operations with encodable immediates
  • ... and 15 more: https://git.openjdk.java.net/jdk/compare/e9934e1243929514e147ecdd3cefa74168ed0500...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Nov 17, 2021
@tschatzl
Copy link
Contributor Author

@tschatzl tschatzl commented Nov 18, 2021

Thanks @albertnetymk @kstefanj for your reviews
/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Nov 18, 2021

Going to push as commit ce0f00f.
Since your change was applied there have been 30 commits pushed to the master branch:

  • 5d249c4: 8275071: [macos] A11y cursor gets stuck when combobox is closed
  • 354a34e: 8277336: Improve CollectedHeap::safepoint_workers comments
  • 276bfcd: 8277407: javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java fails to compile after JDK-8276058
  • d93b238: 8277180: Intrinsify recursive ObjectMonitor locking for C2 x64 and A64
  • 00c388b: 8259643: ZGC can return metaspace OOM prematurely
  • a44b45f: 4337793: Mark non-serializable fields of java.security.cert.Certificate and CertPath
  • b3a62b4: 8276795: Deprecate seldom used CDS flags
  • 38345bd: 8277137: Set OnSpinWaitInst/OnSpinWaitInstCount defaults to "isb"/1 for Arm Neoverse N1
  • 2c06bca: 8266368: Inaccurate after_unwind hook in C2 exception handler
  • 77cc508: 8277215: Remove redundancy in ReferenceProcessor constructor args
  • ... and 20 more: https://git.openjdk.java.net/jdk/compare/e9934e1243929514e147ecdd3cefa74168ed0500...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 18, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Nov 18, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 18, 2021

@tschatzl Pushed as commit ce0f00f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@tschatzl tschatzl deleted the submit/8276093-improve-closure-naming branch Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc integrated
3 participants