RFR: 8272107: Removal of Unsafe::defineAnonymousClass left a dangling C++ class

Coleen Phillimore coleenp at openjdk.java.net
Tue Aug 10 16:40:49 UTC 2021


On Tue, 10 Aug 2021 14:06:04 GMT, Harold Seigel <hseigel at openjdk.org> wrote:

> Please review this change to remove the now unused CPSlot class.  Uses of CPSlot have been replaced with Symbol*.  The change was tested by running JCK lang and VM tests, Mach5 tiers 1-2 on Linux, Mac OS, and WIndows and Macn5 tiers 3-5 on Linux x64.
> 
> Thanks, Harold

Might be able to make even more changes to this.

src/hotspot/share/oops/constantPool.inline.hpp line 39:

> 37:   intptr_t adr = Atomic::load_acquire(obj_at_addr(which));
> 38:   assert(adr != 0 || which == 0, "cp entry for klass should not be zero");
> 39:   return (Symbol*)adr;

I think you can get rid of all slot_at* and replace them with symbol_at().  Since the symbols don't change after the constant pool is initialized, all this volatile isn't needed.  Used to be used to replace Symbol* with Klass* also.  @iklam can confirm.

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

Changes requested by coleenp (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5070


More information about the hotspot-dev mailing list