8381643: Shenandoah: Remove duplicate region filtering logic#30571
8381643: Shenandoah: Remove duplicate region filtering logic#30571earthling-amzn wants to merge 4 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back wkemper! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
| } | ||
|
|
||
| void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectionSet* collection_set) { | ||
| void ShenandoahGenerationalHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* collection_set, |
There was a problem hiding this comment.
This is method by which all subclasses of ShenandoahHeuristics are meant to refine the collection set candidates (RegionData*).
|
@earthling-amzn The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
| heap->shenandoah_policy()->record_mixed_cycle(); | ||
| } | ||
|
|
||
| if (!collection_set->is_empty() && _generation->is_global()) { |
|
|
||
| protected: | ||
| // Subclasses override this to perform generation-specific region selection. | ||
| virtual void select_collection_set_regions(ShenandoahCollectionSet* set, |
There was a problem hiding this comment.
This method is an override specifically for the young/global heuristics.
| region->make_trash_immediate(); | ||
| } else { | ||
| // This is our candidate for later consideration. | ||
| assert(region->get_top_before_promote() == nullptr, |
There was a problem hiding this comment.
This is harmless in non-generational modes. They'll never promote in place so top_before_promote will always be nullptr.
| for (size_t i = 0; i < num_regions; i++) { | ||
| ShenandoahHeapRegion* region = heap->get_region(i); | ||
|
|
||
| if (!_space_info->contains(region)) { |
There was a problem hiding this comment.
contains is implemented to return true unconditionally for global/non-generational collections.
|
|
||
| collection_set->clear(); | ||
| ShenandoahHeapLocker locker(heap->lock()); | ||
| heap->assert_pinned_region_status(this); |
There was a problem hiding this comment.
Pulled this up so that heuristics can keep using the ShSpaceInfo abstraction. Even though it is only implemented by ShGeneration, removing it would clutter this PR (and is also not entirely straight forward because of include dependencies).
After recent refactoring, the difference between
ShenandoahGenerationalHeuristics::choose_collection_setandShenandoahHeuristics::choose_collection_sethas shrunk to the point where the code duplication doesn't make sense anymore. There is an additional change here that splits a generational mode specific 'EvacuationInfoEvent' (JFR) into two events:Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30571/head:pull/30571$ git checkout pull/30571Update a local copy of the PR:
$ git checkout pull/30571$ git pull https://git.openjdk.org/jdk.git pull/30571/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30571View PR using the GUI difftool:
$ git pr show -t 30571Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30571.diff
Using Webrev
Link to Webrev Comment