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

Harold Seigel hseigel at openjdk.java.net
Wed Aug 11 19:29:44 UTC 2021


On Wed, 11 Aug 2021 18:15:03 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove slot_at()
>
> 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.

I like the idea of doing this as 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?

done.

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

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


More information about the hotspot-dev mailing list