On Fri, 9 Oct 2026 14:32:40 GMT, Stefan Karlsson <[email protected]> wrote:
> I hit a circular dependency involving oopCast.inline.hpp when I was changing > code in one of the *oop.inline.hpp files. One solution is to create an > oopCast.hpp file with the declarations and include it in oopCast.inline.hpp > before including the rest of the header files: > > https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md: > > All .inline.hpp files should include their corresponding .hpp file as the > first include line with a blank line separating it from the rest of the > include lines. Declarations needed by other files should be put in the .hpp > file, and not in the .inline.hpp file. This rule exists to resolve problems > with circular dependencies between .inline.hpp files. > > > I propose that we instead move oop_cast to oop.inline.hpp. > > I also made some cleanups to the surrounding type checking functions. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Agreed, `oop.inline.hpp` is a good home for these. src/hotspot/share/oops/oop.inline.hpp line 228: > 226: } > 227: > 228: template<> inline bool oopDesc::is<instanceOop>() const { return > is_instance(); } I am sure it is fine, but can you ballpark `time make hotspot` before and after this change? Do these template instantiations (?) cost us anything compile-time-wise? src/hotspot/share/oops/oop.inline.hpp line 241: > 239: } > 240: > 241: bool oopDesc::is_refined_objArray() const { return > klass()->is_refined_objArray_klass(); } This seems to belong in the `oopDesc::is_*()` block a few lines above? ------------- PR Review: https://git.openjdk.org/jdk/pull/33287#pullrequestreview-5488835180 PR Review Comment: https://git.openjdk.org/jdk/pull/33287#discussion_r4246529422 PR Review Comment: https://git.openjdk.org/jdk/pull/33287#discussion_r4246504944
