RFR: JDK-8260200 G1: Remove unnecessary update in FreeRegionList::remove_starting_at [v2]
Hamlin Li
mli at openjdk.java.net
Tue Jan 26 01:42:42 UTC 2021
On Mon, 25 Jan 2021 08:58:00 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:
>> Thanks for reviewing.
>> I just realized I made the change in another way from what you suggested exactly, seems it has same effect. Not sue if my current change with "if ASSERT" is OK, please kindly let me know if you don't think so.
>
> You are correct that when executing it will have the same effect, but I'm more concerned about the readability of the code in this case. So please move it to a separate function, something like `verify_region_to_remove()`. Looking a bit closer at the code I think this function should be able to be called from each round of the loop as well, I mean that's what was done before and by doing so we could get the loop a bit cleaner as well. Or have I missed anything? In that case you would not need to call it before the loop, but just inside it.
Thank you for reviewing and clarification. Got your point, I have changed as you suggested, would you mind to have another look at it?
-------------
PR: https://git.openjdk.java.net/jdk/pull/2181
More information about the hotspot-gc-dev
mailing list