gecko-dev/config/makefiles
Andrew McCreight 27f44d82d0 Bug 1438688, part 6 - Compile XPT information to C++ at build time. r=glandium,njn
This patch handles the actual generation of the static data structures
used to represent XPT information. XPT files are generated in the same
way as they are now, but they are used only as an intermediate
representation to speed up incremental compilation rather than
something used by Firefox itself. Instead of linking XPTs into a
single big XPT file at packaging time, they are linked into a single
big C++ file at build time, that defines the various static consts in
XPTHeader.

In xpt.py, every data structure that can get written to disk gets an
additional code_gen() method that returns a representation of that
data structure as C++ source code. CodeGenData aggregates this
information together, handling deduplication and the final source code
generation.

The ctors are needed for XPTConstValue to statically initialize the
different union cases without resorting to designated initializers,
which are part of C99, not C++. Designated initializers appear to be
supported in C++ code by Clang and GCC, but not MSVC. The ctors must
be constexpr to ensure they are actually statically initialized so
they can be shared between Firefox processes.

I also removed an unnecessary "union" in XPTConstDescriptor.

Together, these patches reduce the amount of memory reported by
xpti-working-set from about 860,000 bytes to about 200,000 bytes. The
remaining memory is used for xptiInterface and xptiTypelibGuts (which
are thin wrappers around the XPT interfaces and header) and hash
tables to speed up looking up interfaces by name or IID. That could
potentially be eliminated from dynamic allocations in follow up
work. These patches did not affect memory reporting because XPT arenas
are still used by the remaining XPTI data structures.

MozReview-Commit-ID: Jvi9ByCPa6H

--HG--
extra : rebase_source : a9e48e7026aab4ad1b7f97e50424adf4e3f4142f
2018-03-12 10:30:35 -07:00
..
xpidl Bug 1438688, part 6 - Compile XPT information to C++ at build time. r=glandium,njn 2018-03-12 10:30:35 -07:00
autotargets.mk
debugmake.mk Bug 1414064 - Remove references to EXTRA_LIBS in the build system. r=mshal 2017-11-07 14:34:44 -08:00
functions.mk Bug 1027890 - Remove all sorts of build system code dedicated to pymake. r=gps 2014-06-25 08:38:28 +09:00
java-build.mk Bug 1440433 - Part 2: Remove ANDROID_APK_{NAME,PACKAGE}. r=jchen 2018-02-22 13:36:49 -08:00
makeutils.mk Bug 1247162 - Generate a header defining MOZ_SOURCE_*. r=mshal 2016-02-12 07:16:14 +09:00
nonrecursive.mk
target_binaries.mk bug 1255485 - build PROGRAMs directly in dist/bin instead of copying them. r=nalexander 2018-01-10 14:26:12 -05:00