RFR: 8264797: Do not include klassVtable.hpp from instanceKlass.hpp

Ioi Lam iklam at openjdk.java.net
Tue Apr 6 19:53:16 UTC 2021


On Tue, 6 Apr 2021 19:23:07 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> I thought you'd need to include the file because of this, because it's not a pointer:
> klassItable itable() const; // return klassItable wrapper
> 
> That's good that you don't!

Thanks for the review.

I looked this up to make sure what I am doing is allowed. Accord to the C++ specification, a forward-declared class is an incomplete type, which cannot be used "_in general, when the size and layout of the type must be known_". In this case, we just have a declaration of a function, so an incomplete type is allowed.

- https://en.cppreference.com/w/cpp/language/class
- https://en.cppreference.com/w/cpp/language/type#Incomplete_type

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

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


More information about the hotspot-runtime-dev mailing list