RFR: 8261868: Reduce inclusion of metaspace.hpp [v3]

Ioi Lam iklam at openjdk.java.net
Thu Feb 25 00:31:09 UTC 2021


> metaspace.hpp is included by about 770 out of 1000 HotSpot .o files. Most of these are transitively included via array.hpp and classLoaderData.hpp.
> 
> - classLoaderData.hpp doesn't actually need metaspace.hpp.
> - array.hpp can be refactored to put a function that depends on metaspace.hpp into array.inline.hpp
> 
> Doing the above reduces the number of .o files that include metaspace.hpp to 343. Since this is still a significant number, we should split out the rarely used classes (such as `MetaspaceGC` and `MetaspaceUtils`) into a new header file (metaspaceUtils.hpp, which is included only 30 times).
> 
> Also, these 3 includes can now be removed from metaspace.hpp.
> 
> #include "memory/memRegion.hpp"
> #include "memory/metaspaceChunkFreeListSummary.hpp"
> #include "memory/virtualspace.hpp"
> 
> Tested with mach5: tier1, builds-tier2, builds-tier3, builds-tier4 and builds-tier5. Also locally: aarch64, arm, ppc64, s390, x86, and zero.
> 
> (I also fixed an unrelated comment in archiveUtils.cpp when I was scanning for the word "Metaspace" in the source files -- the function `MetaspaceShared::commit_to()` no longer exists).

Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - fixed copyright
 - Merge branch 'master' of https://github.com/openjdk/jdk into 8261868-reduce-inclusion-of-metaspace.hpp
 - @calvinccheung review comments
 - fixed ppc/s390 builds
 - step2
 - step 1

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2599/files
  - new: https://git.openjdk.java.net/jdk/pull/2599/files/700d1c16..b5b5a935

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2599&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2599&range=01-02

  Stats: 15191 lines in 386 files changed: 10589 ins; 2402 del; 2200 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2599.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2599/head:pull/2599

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


More information about the shenandoah-dev mailing list