gecko-dev/xpcom
Nicholas Nethercote 9ea93c4f7b Bug 1449395 - Remove nsStaticAtomSetup. r=froydnj
Each nsStaticAtomSetup contains a pointer to a static atom, and also a pointer
to the canonical pointer to that static atom. Which is pretty weird! The
notable thing thing about it is that these structs are in an array, and that
gives us the only way to iterate over all static atoms in a single class, for
registration and lookups.

But thanks to various other recent changes to the implementation of static
atoms, we can now put the static atoms themselves into an array, which can be
iterated over. So this patch does that. With that done, nsStaticAtomSetup is no
longer necessary.

According to the `size` utility, on Linux64 this reduces the size of libxul.so
by the following amounts:

> text:  62008 bytes
> data:  20992 bytes
> bss:   21040 bytes
> total: 104040 bytes

- The bss reduction is one word per atom, because the canonical static atom
  pointers (e.g. nsGkAtoms::foo) have moved from .bss to .data, because they're
  now initialized at compile time instead of runtime.

- The data reduction is one word per atom, because we remove two words per atom
  for the nsStaticAtomSetup removal, but gain one word per atom from the
  previous bullet point.

- I'm not sure about the text reduction. It's three words per atom. Maybe
  because there is one less relocation per atom?

Other notable things in the patch:

- nsICSSAnonBoxPseudo and nsICSSPseudoElement now inherit from nsStaticAtom,
  not nsAtom, because that's more precise.

- Each static atoms array now has an enum associated with it, which is used in
  various ways.

- In the big comment about the macros at the top of nsStaticAtom.h, the pre-
  and post-expansion forms are now shown interleaved. The interleaving reduces
  duplication and makes the comment much easier to read and maintain. The
  comment also has an introduction that explains the constraints and goals of
  the implementation.

- The SUBCLASS macro variations are gone. There are few enough users of these
  macros now that always passing the atom type has become simpler.

MozReview-Commit-ID: 1GmfKidLjaU

--HG--
extra : rebase_source : 2352590101fc6693ba388f885ca4714a42963943
2018-03-29 11:48:18 +11: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 1446585: Remove support for resource entries in bootstrapped chrome.manifest files. r=aswan,MattN,k88hudson 2018-03-16 20:18:46 -07:00
doc
ds Bug 1449395 - Remove nsStaticAtomSetup. r=froydnj 2018-03-29 11:48:18 +11: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 1449395 - Remove nsStaticAtomSetup. r=froydnj 2018-03-29 11:48:18 +11:00
libxpt/xptcall Bug 1403959, part 2 - Automatically generated eslint fixes. r=froydnj 2017-09-28 15:49:04 -07:00
reflect Bug 1447472 part 3. Remove nsIDOMNSEvent. r=qdot 2018-03-26 14:53:53 -04: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 1449395 - Remove unnecessary nsStaticAtom.h includes. r=froydnj 2018-03-29 09:08:54 +11: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 1449395 - Remove unnecessary nsStaticAtom.h includes. r=froydnj 2018-03-29 09:08:54 +11: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 1447849 - Eliminate the anonymous union from XPTTypeDescriptor. r=njn 2018-03-21 16:35:55 -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