RFR: 8337939: ZGC: Make assertions and checks less convoluted and explicit [v2]

Stefan Karlsson stefank at openjdk.org
Thu Aug 8 07:17:32 UTC 2024


On Wed, 7 Aug 2024 20:10:03 GMT, Joel Sikström <duke at openjdk.org> wrote:

>> There are currently cases where calls to type converters are made only to assert whether the conversion is reasonable or not and then discarding the result. For example, to_zaddress(...) is used to check if the pointer passed to it is a valid zaddress or not, whilst discarding the result of the conversion.
>> 
>> Additionally, a call like oopDesc::is_oop(to_oop(o)) is convoluted since a similar check to is_oop() is already done inside to_oop(), which should be a separate operation in its entirety.
>> 
>> Asserts/checks in affected places should be separated so that assertion/checking can be explicitly made and not done more than necessary.
>> 
>> Tested with tiers 1-7 on linux64 and linux64-debug.
>
> Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix zaddress parameter name

Looks good.

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

Marked as reviewed by stefank (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20478#pullrequestreview-2227047222


More information about the hotspot-gc-dev mailing list