Commit Graph

5834 Commits

Author SHA1 Message Date
Nicholas Nethercote
44179aabe3 Back out changesets 2fcef6b54be7, 2be07829fefc, 66dfe37b8532, df3fcd2be8fd, 0a436bce77a6 (bug 1050035) for causing intermittent crashes and assertion failures.
--HG--
extra : rebase_source : eb30be83c3143c6c203585a80a18f180025efaba
2015-02-10 14:39:49 -08:00
Bobby Holley
a13ed18313 Bug 1129877 - Add a templatized move constructor for nsRefPtr. v1 r=froydnj 2015-02-10 13:45:02 -08:00
L. David Baron
ea80ec9aaa Bug 680547 bustage fix: Make #pragmas be #ifndef __clang__. No review. 2015-02-10 16:24:54 +11:00
L. David Baron
501b6ec2b7 Bug 680547 - Compile Linux 64-bit NS_InvokeByIndex with -mno-avx to allow compiling with -march=native on new hardware, or similar -march flags. r=froydnj
As explained in bug 1111355, having avx enabled appears to change the
alignment behavior of alloca (apparently adding an extra 16 bytes) of
padding/alignment (and using 32-byte alignment instead of 16-byte).  The
suggestion of using __bultin_alloca_with_align in bug 1111355 didn't fix
the problem, so this seems to be the best available workaround, given
that this code, which should perhaps better be written in assembly, is
written in C++.

Interestingly, this is NOT fixed by #pragma GCC target ("arch=x86-64").
(I determined the (undocumented) name for the default -march value on
x86_64 from the gcc source code (gcc/config/i386/i386.c, function
ix86_option_override_internal, code that sets opts->x_ix86_arch_string .)
I confirmed that this sets the same macros based on the empty diff
between the output of 'gcc -E -dM -x c++ /dev/null' and 'gcc -E -dM -x
c++ -march=x86-64 /dev/null', which was not an empty diff for other
-march values (e.g., k8).)

I confirmed that the push_options and pop_options actually work by
putting the push/pop pair around a different (earlier) function, and
testing that this did not fix the bug (with the pop_options before
NS_InvokeByIndex).

See the gcc documentation at:
https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Function-Specific-Option-Pragmas.html
https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Function-Attributes.html
https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/i386-and-x86-64-Options.html

--HG--
extra : transplant_source : %DA%7CJ4H%DE%80%15%84%0D%116%85Q%9A%F9%2C%D1v%16
2015-02-10 16:04:46 +11:00
Nicholas Nethercote
6ee3666899 Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo.
--HG--
extra : rebase_source : 488e401ff87e31a2074c4108c4df0572d9536667
2015-02-09 14:34:50 -08:00
Andrew McCreight
8413cc973c Back out Bug 1127201 (part 2) for various problems. 2015-02-06 15:04:32 -08:00
Andrew McCreight
81c57c2add Back out Bug 1127201 (part 3) for various problems. 2015-02-06 15:04:00 -08:00
Andrew McCreight
58128548cf Bug 1125005 - Change the reentrance assertion in IncrementalFinalizeRunnable to a warning. r=smaug 2015-02-06 09:54:21 -08:00
Dhi Aurrahman
e0a3d64aa1 Bug 1125766 - Throw proper error types for TextEncoder(), TextDecoder() and TextDecoder.decode(). r=bz 2015-02-04 18:46:26 +07:00
Wes Kocher
e1292d67e5 Merge inbound to m-c a=merge CLOSED TREE 2015-02-05 16:55:01 -08:00
Dave Townsend
1590ebd9cf Bug 1083281: Use flags to determine which chrome and about URIs are loaded in the content process. r=mconley, r=bsmedberg, r=jduell, r=mratcliffe
--HG--
extra : rebase_source : beda0088e7715eeb41525b0123f308068745bd80
2015-02-05 08:09:15 -08:00
Nicholas Nethercote
1fcaf828a3 Bug 1127201 (part 3) - Remove the NS_ABORT_IF_FALSE macro. r=Waldo.
--HG--
extra : rebase_source : 7403ecb72a24be30b3871674b511894af9af1f3a
2015-02-04 20:07:09 -08:00
Nicholas Nethercote
3629781b69 Bug 1127201 (part 2) - Convert all NS_ABORT_IF_FALSE calls to MOZ_ASSERT. r=Waldo.
--HG--
extra : rebase_source : 99182e70335d2b5ff95f8c528ae992d37294be3a
2015-02-04 20:05:36 -08:00
Nicholas Nethercote
b0a555ead0 Bug 1050035 (part 5) - Make CCGraphBuilder::AddNode() infallible. r=mccr8.
--HG--
extra : rebase_source : 4ebe842e419f8b887b9e9b98f97c17fe103039bc
2015-02-02 23:58:42 -08:00
Nicholas Nethercote
c326200932 Bug 1050035 (part 4) - Make PL_DHashTableAdd() infallible by default, and add a fallible alternative. r=froydnj.
I kept all the existing PL_DHashTableAdd() calls fallible, in order to be
conservative, except for the ones in nsAtomTable.cpp which already were
followed immediately by an abort on failure.

--HG--
extra : rebase_source : eeba14d732077ef2e412f4caca852de6b6b85f55
2015-02-02 14:48:58 -08:00
Nicholas Nethercote
e2d6f1e1be Bug 1050035 (part 3) - Remove PL_NewDHashTable() and PL_DHashTableDestroy(). r=froydnj.
Because they are now just equivalent to |new PLDHashTable()| +
PL_DHashTableInit() and PL_DHashTableFinish(t) + |delete t|, respectively.

They're only used in a handful of places and obscure things more than they
clarify -- I only recently worked out exactly how they different from Init()
and Finish().

--HG--
extra : rebase_source : c958491447523becff3e01de45a5d2d227d1ecd3
2015-02-01 20:36:52 -08:00
Nicholas Nethercote
9735520732 Bug 1050035 (part 2) - Remove the fallible version of PL_DHashTableInit(). r=froydnj,mrbkap.
Because it's no longer needed now that entry storage isn't allocated there.
(The other possible causes of failures are much less interesting and simply
crashing is a reasonable thing to do for them.)

This also makes PL_DNewHashTable() infallible.

--HG--
extra : rebase_source : 848cc9bbdfe434525857183b8370d309f3acbf49
2015-02-01 20:19:08 -08:00
Nicholas Nethercote
e2a74d0deb Bug 1050035 (part 1) - Lazily allocate PLDHashTable::mEntryStore. r=froydnj.
This makes zero-element hash tables, which are common, smaller, and also avoids
unnecessary malloc/free pairs.

I did some measurements during some basic browsing of a few sites. I found that
35% of all live tables were empty with a few tabs open. And cumulatively, for
the whole session, 45% of tables never had an element added to them.

There is more to be done w.r.t. simplifying initialization, which will occur in
the next patch.

--HG--
extra : rebase_source : b9bfdcd680f39f3c947a49ae8462c04bc5e38805
2015-02-01 14:56:33 -08:00
Xidorn Quan
c087d73ac5 Bug 1127045 part 3 - Make nsTArray support reverse iterating. r=froydnj
--HG--
extra : source : 6cd8187de27872308575077e6b4ba4d6df1fc312
2015-02-04 19:07:32 +11:00
Xidorn Quan
a8d5780b14 Bug 1126552 part 1 - Make nsTArray support range-based for loops. r=froydnj
--HG--
extra : source : d8670bac983f9bc2b5886af2396d84ec9b4832a7
2015-02-04 19:07:32 +11:00
Xidorn Quan
fdcf9f2cbb Bug 1126552 part 0 - Rename end to iend to avoid shadowing warnings. r=froydnj
--HG--
extra : source : 7466982b362d61eda808c1ec848ecd45ef1c1c97
2015-02-04 19:07:32 +11:00
Nicholas Nethercote
16c3ece3df Bug 1127401 - Tweak PL_DHashTableSearch() to counter a Fennec regression. r=froydnj.
PL_DHashTableLookup() had the same return protocol as SearchTable(), which
meant that compilers could generate a tail call from the former to the latter.
Bug 1124973 replaced PL_DHashTableLookup() with PL_DHashTableSearch(), which
has a slightly different return protocol, and so the tail call was lost. This
appears to be the cause of the Fennec performance regression.

This patch splits SearchTable() in two (using templates to avoid explicit code
duplication). SearchTable<false>() now has the same return protocol as
PL_DHashTableSearch(), and so the tail call can now be used again.
2015-01-29 20:18:28 -08:00
Masatoshi Kimura
06e7f14f32 Bug 1128273 - Stop using |typedef enum class tag_nsresult { ... } nsresult;| trick. r=froydnj 2015-02-02 23:44:25 +09:00
Mike Hommey
824818ee98 Bug 1126593 - Add a global fallible instance, so that using fallible works directly, everywhere. r=njn
--HG--
rename : memory/mozalloc/fallible.h => memory/fallible/fallible.h
2015-02-02 09:56:13 +09:00
Masatoshi Kimura
7e11f87d71 Bug 1126269 - Part 3: Always use the C++11 enum class for nsresult. r=froydnj 2015-01-30 08:53:47 +09:00
Jim Mathies
803fb1d104 Bug 1095754 - Miscellaneous code cleanup nits found along the way. r=me 2015-01-29 13:41:57 -06:00
Daniel Holbert
f3eae59a87 Bug 1126808: Mark xpcom/build as FAIL_ON_WARNINGS. r=froydnj 2015-01-29 00:38:15 -08:00
Nicholas Nethercote
4dbdbf4389 Bug 1126546 - Make PLDHashTable::keyHash private. r=froydnj.
As well as renaming and privatizing |keyHash|, this patch also:

- renames GetKeyHash() to ComputeKeyHash(), which better indicates it's not
  some kind of getter function; and

- makes PLDHashEntryStub inherit from PLDHashEntryHdr, for consistency with
  everywhere else.
2015-01-28 21:33:38 -08:00
Daniel Holbert
25f3906c04 Bug 1126923: #undef HAVE_STDINT_H (provided by mozilla-config.h) before including vpx headers, since they redefine it. r=froydnj 2015-01-28 19:01:46 -08:00
Ben Kelly
d1ad878d99 Bug 1126985 Fix xpcom/base build with --enable-warnings-on-errors. r=froydnj 2015-01-28 15:11:18 -05:00
Daniel Holbert
1e14fbad55 Bug 1126790: Move MainThreadIOLoggerImpl into anonymous namespace (joining a type used in one of its fields), to fix gcc warning. r=froydnj 2015-01-28 09:40:28 -08:00
Nicholas Nethercote
7acda68310 Bug 1124973 (part 7) - Remove PL_DHashTableLookup. r=froydnj.
This patch:

- Removes PL_DHashTableLookup().

- Removes PL_DHASH_ENTRY_IS_BUSY(). It's barely used and
  PL_DHASH_ENTRY_IS_FREE() suffices.

- Removes a non-useful, non-sequitur comment ("However, use...").

--HG--
extra : rebase_source : 8ee03b52f78e726515902d59af633f9ad015affa
2015-01-26 16:02:05 -08:00
Nicholas Nethercote
70b1eacc9e Bug 1124973 (part 2) - Introduce PL_DHashTableSearch(), and replace most PL_DHashTableLookup() calls with it. r=froydnj.
It feels safer to use a function with a new name, rather than just changing the
behaviour of the existing function.

For most of these cases the PL_DHashTableLookup() result was checked with
PL_DHASH_ENTRY_IS_{FREE,BUSY} so the conversion was easy. A few of them
preceded that check with a useless null check, but the intent of these was
still easy to determine.

I'll do the trickier ones in subsequent patches.

--HG--
extra : rebase_source : ab37a7a30be563861ded8631771181aacf054fd4
2015-01-22 21:06:55 -08:00
Nicholas Nethercote
8f48f04d55 Bug 1124973 (part 1) - Always use inheritance rather than composition for PLDHashTable entries. r=froydnj.
Because (a) this is how it's usually done, (b) it allows static_cast<> instead
of reinterpret_cast<>, and (c) it will make subsequent patches easier.

--HG--
extra : rebase_source : 76e67d4b6ec0e5dc898a8214b6a6b562f9e08380
2015-01-22 21:05:52 -08:00
Xidorn Quan
bc465894bd Bug 1124029 - Fix 64bit shift warning in nsVoidArray. r=froydnj
--HG--
extra : source : dba319233ef2df517d3ba37b4406357fb007dec7
extra : histedit_source : 4ad36db364b75ceb3566ef2f48507ad314d2e238
2015-01-28 08:55:44 +11:00
Ehsan Akhgari
9dd095c383 Bug 1126301 - Move TestUTF.cpp to gtest and enable it; r=froydnj
--HG--
rename : xpcom/tests/TestUTF.cpp => xpcom/tests/gtest/TestUTF.cpp
rename : xpcom/tests/UTFStrings.h => xpcom/tests/gtest/UTFStrings.h
extra : rebase_source : 6c08b56d9cdb2af10a436792de7bee03d8c41070
2015-01-27 12:38:44 -05:00
Ehsan Akhgari
8f3258d121 Backed out changeset 186127d71076 (bug 1126295) because of test bustage on Windows on a CLOSED TREE
--HG--
rename : xpcom/tests/gtest/TestAtoms.cpp => xpcom/tests/TestAtoms.cpp
rename : xpcom/tests/gtest/UTFStrings.h => xpcom/tests/UTFStrings.h
2015-01-27 13:47:44 -05:00
Ehsan Akhgari
a77c062b13 Backed out 2 changesets (bug 1126301) on a CLOSED TREE because the test was apparently busted on some platforms
Backed out changeset 4aecd46afeb1 (bug 1126301)
Backed out changeset c61a87a20888 (bug 1126301)

--HG--
rename : xpcom/tests/gtest/TestUTF.cpp => xpcom/tests/TestUTF.cpp
2015-01-27 13:44:15 -05:00
Ehsan Akhgari
80ca6ab60f Bug 1126301 follow-up: Fix a signed/unsigned comparison fatal warning, landed on a CLOSED TREE 2015-01-27 12:56:15 -05:00
Daniel Holbert
7dec9ee7ed Bug 1125632 followup: Mark remaining CollectReports impls in nsMemoryReporterManager.cpp and SystemMemoryReporter.cpp as MOZ_OVERRIDE. 2015-01-27 09:48:54 -08:00
Ehsan Akhgari
08b9e945de Bug 1126301 - Move TestUTF.cpp to gtest and enable it; r=froydnj
--HG--
rename : xpcom/tests/TestUTF.cpp => xpcom/tests/gtest/TestUTF.cpp
extra : rebase_source : db5e0418f89bb1cf71a0543a48a6a063f61e4033
2015-01-27 12:38:44 -05:00
Ehsan Akhgari
56732537bb Bug 1126295 - Move TestAtoms.cpp to gtest and enable it; r=froydnj
--HG--
rename : xpcom/tests/TestAtoms.cpp => xpcom/tests/gtest/TestAtoms.cpp
rename : xpcom/tests/UTFStrings.h => xpcom/tests/gtest/UTFStrings.h
extra : rebase_source : 16340d826f39339dd38e77810cd08e59b324c380
2015-01-27 09:28:45 -05:00
Nicholas Nethercote
5d97332734 Bug 1124920 - Remove PLDHashTable::Operate(). r=froydnj.
--HG--
extra : rebase_source : f029d3ca8835232b3c1d4188aa63a0004c1aad4b
2015-01-22 15:43:18 -08:00
Ehsan Akhgari
f280039197 Bug 1125138 - Move TestTimeStamp.cpp to gtest and enable it; r=froydnj
--HG--
rename : xpcom/tests/TestTimeStamp.cpp => xpcom/tests/gtest/TestTimeStamp.cpp
extra : rebase_source : d6f92fb8be26504164a1b54bd40811f6f1c3cc3a
extra : source : 67496f44f4617eda8f650d5c801fd9b327e5ac96
2015-01-26 17:08:24 -05:00
Chris Peterson
b7db4eb02d Bug 1125665 - Fix -Wunused-private-field warning in PLDHashTable and mark xpcom/glue as FAIL_ON_WARNINGS. r=froydnj 2015-01-25 00:25:13 -08:00
Chris Peterson
d7fbc67c12 Bug 1125693 - Fix -Wformat warning in xpcom/base/nsStackWalk.cpp and mark as FAIL_ON_WARNINGS. r=njn 2015-01-25 13:49:06 -08:00
Ehsan Akhgari
96d30963f7 Bug 1125559 - Move TestThreadPool.cpp to gtest and enable it; r=froydnj
--HG--
rename : xpcom/tests/TestThreadPool.cpp => xpcom/tests/gtest/TestThreadPool.cpp
extra : amend_source : 9d779a219338a8cbf854af28070ddc5559d28d2b
extra : histedit_source : 59dd08d1722b1fe621f3d5070b64d791012fa026%2C5231f875b1e958f393079ac9258a2d3812a1feb1
2015-01-26 20:49:22 -05:00
Wes Kocher
8b2ad24204 Backed out changeset 67496f44f461 (bug 1125138) for checktest failures
--HG--
rename : xpcom/tests/gtest/TestTimeStamp.cpp => xpcom/tests/TestTimeStamp.cpp
2015-01-26 16:14:06 -08:00
Wes Kocher
1663d3dfd8 Backed out changeset 8ae4f78d7e25 (bug 1125559) for checktest orange
--HG--
rename : xpcom/tests/gtest/TestThreadPool.cpp => xpcom/tests/TestThreadPool.cpp
2015-01-26 15:18:50 -08:00
Ehsan Akhgari
927a9f0a87 Bug 1125559 - Move TestThreadPool.cpp to gtest and enable it; r=froydnj
--HG--
rename : xpcom/tests/TestThreadPool.cpp => xpcom/tests/gtest/TestThreadPool.cpp
extra : amend_source : 08b95083290e67062ebaecff820ff627f87b35a2
2015-01-26 17:10:09 -05:00