RFR: 8337939: ZGC: Make assertions and checks less convoluted and explicit [v2]
Joel Sikström
duke at openjdk.org
Wed Aug 7 20:10:03 UTC 2024
> 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
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/20478/files
- new: https://git.openjdk.org/jdk/pull/20478/files/70f13835..42044a86
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=20478&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=20478&range=00-01
Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/20478.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/20478/head:pull/20478
PR: https://git.openjdk.org/jdk/pull/20478
More information about the hotspot-gc-dev
mailing list