Integrated: 8337939: ZGC: Make assertions and checks less convoluted and explicit
Joel Sikström
duke at openjdk.org
Fri Aug 9 07:32:41 UTC 2024
On Tue, 6 Aug 2024 15:15:57 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.
This pull request has now been integrated.
Changeset: f74109bd
Author: Joel Sikström <joel.sikstrom at oracle.com>
URL: https://git.openjdk.org/jdk/commit/f74109bd178c92a9dff1ca6fce03b25f51a0384f
Stats: 63 lines in 10 files changed: 32 ins; 8 del; 23 mod
8337939: ZGC: Make assertions and checks less convoluted and explicit
Reviewed-by: stefank, ayang, eosterlund
-------------
PR: https://git.openjdk.org/jdk/pull/20478
More information about the hotspot-gc-dev
mailing list