RFR: 8285364: Remove REF_ enum for java.lang.ref.Reference [v3]

Coleen Phillimore coleenp at openjdk.java.net
Wed Apr 27 12:39:43 UTC 2022


On Mon, 25 Apr 2022 19:36:49 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> src/hotspot/share/oops/instanceKlass.cpp line 441:
>> 
>>> 439: 
>>> 440:   // Allocation
>>> 441:   if (parser.is_java_lang_ref_Reference_subclass()) {
>> 
>> I'm having a really hard time understanding this.  java.lang.Reference now doesn't have any REF_OTHER type set.  I didn't realize that a java.lang.Reference instance is a plain InstanceKlass, and not an InstanceRefKlass.  Is this right?
>
> Yes, I was also surprised by this. The java.lang.ref.Reference Klass is only an InstanceKlass, not an InstanceRefKlass.

Yeah, please add a short comment in the is_java_lang_ref_Reference_subclass function that this is the case, now that we've learned this.

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

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


More information about the serviceability-dev mailing list