RFR: JDK-8280503: Use allStatic.hpp instead of allocation.hpp where possible [v2]

Ioi Lam iklam at openjdk.java.net
Mon Jan 24 05:57:08 UTC 2022


On Mon, 24 Jan 2022 05:44:50 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> JDK-8249944 moved AllStatic to its own header. We should use that one instead of allocation.hpp where possible to reduce header dependencies.
>> 
>> This patch:
>> - replaces includes of allocation.hpp with allstatic.hpp where appropiate
>> - fixes up resulting errors since this changes uncovers missing dependencies. Mainly, missing includes of debug.hpp, of globalDefinitions.hpp, and missing outputStream definitions.
>> 
>> Changes are trivial but onerous. Done partly with a script, partly manually.
>> 
>> Test:
>> - Checked the build with gtests on Linux x86, x64, minimal, zero, aarch64, for both fastdebug and release. All builds of course without PCH.
>> - GHAs
>
> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add missing includes for macos, windows

> > BTW, I have some scripts for checking how often a header file is included. See https://github.com/iklam/tools/tree/main/headers
> 
> Does your tool tell you include chokepoints, maybe its just one central include pulling in allocation.hpp?
> 

The whoincludes.tcl script can do that. Unfortunately it tells us that many popular header (such as ostream.hpp that was itself included 976 times) include allocations.hpp.


src/hotspot$ tclsh whoincludes.tcl allocation.hpp| head -20
scanning    997 allocation.hpp
   2 found    976 ostream.hpp
   3 found    960 exceptions.hpp
   4 found    938 atomic.hpp
   5 found    891 memRegion.hpp
   6 found    877 iterator.hpp
   7 found    871 arena.hpp
   8 found    864 mutex.hpp
   9 found    860 growableArray.hpp
  10 found    855 mutexLocker.hpp
  11 found    855 autoRestore.hpp
  12 found    848 padded.hpp
  13 found    841 linkedlist.hpp
  14 found    835 jfrAllocation.hpp
  15 found    832 resourceHash.hpp
  16 found    829 gcUtil.hpp
  17 found    825 threadHeapSampler.hpp
  18 found    825 thread.hpp
  19 found    825 filterQueue.hpp
  20 found    679 symbol.hpp

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

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


More information about the shenandoah-dev mailing list