gecko-dev/xpcom
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
..
base Bug 1448772 - Avoid back-and-forth UTF-16 to UTF-8 to UTF-16 conversions in xpcom/base/MacHelpers.mm. r=mstange 2018-03-26 10:49:02 +03:00
build Backed out 2 changesets (bug 1449051, bug 1447475) for MnH and en-US failures on a CLOSED TREE 2018-03-28 02:05:38 +03:00
components Bug 1438688, part 2 - Load XPT information from a static variable instead of a file. r=njn 2018-02-28 12:51:39 -08:00
doc
ds Bug 1441726 - Include CacheStorageService::mPurgeTimeStamps hashtable in the memory reporter. r=michal 2018-03-27 10:21:00 +03:00
glue Bug 1428557 - Implement wrappers in FileUtils. r=froydnj 2018-02-02 23:25:10 +09:00
idl-parser Bug 1293362 - Part 5: Allow implementing xpcom interfaces from rust code with a custom derive, r=froydnj 2018-01-23 17:27:28 -05:00
io Bug 1449491 - Remove the "Strt" and "CmStrt" directories. r=froydnj 2018-03-28 19:06:43 +11:00
libxpt/xptcall Bug 1403959, part 2 - Automatically generated eslint fixes. r=froydnj 2017-09-28 15:49:04 -07:00
reflect Bug 1438688, part 5 - Merge XPTInterfaceDirectoryEntry and XPTInterfaceDescriptor. r=njn 2018-03-12 13:36:15 -07:00
rust Bug 1449034 - Update Rust crates to use lazy_static 1.0. r=ted 2018-03-26 15:12:56 -07:00
string Bug 1448472 - Remove a C5037 warning suppression xpcom/string/moz.build that is no longer needed. r=xidorn 2018-03-24 12:19:44 -04:00
system Backed out changeset 3b82709eca8a (bug 1445990) for xpcshell failures at js/xpconnect/tests/unit/test_defineModuleGetter.js on a CLOSED TREE 2018-03-16 04:27:22 +02:00
tests Bug 1438688, part 3 - Remove XPT files from the packaging process. r=glandium 2018-03-05 14:27:29 -08:00
threads Bug 1447744 - don't implement nsINamed for mozilla::Runnable when it's unused; r=erahm 2018-03-23 14:53:55 -04:00
typelib Bug 1438688, part 6 - Compile XPT information to C++ at build time. r=glandium,njn 2018-03-12 10:30:35 -07:00
windbgdlg
xpidl Bug 1390916 - Always use --track instead of --no-remove for install manifests; r=gps 2017-08-08 17:07:07 -04:00
moz.build Bug 1403213 - Move nsstring into servo/support/gecko/nsstring, r=froydnj 2017-10-23 15:37:25 -04:00
xpcom-config.h.in
xpcom-private.h.in Bug 1423846 - Remove configure script checks for iconv and mbrtowc/tcrtomb. r=glandium 2017-12-07 14:06:53 +02:00