RFR: 8293210: G1: Remove redundant check in G1FreeHumongousRegionClosure

Albert Mingkun Yang ayang at openjdk.org
Fri Sep 9 09:55:45 UTC 2022


On Fri, 9 Sep 2022 09:39:25 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Simple change of removing unnecessary code.
>> 
>> Test: hotspot_gc
>
> src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp line 236:
> 
>> 234: 
>> 235: inline bool G1CollectedHeap::is_humongous_reclaim_candidate(uint region) {
>> 236:   assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object");
> 
> I think I like the semantic requirement that this only be applied to starts-humongous regions.  Unless there is some future change that needs this removal (and not just because of the change to G1FreeHumongousRegionClosure::do_heap_region that I don't like), then I'd prefer it stay.

There are no other uses in the near future. However, this method doesn't really require that as a pre-condition, even before this PR.

-------------

PR: https://git.openjdk.org/jdk/pull/10119



More information about the hotspot-gc-dev mailing list