gecko-dev/xpcom/io
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
..
Base64.cpp Bug 1413490 - Base64.cpp: disable the formatting of kBase64DecodeTable & kBase64URLDecodeTable r=erahm 2017-11-01 11:24:37 +01:00
Base64.h Bug 1362449 - part 1a - fix Encode*to* for non-8-bit character types; r=erahm 2017-09-06 16:58:37 -04:00
CocoaFileUtils.h
CocoaFileUtils.mm
FileDescriptorFile.cpp Bug 1428543 - Add mozilla::filesystem::Path and use it in nsIFile. r=froydnj 2017-12-28 03:03:35 +09:00
FileDescriptorFile.h Bug 1412119 - Re-fix mode lines in xpcom. r=erahm 2017-10-26 14:39:00 -04:00
FileUtilsWin.cpp
FileUtilsWin.h Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium 2017-12-06 16:52:51 -08:00
NonBlockingAsyncInputStream.cpp Backed out 2 changesets (bug 1435899) for failing android at modules/libpref/test/unit/test_defaultValues.js pn a CLOSED TREE 2018-03-09 23:14:32 +02:00
NonBlockingAsyncInputStream.h Bug 1371699 - Correct canceling of the AsyncWait() callback in NonBlockingAsyncInputStream, r=froydnj 2018-01-31 16:45:21 +01:00
SlicedInputStream.cpp Bug 1414767 - Moving SlicedInputStream under mozilla namespace, r=froydnj 2017-11-07 01:04:06 +01:00
SlicedInputStream.h Bug 1414767 - Moving SlicedInputStream under mozilla namespace, r=froydnj 2017-11-07 01:04:06 +01:00
SnappyCompressOutputStream.cpp
SnappyCompressOutputStream.h
SnappyFrameUtils.cpp
SnappyFrameUtils.h
SnappyUncompressInputStream.cpp
SnappyUncompressInputStream.h
SpecialSystemDirectory.cpp Bug 1449491 - Remove the "Strt" and "CmStrt" directories. r=froydnj 2018-03-28 19:06:43 +11:00
SpecialSystemDirectory.h Bug 1449491 - Remove the "Strt" and "CmStrt" directories. r=froydnj 2018-03-28 19:06:43 +11:00
crc32c.c
crc32c.h
moz.build Bug 1411469 - Statically allocate static atoms. r=froydnj 2018-03-26 11:18:31 +02:00
nsAnonymousTemporaryFile.cpp Bug 1434911 - when creating temporary files, don't set the executable bit; r=froydnj 2018-02-01 09:52:01 -05:00
nsAnonymousTemporaryFile.h Bug 1403706 - Remove race conditions in temporary blob - part 3 - NS_OpenAnonymousTemporaryNsIFile, r=smaug 2017-10-05 07:41:41 +02:00
nsAppDirectoryServiceDefs.h Bug 1386404 - Enable content-process specific tmpdir on Linux. r=jld 2018-01-09 16:29:40 +01:00
nsAppFileLocationProvider.cpp Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj 2017-11-05 19:37:28 -08:00
nsAppFileLocationProvider.h Bug 1398291 - Remove remaining IsOSXLeopard leftover. r=mstange 2017-09-08 21:15:00 +02:00
nsBinaryStream.cpp Bug 1439355 - use static_assert instead of NS_ASSERTION in nsBinaryStream.cpp; r=mystor 2018-02-20 16:34:42 -05:00
nsBinaryStream.h Bug 1404198: Part 1 - Add non-virtual constructor for nsIObject(Input|Output)Stream and update existing callers. r=njn 2017-10-04 20:06:28 -07:00
nsDirectoryService.cpp Bug 1449395 - Remove nsStaticAtomSetup. r=froydnj 2018-03-29 11:48:18 +11:00
nsDirectoryService.h Bug 1449395 - Remove nsStaticAtomSetup. r=froydnj 2018-03-29 11:48:18 +11:00
nsDirectoryServiceAtomList.h Bug 1449491 - Remove the "Strt" and "CmStrt" directories. r=froydnj 2018-03-28 19:06:43 +11:00
nsDirectoryServiceDefs.h Bug 1449491 - Remove the "Strt" and "CmStrt" directories. r=froydnj 2018-03-28 19:06:43 +11:00
nsDirectoryServiceUtils.h
nsEscape.cpp Bug 1333899 - Part 1: Add a fallible NS_UnescapeURL. r=froydnj 2018-02-02 10:42:42 -08:00
nsEscape.h Bug 1333899 - Part 1: Add a fallible NS_UnescapeURL. r=froydnj 2018-02-02 10:42:42 -08:00
nsIAsyncInputStream.idl
nsIAsyncOutputStream.idl
nsIBinaryInputStream.idl
nsIBinaryOutputStream.idl
nsICloneableInputStream.idl Bug 1397645 - Optimize IPCBlobInputStream slicing with the introduction of nsICloneableInputStreamWithRange, r=asuth 2017-09-11 17:29:15 +02:00
nsIConverterInputStream.idl Bug 1445692 - Remove UTF8InputStream. r=froydnj 2018-03-14 20:53:18 +02:00
nsIConverterOutputStream.idl
nsIDirectoryEnumerator.idl
nsIDirectoryService.idl
nsIFile.idl Bug 1428258 - Disallow nsIFile::GetNativePath on Windows. r=froydnj 2018-01-11 22:38:33 +09:00
nsIIOUtil.idl
nsIInputStream.idl
nsIInputStreamTee.idl
nsILineInputStream.idl
nsILocalFileMac.idl
nsILocalFileWin.idl Bug 1433265 - Remove ShortcutResolver from nsLocalFileWin.cpp. r=froydnj 2018-01-31 20:56:17 +09:00
nsIMultiplexInputStream.idl Bug 1426888 - Get rid of nsIMultiplexInputStream::RemoveStream, r=smaug 2017-12-30 12:47:12 +01:00
nsIOUtil.cpp
nsIOUtil.h
nsIObjectInputStream.idl Bug 1404198: Part 1 - Add non-virtual constructor for nsIObject(Input|Output)Stream and update existing callers. r=njn 2017-10-04 20:06:28 -07:00
nsIObjectOutputStream.idl Bug 1404198: Part 1 - Add non-virtual constructor for nsIObject(Input|Output)Stream and update existing callers. r=njn 2017-10-04 20:06:28 -07:00
nsIOutputStream.idl
nsIPipe.idl
nsISafeOutputStream.idl
nsIScriptableBase64Encoder.idl
nsIScriptableInputStream.idl
nsISeekableStream.idl
nsIStorageStream.idl
nsIStreamBufferAccess.idl
nsIStringStream.idl
nsIUnicharInputStream.idl
nsIUnicharLineInputStream.idl
nsIUnicharOutputStream.idl
nsInputStreamTee.cpp
nsLinebreakConverter.cpp
nsLinebreakConverter.h
nsLocalFile.h Bug 1433265 - Remove ShortcutResolver from nsLocalFileWin.cpp. r=froydnj 2018-01-31 20:56:17 +09:00
nsLocalFileCommon.cpp Bug 1443651: Don't return failure for access denied from createUnique() if file exists. r=Mossop 2018-03-06 14:32:40 -08:00
nsLocalFileUnix.cpp Bug 1433265 - Remove ShortcutResolver from nsLocalFileWin.cpp. r=froydnj 2018-01-31 20:56:17 +09:00
nsLocalFileUnix.h Bug 1433265 - Remove ShortcutResolver from nsLocalFileWin.cpp. r=froydnj 2018-01-31 20:56:17 +09:00
nsLocalFileWin.cpp Bug 1440630 - Reduce nsIFile::ResolveAndStat() calls. r=froydnj 2018-02-23 21:45:41 +09:00
nsLocalFileWin.h Bug 1433265 - Remove ShortcutResolver from nsLocalFileWin.cpp. r=froydnj 2018-01-31 20:56:17 +09:00
nsMultiplexInputStream.cpp Bug 1426888 - Get rid of nsIMultiplexInputStream::RemoveStream, r=smaug 2017-12-30 12:47:12 +01:00
nsMultiplexInputStream.h
nsNativeCharsetUtils.cpp Bug 960957 - Drop nsIFile support for non-UTF-8 file path encodings on non-Windows platforms. r=emk,m_kato 2017-12-05 13:33:52 +02:00
nsNativeCharsetUtils.h Bug 960957 - Drop nsIFile support for non-UTF-8 file path encodings on non-Windows platforms. r=emk,m_kato 2017-12-05 13:33:52 +02:00
nsPipe.h
nsPipe3.cpp Bug 1427023 - Remove nsCRT::strncmp. r=erahm 2018-01-09 23:49:37 +09:00
nsScriptableBase64Encoder.cpp
nsScriptableBase64Encoder.h
nsScriptableInputStream.cpp
nsScriptableInputStream.h
nsSegmentedBuffer.cpp
nsSegmentedBuffer.h
nsStorageStream.cpp
nsStorageStream.h
nsStreamUtils.cpp Bug 1405974 - NonBlockingAsyncInputStream must take the ownership of the underlying stream, r=qdot 2018-01-31 16:45:20 +01:00
nsStreamUtils.h Bug 1405974 - NonBlockingAsyncInputStream must take the ownership of the underlying stream, r=qdot 2018-01-31 16:45:20 +01:00
nsStringStream.cpp Bug 1396290 - nsStringStream should propagate the OOM error of SetData() when cloned, r=froydnj 2017-09-06 18:11:44 +02:00
nsStringStream.h Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium 2017-12-06 16:52:51 -08:00
nsUnicharInputStream.cpp Bug 1445692 - Remove UTF8InputStream. r=froydnj 2018-03-14 20:53:18 +02:00
nsUnicharInputStream.h
nsWildCard.cpp
nsWildCard.h