RFR: 8310494: Do not include constantPool.hpp from instanceKlass.hpp

Stefan Karlsson stefank at openjdk.org
Wed Jun 21 16:17:06 UTC 2023


On Wed, 21 Jun 2023 15:46:22 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> instanceKlass.hpp is needed quite frequently for HotSpot C++ sources, but constantPool.hpp is much less frequently.
> 
> This PR is the first step of reducing the inclusion of constantPool.hpp, by removing it from instanceKlass.hpp
> 
> I moved a bunch of inline functions into instanceKlass.cpp. These don't seem to be performance related.

I think this change looks fine (minus a couple of nits).

I do wonder if the code wouldn't be nicer if we simply removed these delegating functions in InstanceKlass and let the callers operate on the ConstantPool directly instead?

src/hotspot/share/classfile/javaClasses.hpp line 32:

> 30: #include "oops/oopsHierarchy.hpp"
> 31: #include "oops/symbol.hpp"
> 32: #include "runtime/os.hpp"

Sort order issue

src/hotspot/share/oops/instanceKlass.hpp line 996:

> 994:   // The constant pool is on stack if any of the methods are executing or
> 995:   // referenced by handles.
> 996:   bool on_stack() const; // virtual

Suggestion:

  virtual bool on_stack() const;

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

PR Review: https://git.openjdk.org/jdk/pull/14597#pullrequestreview-1491164410
PR Review Comment: https://git.openjdk.org/jdk/pull/14597#discussion_r1237253897
PR Review Comment: https://git.openjdk.org/jdk/pull/14597#discussion_r1237257672


More information about the hotspot-dev mailing list