RFR: 8285364: Remove REF_ enum for java.lang.ref.Reference [v3]
Albert Mingkun Yang
ayang at openjdk.java.net
Wed Apr 27 14:31:59 UTC 2022
On Wed, 27 Apr 2022 12:35:56 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> 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.
Instead of documenting this surprise, how about removing it by extending this method to cover all subtypes of `j.l.r.Reference`?
bool ClassFileParser::is_java_lang_ref_Reference_or_subclass() const {
if (_super_klass == NULL) {
return false;
}
if (_class_name == vmSymbols::java_lang_ref_Reference()) {
return true;
}
if (_super_klass->name() == vmSymbols::java_lang_ref_Reference()) {
return true;
}
return _super_klass->reference_type() != REF_NONE;
}
-------------
PR: https://git.openjdk.java.net/jdk/pull/8332
More information about the hotspot-dev
mailing list