зеркало из https://github.com/mozilla/gecko-dev.git
27f44d82d0
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 |
||
---|---|---|
.. | ||
Moz | ||
external | ||
faster | ||
makefiles | ||
mozunit | ||
tests | ||
AB_rCD.mk | ||
Makefile.in | ||
MozZipFile.py | ||
android-common.mk | ||
autoconf-js.mk.in | ||
autoconf.mk.in | ||
baseconfig.mk | ||
check_js_msg_encoding.py | ||
check_js_opcode.py | ||
check_macroassembler_style.py | ||
check_source_count.py | ||
check_spidermonkey_style.py | ||
check_vanilla_allocations.py | ||
config.mk | ||
createprecomplete.py | ||
emptyvars-js.mk.in | ||
emptyvars.mk.in | ||
find_OOM_errors.py | ||
gcc-stl-wrapper.template.h | ||
gcc_hidden.h | ||
install.bat | ||
make-stl-wrappers.py | ||
make-system-wrappers.py | ||
milestone.txt | ||
moz.build | ||
msvc-stl-wrapper.template.h | ||
nsinstall.c | ||
nsinstall.py | ||
pathsub.c | ||
pathsub.h | ||
printconfigsetting.py | ||
printprereleasesuffix.py | ||
pythonpath.py | ||
rebuild_check.py | ||
recurse.mk | ||
rules.mk | ||
static-checking-config.mk | ||
stl-headers.mozbuild | ||
system-headers.mozbuild | ||
version.mk | ||
version_win.pl |