RFR: 8324242: Avoid null check for OopHandle::ptr_raw()
Aleksey Shipilev
shade at openjdk.org
Mon Jan 22 10:48:27 UTC 2024
On Sun, 21 Jan 2024 07:29:45 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> Please review this change to use OopHandle::is_empty() rather than comparing
> the result of OopHandle::ptr_raw() with nullptr. While equivalent, the former
> is the intended API for such checks. ptr_raw should only be used directly
> where it is actually needed.
>
> Testing: mach5 tier1.
Looks reasonable.
I guess the use in `ClassLoaderData::remove_handle` is fine, because we want to assert it?
Related, pre-existing: the use in `ClassLoaderData::print_on` is also odd. This reports the address of oophandle slot, not the classloader oop itself? Should probably be `.peek()`?
out->print_cr(" - class loader " INTPTR_FORMAT, p2i(_class_loader.ptr_raw()));
-------------
Marked as reviewed by shade (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/17510#pullrequestreview-1836174566
More information about the hotspot-dev
mailing list