RFR: 8325808: GenShen: Move generational mode code out of shFullGC.cpp [v2]
William Kemper
wkemper at openjdk.org
Tue Feb 27 17:25:03 UTC 2024
On Tue, 27 Feb 2024 01:37:00 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:
>> Hmm, I agree from a design perspective. However, we have two versions of the closure. For them to share the implementation of `prepare_for_compaction` as you suggest, I believe we'd need to introduce a common base class (or parent one closure to another) and make some of these methods virtual. Or were you thinking of making `prepare_for_compaction` a static member of a common base class and keeping the same signature. Or, just duplicating the implementation of `prepare_for_compaction` in each closure? Not sure if any of those are simpler than what we have here.
>
> Yes, I think you are right. When I was writing that comment, I was thinking that the loop could just be duplicated into each of the two closures. I guess may be that doesn't particularly make it any simpler and moreover leads to some avoidable duplication. I'll leave it up to you as to which makes more sense to you.
>
> Reviewed and approved!
I'll leave it for now. This form also reduces some of the delta with upstream (that is, with fewer changes upstream).
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/398#discussion_r1504670723
More information about the shenandoah-dev
mailing list