зеркало из https://github.com/mozilla/gecko-dev.git
9ea93c4f7b
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 |
||
---|---|---|
.. | ||
ArenaAllocator.h | ||
ArenaAllocatorExtensions.h | ||
ArrayIterator.h | ||
AtomArray.h | ||
Dafsa.cpp | ||
Dafsa.h | ||
IncrementalTokenizer.cpp | ||
IncrementalTokenizer.h | ||
Observer.h | ||
PLDHashTable.cpp | ||
PLDHashTable.h | ||
StickyTimeDuration.h | ||
Tokenizer.cpp | ||
Tokenizer.h | ||
make_dafsa.py | ||
moz.build | ||
nsArray.cpp | ||
nsArray.h | ||
nsArrayEnumerator.cpp | ||
nsArrayEnumerator.h | ||
nsArrayUtils.cpp | ||
nsArrayUtils.h | ||
nsAtom.h | ||
nsAtomTable.cpp | ||
nsAtomTable.h | ||
nsBaseHashtable.h | ||
nsCOMArray.cpp | ||
nsCOMArray.h | ||
nsCRT.cpp | ||
nsCRT.h | ||
nsCharSeparatedTokenizer.h | ||
nsCheapSets.h | ||
nsClassHashtable.h | ||
nsDataHashtable.h | ||
nsDeque.cpp | ||
nsDeque.h | ||
nsEnumeratorUtils.cpp | ||
nsEnumeratorUtils.h | ||
nsExpirationTracker.h | ||
nsGkAtomList.h | ||
nsGkAtoms.cpp | ||
nsGkAtoms.h | ||
nsHashKeys.h | ||
nsHashPropertyBag.cpp | ||
nsHashPropertyBag.h | ||
nsIArray.idl | ||
nsIArrayExtensions.idl | ||
nsIHashable.idl | ||
nsIINIParser.idl | ||
nsIMutableArray.idl | ||
nsINIParserImpl.cpp | ||
nsINIParserImpl.h | ||
nsINIProcessor.js | ||
nsINIProcessor.manifest | ||
nsIObserver.idl | ||
nsIObserverService.idl | ||
nsIPersistentProperties.h | ||
nsIPersistentProperties2.idl | ||
nsIProperties.idl | ||
nsIProperty.idl | ||
nsIPropertyBag.idl | ||
nsIPropertyBag2.idl | ||
nsISerializable.idl | ||
nsISimpleEnumerator.idl | ||
nsIStringEnumerator.idl | ||
nsISupportsIterators.idl | ||
nsISupportsPrimitives.idl | ||
nsIVariant.idl | ||
nsIWindowsRegKey.idl | ||
nsIWritablePropertyBag.idl | ||
nsIWritablePropertyBag2.idl | ||
nsInterfaceHashtable.h | ||
nsJSThingHashtable.h | ||
nsMathUtils.h | ||
nsObserverList.cpp | ||
nsObserverList.h | ||
nsObserverService.cpp | ||
nsObserverService.h | ||
nsPersistentProperties.cpp | ||
nsPersistentProperties.h | ||
nsPointerHashKeys.h | ||
nsProperties.cpp | ||
nsProperties.h | ||
nsQuickSort.cpp | ||
nsQuickSort.h | ||
nsRefPtrHashtable.h | ||
nsStaticAtom.h | ||
nsStaticNameTable.cpp | ||
nsStaticNameTable.h | ||
nsStringEnumerator.cpp | ||
nsStringEnumerator.h | ||
nsSupportsPrimitives.cpp | ||
nsSupportsPrimitives.h | ||
nsTArray-inl.h | ||
nsTArray.cpp | ||
nsTArray.h | ||
nsTArrayForwardDeclare.h | ||
nsTHashtable.h | ||
nsTObserverArray.cpp | ||
nsTObserverArray.h | ||
nsTPriorityQueue.h | ||
nsVariant.cpp | ||
nsVariant.h | ||
nsWhitespaceTokenizer.h | ||
nsWindowsRegKey.cpp | ||
nsWindowsRegKey.h |