RFR: 8288537: Refactor hotspot/share/memory/iterator.hpp

Stefan Karlsson stefank at openjdk.org
Fri Jun 17 08:59:50 UTC 2022


On Thu, 16 Jun 2022 02:14:37 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> HotSpot build time has regressed quite a bit since JDK 17 (1m46s vs 2m20s on my machine). Now it's time to do some header file cleanup.
> 
> iterator.hpp contains a hodge-podge of unrelated classes. Some of these classes have dependencies on other headers (e.g., `Devirtualizer` depends on bitMap.hpp) that slow down C++ compilation.
> 
> This patch moves two infrequently used classes, `Devirtualizer` and `SerializeClosure`, to their own header files. This reduces the total number of C++ lines compiled for libjvm.so for about 1%.

I forgot that Loom hijacked Devirtualizer for the derived oops processing. This devirtualization is not needed. The compiler sees the correct type and performs the correct inlining anyway. Before the integration of Loom I removed the usage of Devirtualizer::do_bit and verified that the compiler generated the same code (though I forgot to remove function).

I took and tested removing Devirtualizer::do_derived_oops, and again, the compiler generated the same code. So, simplest would be to just remove that function and the include of iterator.inline.hpp. However, if you still want to do this separation, then I guess that's OK as well. Could you move the Devirtualizer class to utilities/ instead of oops/, given that it's not necessarily oops that we are visiting? Maybe also update the comment to not mention OopClosureType.

Sounds good to move the OopIterateDispatch code to oops/oopIterateDispatch.

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

PR: https://git.openjdk.org/jdk/pull/9176


More information about the shenandoah-dev mailing list