RFR: 8259882: Reduce the inclusion of perfData.hpp
Ioi Lam
iklam at openjdk.java.net
Mon Jan 18 05:48:52 UTC 2021
perfData.hpp is about 1000 lines long, and is included by 829 out of about 1000 HotSpot .o files.
Several popular headers (such as synchronizer.hpp, objectMonitor.hpp, threadLocalAllocBuffer.hpp) include perfData.hpp. However, since these headers just declare pointers like
PerfCounter* foo;
there's no need to include perfData.hpp. A forward declaration of the PerfCount type would suffice.
With forward declaration, we can remove perfData.hpp from these headers. This reduces the number of .o files that include perfData.hpp to 183. Build time of HotSpot is reduced by about 0.4%.
**Note:** the forward declaration is in the new file perfDataTypes.hpp. It contains typedefs to make "aliases" of the types. These are probably relics from the past, where new classes like`PerfIntConstant` were to be added but that never happened.
typedef PerfLongSampleHelper PerfSampleHelper;
typedef PerfLongConstant PerfConstant;
typedef PerfLongCounter PerfCounter;
typedef PerfLongVariable PerfVariable;
The HotSpot code uses both the "real" type and the "alias" type (mostly the latter). I don't want to deal with the alises for now, so I just moved them from perfData.hpp to perfDataTypes.hpp. We should probably just rename `PerfLongConstant` to `PerfConstant` in a future RFE.
Tested with mach5: tier1, builds-tier2, builds-tier3, builds-tier4 and builds-tier5. Also locally: aarch64, arm, ppc64, s390, x86, and zero.
-------------
Commit messages:
- 8259882: Reduce the inclusion of perfData.hpp
Changes: https://git.openjdk.java.net/jdk/pull/2123/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2123&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8259882
Stats: 116 lines in 23 files changed: 73 ins; 20 del; 23 mod
Patch: https://git.openjdk.java.net/jdk/pull/2123.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2123/head:pull/2123
PR: https://git.openjdk.java.net/jdk/pull/2123
More information about the hotspot-dev
mailing list