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

Ioi Lam iklam at openjdk.java.net
Wed Aug 11 18:24:27 UTC 2021


On Wed, 11 Aug 2021 16:44:48 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
>
> Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove slot_at()

LGTM.

src/hotspot/share/memory/metaspaceClosure.hpp line 132:

> 130:     address obj() const {
> 131:       // In some rare cases we store some flags in the lowest 2 bits of a
> 132:       // MetaspaceObj pointer. Unmask these when manipulating the pointer.

I think `FLAG_MASK` and `flag_bits()` can be removed completely. It was used only for handling the CPSlot during CDS dump. I added the following and all CDS tests passed.


       uintx p = (uintx)*mpp();
+      assert((p & FLAG_MASK) == 0, "must be");
       return (address)(p & (~FLAG_MASK));


If you want, I can do the removal in a separate PR.

src/hotspot/share/oops/constantPool.hpp line 324:

> 322:   void unresolved_string_at_put(int which, Symbol* s) {
> 323:     assert(s->refcount() != 0, "should have nonzero refcount");
> 324:     tag_at_put(which, JVM_CONSTANT_String);

Maybe a comment here that release_tag_at_put is not needed here because this happens only when constructing a ConstantPool in a single thread, with no possibility of concurrent access?

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

Marked as reviewed by iklam (Reviewer).

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


More information about the hotspot-dev mailing list