RFR: 8283574: Use Klass::_id for type checks in the C++ code

Stefan Karlsson stefank at openjdk.java.net
Thu Mar 24 06:22:45 UTC 2022


On Thu, 24 Mar 2022 05:56:18 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> src/hotspot/share/oops/instanceKlass.hpp line 139:
>> 
>>> 137: 
>>> 138:  protected:
>>> 139:   InstanceKlass(const ClassFileParser& parser, KlassID id = ID);
>> 
>> I think I would prefer that KlassID was required.  I don't know how much fanout that might have though.  That preference is despite making construction of a concrete InstanceKlass different from the others.  That's an artifact of InstanceKlass being overloaded as both a base class and a leaf class, a pattern that seems to often lead to trouble.
>
> I'll take a look at this when converting KlassID to KlassKind.

I took a look. Making that changes makes allocate_instance_klass look worse.

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

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


More information about the hotspot-dev mailing list