A lot of our thread pools use the default stack size for the platform
they're on, which can be rather large (8MB, usually, on Linux and OS X)
and is probably too much for the typical thread in the thread pool
regardless. SharedThreadPool already has some logic for selecting a
reasonable stack size for worker threads; let's move that logic to
nsIThreadManager so that logic (and constant) can be shared more
broadly. (That we already have a couple of instances of
SharedThreadPool usage solely for this constant suggests that it is a
concept that should be available in a more central location.)
The trick here is that we read in the element type before we expand the array, so that we
can write it to the new array before it becomes constified.
MozReview-Commit-ID: 2pbpNVZ3gPZ
--HG--
extra : rebase_source : 4c07fff32ea6b1d5c60ae3e40fb869b737cab13e
Also, change some reinterpret casts to static casts, because there was
no need for them to be reinterpret.
MozReview-Commit-ID: EtPmwxboaq9
--HG--
extra : rebase_source : 59fe2d74c8567af4d8000cb230e8dc0f8bf728ff
Once the XPT data is statically allocated, all of the pointers in
xpt_struct.h have to be made const, as well as the XPTHeader
itself. The existing consumers mostly assume things are const already,
so the bulk of the work is tweaking the deserialization code in
xpt_struct.cpp so that the final result is const. I've broken up these
changes into a set of patches.
This patch also gets rid of xptiTypelibGuts::GetHeader(), which is
never called.
MozReview-Commit-ID: FJpmNjY87SN
--HG--
extra : rebase_source : b28456625e4c80023bd350c67163085011bc7cee
A lot of time is spent during the final big XPT link determining what
the index is for each interface. Changing this to use a map
eliminates about 2/3 of the running time. This patch reduces the run
time to a little under a second on my local OSX machine.
MozReview-Commit-ID: CH4OYXtT19q
--HG--
extra : rebase_source : 6d6f755c57dcbf20112768583948f851b8bf34bf
Switch the order of the IPC FD argument and the crash FD argument in
e10s calls, because the IPC FD is the primary FD, and the crash FD
should be grouped with the crash annotation FD.
MozReview-Commit-ID: CAVyYAIIBPm
--HG--
extra : rebase_source : 596f590443f727d1a79582202eed122f79ae85cf
The patch also uses GetStringBuffer() in a couple of appropriate places.
MozReview-Commit-ID: JufCUgmO8JL
--HG--
extra : rebase_source : ecd3f17b5560b19622c86759d605fa122d70e48a
The refcount is only used for dynamic atoms.
On 64-bit, this reduces sizeof(nsStaticAtom) from 24 bytes to 16 bytes, and the
on-heap size from 32 bytes to 16 bytes. This saves 42 KiB per process.
On 32-bit, this reduces sizeof(nsStaticAtom) from 16 bytes to 12 bytes, but the
on-heap size stays at 16 bytes, so memory usage is unchanged.
MozReview-Commit-ID: 7d9H7MRHN9a
--HG--
extra : rebase_source : d3eafb3aaf44a592afd6c89cd0519d043056e65a
This was added in bug 1081000 to support linking XPT tests, but those
tests were removed in bug 1248534, part 1, so this shouldn't be needed
any more.
MozReview-Commit-ID: I1V2XVBaMG7
--HG--
extra : rebase_source : 8e772da227782b5304b553c0ba85f96f708bea99
Various atom-related things have improved recently.
- The main atom table is now threadsafe (bug 1275755) and so can be accessed on
any thread. It has also been split into pieces (bug 1440824), which greatly
reduces lock contention.
- A cache has been added to the HTML5 parser (bug 1352874) that removes the
need for most of the full table lookups.
As a result, there is no point having a separate static atom table. This patch
removes it.
MozReview-Commit-ID: 8ou1BrnPAwd
--HG--
extra : rebase_source : 0c6ab073b1a20b703705582d28731a68456741e1
Also, get rid of a gratuitous use of a trinary operator in
nsXPCWrappedJSClass::CallMethod, clean up the style a little, and mark
an unimplemented ctor as deleted.
MozReview-Commit-ID: Kp64sMxyRWc
--HG--
extra : rebase_source : e6082003d3759234cd5f4630b5560b14930c0a88
Also, clean up the style a little and mark an unimplemented ctor as
deleted.
MozReview-Commit-ID: JqmveE6qWFa
--HG--
extra : rebase_source : 62c8249de1f52686b4dd5d2a043261d2618d7433
Also, remove a few unused things.
Removing the include of xpt_arena.h from xpt_struct.h required that I
added it to two other files.
MozReview-Commit-ID: 4bMDRYt0Zxc
--HG--
extra : rebase_source : 91548b62dbf4b92bf918d196067e6fabb9a72302
This makes the file 2-space indented, gets rid of padding between
types and members, moves the * to the left, fixes the mode line,
license and include guards, and fixes up the first line of some of the
multiline comments. I also reordered the XPT_ANN macros to be more
consistent.
I left the padding alone for the enum-like bit flag values, as I think
it makes sense to line those up.
MozReview-Commit-ID: 877aP5eGIFm
--HG--
extra : rebase_source : 6d47ce05b47248c285597454af528ca1ae2cc830
This converts from the odd `tmp` for `rv` pattern and just returns immediately
on failure instead.
--HG--
extra : rebase_source : 1ad5882c1411e9e10f99201b6233ed87c71a20cc
nsSetDllDirectory.h consists of just one function definition, SanitizeEnvironmentVariables, which is now only called from nsWindowsMain.cpp. nsSetDllDirectory.h used to define its namesake NS_SetDllDirectory, but the function was removed in bug 699247.
Also remove some #includes that are no longer necessary.
MozReview-Commit-ID: E8OsXycdfO8
--HG--
extra : rebase_source : d9e63a50a782ab1fb0fde24646a777b882860fb9
extra : histedit_source : 63c41846db2bb6a1def03c343e6f336373f1fba6
nsXPTMethodInfo is a nicer structure to use, and this paves the way
for making the two types different, which will be needed if I make
XPTMethodDescriptor statically allocated.
Also, use the higher level accessor methods.
MozReview-Commit-ID: JbRdLU5Wwyt
--HG--
extra : rebase_source : 48f6c4e98e43c75006ceeb02bd727b59d3726681
This sounds weird, but either:
1) A method is notxpcom, so it can't be called from script and the XPT
information is unused.
2) A method is not notxpcom, in which case the result type is nsresult.
MozReview-Commit-ID: a7SRJn8PlP
--HG--
extra : rebase_source : 457051a47dd3f1f2f49b5f11ef3e5138f9d814e1
The old output had a single value: "atoms-table". The new output looks like
this:
> 649,904 B (00.39%) -- atoms
> ├──350,256 B (00.21%) -- dynamic
> │ ├──235,056 B (00.14%) ── unshared-buffers
> │ └──115,200 B (00.07%) ── atom-objects
> ├──212,992 B (00.13%) ── table
> └───86,656 B (00.05%) ── static/atom-objects
MozReview-Commit-ID: 924vUmxHAlh
--HG--
extra : rebase_source : 6c977546a69eeee62ebc87e335982e8278217484
Switch the order of the IPC FD argument and the crash FD argument in
e10s calls, because the IPC FD is the primary FD, and the crash FD
should be grouped with the crash annotation FD.
MozReview-Commit-ID: CAVyYAIIBPm
--HG--
extra : rebase_source : 02bf7337fa9a6d1194809c224acb4a2690fd87a3
This also changes a few MOZ_LOG() messages to use the error name
instead of the raw numerical nsresult value.
MozReview-Commit-ID: Jcngd0S9j2z
--HG--
extra : rebase_source : f6e974569d8845211e0b25dabef2c41dda2ca1b6
xpt.py only generates constants for a couple of the cases that
XPTConstValue supports. Eliminating the unused cases reduces the size
of this data structure from 64-bit to 32-bit, which reduces the memory
usage of xpti-working set by about 0.02MB.
MozReview-Commit-ID: 1yQkK28fPkR
--HG--
extra : rebase_source : 9d5ce81cfa213cba203ee9c72d2f7dcc8652bd31
num_additional_types is a uint8_t, so its max value is 255. 1 + 255 is
not greater than 256, so the check will pass, but then
num_additional_types += 1 will overflow in the next line.
What I think happened is that bug 1249174 part 6 introduced a bounds
check on an index (which is ok), but then part 8 repurposed this as a
bounds check on the length.
I noticed this because while writing the next patch I ended up with
if (id->num_additional_types > 255)
and then the compiler warned that the check would never fail.
MozReview-Commit-ID: KqiaOyBjj7v
--HG--
extra : rebase_source : 47b20ad2f5e39b05f467cc5b10041070db7fa774
Various strings, like nsISupports, appear many times in XPT data. This
patch adds a cache so we don't write the same string multiple times.
MozReview-Commit-ID: 6buBrXwHqQz
--HG--
extra : rebase_source : 54dea83a9134710c5600828ab68ef3f935f46afd
The name of this class is wrong, but my next patch will make it
actually cache. This patch should not change the behavior.
MozReview-Commit-ID: CMf6Chkeex1
--HG--
extra : rebase_source : a6d5688124b75aef8ed35f811003cf49b8b4e136
The intention is a little more clear with static_assert, as well as
failing sooner. (The code is probably the same, since the compiler will
optimize out the checks as dead code, but meh.)
Reading nsIIDs to binary streams requires 1 + 1 + 1 + 8 calls to Read
for the underlying stream. With the assumption that reading to the
underlying stream for a binary stream is relatively expensive, we should
be able to do better by reading the byte array in an nsIID in a single
Read() request. The same logic applies to writing nsIIDs. Performing a
single operation here should not change the actual bytes read or
written. Performing a single operation also has the virtue of
performing fewer error checks and whatnot.
These are C++ files now. This makes it so the highlighting works if
you use classes, etc.
Also, add Vim modelines.
MozReview-Commit-ID: 6fIkiTDnemt
--HG--
extra : rebase_source : 6232f6bbcf7e19763bbb6ac2cc03290eddb5e608
Without this patch, it's impossible for clients to move a reference into an
nsInterfaceHashtable. That causes at least one extra addref/release pair when
they otherwise could. With this patch, a client can do `hashTable.Put(key,
comptr.forget());` to avoid the additional refcounting.
MozReview-Commit-ID: Ghm7n41ziZp
--HG--
extra : rebase_source : a3e842bf9dfe202134c58e447ecf4fa79851c076
This adds some assertions to make the intended usage of LogModuleManager::Init
more clear.
--HG--
extra : rebase_source : c61e1736cedfbeaa96951ba40cdc954bbc0094d5
These methods will be used in subsequent patches.
MozReview-Commit-ID: EqCpRbn2Y5Y
--HG--
extra : rebase_source : 4b6c2388acb31490a981ca08ba34d4e69c09eddf
The change to RootAccessible.cpp fixes an obvious bug introduced in bug 741707.
The visibility changes in gfx/thebes are because NS_DECL_ISUPPORTS has a
trailing "public:" that those classes were relying on to have public
constructors.
MozReview-Commit-ID: IeB8KIJCGhU
This macro is identical to NS_INTERFACE_MAP_END and encourages the
reader to think that there's something extra-special threadsafe about QI
implementations that use the macro, when in reality there's nothing of
the sort.
Now that this file is all C++, we don't need to duplicate it.
MozReview-Commit-ID: 8nlcGLMnuzV
--HG--
extra : rebase_source : 3fcc2ccd05547de4388f917588d81135b6eb57a8
These are nominally in C, but I don't see any reason for that, given
that we no longer have external consumers. I got rid of "typedef
struct Foo Foo" at the same time.
Also replace a tab I noticed in the definnition of XPT_ANN_LAST.
MozReview-Commit-ID: CFgfiWmuo6r
--HG--
extra : rebase_source : 0bd79ef3055fe1b68a2ec6eaa6eebd0f7e52f730
We don't export these any more, so I don't think there's a reason to
mark them extern.
MozReview-Commit-ID: GbkF7HdRUT6
--HG--
extra : rebase_source : 52e4b72d14bc14d5cfeca110ed4842f2facf356e