RFR: 8317534: GenShen: Remove unused code
Y. Srinivas Ramakrishna
ysr at openjdk.org
Thu Oct 5 19:01:41 UTC 2023
On Thu, 5 Oct 2023 17:08:52 GMT, William Kemper <wkemper at openjdk.org> wrote:
> Remove unused code, fix typos, remove empty statements
LGTM; thanks for the clean-up.
A few somewhat minor comments.
src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.hpp line 113:
> 111: // This uses the data in the ShenandoahAgeCensus object's _global_age_table and the
> 112: // current _epoch to compute a new tenuring threshold, which will be remembered
> 113: // until the next invocation of compute_tenuring_threshold.
Could you please move this documentation to `compute_tenuring_threshold()` further below. Thanks!
src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 139:
> 137:
> 138: void set_soft_max_capacity(size_t soft_max_capacity) {
> 139: _soft_max_capacity = soft_max_capacity;
Not only the accessor, but it seems like the `_soft_max_capacity` field in `ShenandoahGeneration` is vestigial and can be deleted?
A cursory look seemed to indicate that a field with a similar name (similar accessor, but confusingly different field name) is used for the purpose for that purpose for the whole heap, and the generation's field is obsolete/vestigial. I may have missed some uses in my inspection, but you can check if deleting the field is ok (it's only used in logging where it seems not to have much value?).
src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 1960:
> 1958: }
> 1959: }
> 1960:
Nice!
src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 859:
> 857: void clear_cards_for(ShenandoahHeapRegion* region);
> 858: void dirty_cards(HeapWord* start, HeapWord* end);
> 859: void clear_cards(HeapWord* start, HeapWord* end);
These aren't used, but in looking through the code for marking and clearing cards in `ShenandoahDirectCardMarkRememberedSet::mark_range_as_...` I realize we might want to see if we want to use vector instructions or use `memset`, when the range is sufficiently large (future work).
src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.inline.hpp line 1026:
> 1024: }
> 1025: }
> 1026:
Very curious. I could have sworn I had used this in some assertions/verification code in card scanning or card verification, but may be that code went away. Does seem to be unused now, so best to get rid of it.
-------------
Marked as reviewed by ysr (Committer).
PR Review: https://git.openjdk.org/shenandoah/pull/335#pullrequestreview-1660471452
PR Review Comment: https://git.openjdk.org/shenandoah/pull/335#discussion_r1347821180
PR Review Comment: https://git.openjdk.org/shenandoah/pull/335#discussion_r1347834125
PR Review Comment: https://git.openjdk.org/shenandoah/pull/335#discussion_r1347837192
PR Review Comment: https://git.openjdk.org/shenandoah/pull/335#discussion_r1347849963
PR Review Comment: https://git.openjdk.org/shenandoah/pull/335#discussion_r1347843253
More information about the shenandoah-dev
mailing list