RFR: 8324242: Avoid null check for OopHandle::ptr_raw()

Kim Barrett kbarrett at openjdk.org
Tue Jan 23 11:32:26 UTC 2024


On Tue, 23 Jan 2024 11:22:12 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> > 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()));
> > ```
> 
> I think you are probably correct, but felt that was a little out of scope for what I was doing in this PR.
> 
> It looks like it was changed from printing the (void* cast) loader oop to printing the (newly introduced) handle address by 8201556: "Disallow reading oops in ClassLoaderData if unloading". I don't know whether that was intentional, but guessing not.

https://bugs.openjdk.org/browse/JDK-8324514
ClassLoaderData::print_on should print address of class loader

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

PR Comment: https://git.openjdk.org/jdk/pull/17510#issuecomment-1905845825


More information about the hotspot-dev mailing list