Граф коммитов

2279 Коммитов

Автор SHA1 Сообщение Дата
Ryan VanderMeulen faaac1a61d Backed out changeset 37bee149c935 (bug 968520) for checktest failures. 2015-06-30 15:47:18 -04:00
Birunthan Mohanathas ebd21e20f1 Bug 968520 - Add nsTArray::Assign. r=froydnj 2015-06-30 11:16:03 -07:00
Nicholas Nethercote 459a5b589b Bug 1176163 - Remove remaining uses of PL_DHashTableEnumerate() from xpcom/. r=froydnj.
--HG--
extra : rebase_source : 5e79d10647c138a28370d36d28a1c1227af8167b
2015-06-18 18:09:37 -07:00
Benoit Girard 8d6a67f6d3 Bug 1172216 - Move nsStackwalk to mozglue. r=glandium
--HG--
rename : xpcom/base/nsStackWalk.cpp => mozglue/misc/StackWalk.cpp
rename : xpcom/base/nsStackWalk.h => mozglue/misc/StackWalk.h
extra : commitid : EMbWGfjKvdq
extra : rebase_source : b7308eb569cc1a019d3b7a92aaff0de7a49b5682
2015-06-10 16:32:45 -04:00
Nicholas Nethercote 0d28f19c4a Bug 1173600 (part 3) - Add PLDHashTable::RemovingIterator. r=froydnj.
--HG--
extra : rebase_source : 1158e03a699987e366b46b9e045613f6b9fe1a59
2015-06-10 17:04:07 -07:00
Nicholas Nethercote fb490785c1 Bug 1173600 (part 2) - Move post-enumeration shrinking code into its own function. r=froydnj.
This will allow it to be re-used by the removing iterator class.

--HG--
extra : rebase_source : 2bdd33427894c291aa507469628a3ba99b80c568
2015-06-10 16:36:02 -07:00
Nicholas Nethercote e8172cd960 Bug 1173600 (part 1) - Tweak PLDHashTable post-enumeration shrinking. r=froydnj.
This patch factors out the existing capacity calculation code in HashShift()
into a new function called BestCapacity(), and then reuses it for
post-enumeration shrinking.

BestCapacity() computes capacity with |CeilingLog2(ceil(length * 4 / 3))|,
which ensures a minimum capacity while respecting the "max 75% full" and
"capacity is a power of two" constraints. In contrast, the old post-enumeration
shrink calculation was |CeilingLog2(length + length/2)|, which gives higher
results in some cases. (Both calculations also ensured the capacity wasn't too
small.) E.g. if length is 48, the former calculation will give 64, while the
latter will give 128.

Therefore, post-enumeration shrinking will no longer give a
larger-than-necessary capacity some cases. This feels like the right thing to
do in isolation, and making it consistent with HashShift() -- used during table
construction -- is also good.

--HG--
extra : rebase_source : 55e982b601c345d10da7abd03a13aec3f5b61598
2015-06-10 13:54:06 -07:00
Nicholas Nethercote e94846adea Bug 11746250 (follow-up) - Fix link errors on Linux and Android. r=me. 2015-06-16 23:48:53 -07:00
Nicholas Nethercote a1b715b5df Bug 1174625 - Overhaul PLDHashTable's iterator. r=froydnj.
This change splits PLDHashTable::Iterator::NextEntry() into two separate
functions, which allow you to get the current element and advance the iterator
separately, which means you can use a for-loop to iterate instead of a
while-loop.

As part of this change, the internals of PLDHashTable::Iterator were
significantly changed and simplified (and modelled after js::HashTable's
equivalent code). It's no longer duplicating code from PL_DHashTableEnumerator.
The chaos mode code was a casualty of this, but given how unreliable that code
has proven to be (see bug 1173212, bug 1174046) this is for the best. (We can
reimplement chaos mode once PLDHashTable::Iterator is back on more solid
footing again, if we think it's important.)

All these changes will make it much easier to add an alternative Iterator that
removes elements, which was turning out to be difficult with the prior code.

In order to make the for-loop header usually fit on a single line, I
deliberately renamed a bunch of things to have shorter names.

In summary, you used to write this:

  PLDHashTable::Iterator iter(&table);
  while (iter.HasMoreEntries()) {
    auto entry = static_cast<FooEntry*>(iter.NextEntry());
    // ... do stuff with |entry| ...
  }
  // iter's scope extends beyond here

and now you write this:

  for (auto iter = table.Iter(); !iter.Done(); iter.Next()) {
    auto entry = static_cast<FooEntry*>(iter.Get());
    // ... do stuff with |entry| ...
  }
  // iter's scope doesn't reach here

--HG--
extra : rebase_source : fa5cac2fc50b1ab7624030bced4763131280f4d8
2015-06-11 21:19:53 -07:00
Ted Mielczarek e334ff0faa bug 1171574 - XPCOMGlue doesn't need LEADING_UNDERSCORE for iOS. r=froydnj
--HG--
extra : commitid : LBrmqR9ER7F
extra : rebase_source : 4eae25899a0a82b1e09be04570fab7927ca0354a
2015-02-10 15:36:37 -05:00
Nicholas Nethercote d2a5b36906 Bug 1174046 - Fix PLDHashTable::Iterator in chaos mode again. r=froydnj.
If you use PLDHashTable::Iterator in chaos mode with a table with zero
capacity, a |% 0| operation takes place in randomUint32LessThan. This change
avoids that.

--HG--
extra : rebase_source : 85f2affb57c2402f40f3d117434b8300e7f204b7
2015-06-11 18:23:26 -07:00
Nicholas Nethercote ea80354c08 Bug 1172782 - Change how nsTHashtable::Clear() works. r=froydnj.
This change reimplements nsTHashtable::Clear() using PLDHashable::Clear(). This
changes its semantics slightly -- the old version would clear the table but
leave its capacity unchanged. The new version will adjust the capacity
to the default, though the entry storage will only be re-allocated when the
first new element is added.
2015-06-10 13:07:40 -07:00
Birunthan Mohanathas 3aad780da9 Bug 968520 - Always require fallible argument with FallibleTArray calls. r=froydnj 2015-06-10 14:30:41 -07:00
Nicholas Nethercote b9657718d7 Bug 1173212 (part 2) - Make PLDHashTable::Iterator work in chaos mode. r=froydnj.
Iterator::NextEntry() miscomputes |entryLimit|. This doesn't matter in
non-chaos mode because we'll always find a live entry before hitting that
limit. But it does matter in chaos mode because it means we don't wrap around
when we should.

It's clear how this mistake was made -- the code from Enumerate() was copied.
In Enumerate() |mEntryStore| and |entryAddr| are the same when |entryLimit| is
computed, so you can use them interchangeably. But in NextEntry() |mEntryAddr|
will have moved past |mEntryStore|, so you have to use |mEntryStore|. I changed
both functions in the same way to keep the correspondence between them obvious.

--HG--
extra : rebase_source : f27558b3179be394526d1c3f82ffbae0fb58b2b9
2015-06-10 12:47:18 -07:00
Nicholas Nethercote 9d20c7e3aa Bug 1173212 (part 1) - Remove some can't-fail tests in PLDHashTable. r=froydnj.
--HG--
extra : rebase_source : 2d1c0111bf8bd13b76fe4e88da92ba367e6482d9
2015-06-10 12:47:18 -07:00
Eric Rahm a95516e580 Bug 1171716 - Part 1: Add NS_ReleaseOnMainThread. r=froydnj 2015-06-10 08:33:27 -07:00
Wes Kocher 54bccdc15f Backed out 5 changesets (bug 1171716) for android bustage
Backed out changeset 4986f8464f9c (bug 1171716)
Backed out changeset bc8405b07d10 (bug 1171716)
Backed out changeset 10e18e494630 (bug 1171716)
Backed out changeset be499a3cae5d (bug 1171716)
Backed out changeset f75717d3eba0 (bug 1171716)
2015-06-09 18:48:37 -07:00
Eric Rahm 008f4df152 Bug 1171716 - Part 1: Add NS_ReleaseOnMainThread. r=froydnj 2015-06-09 18:25:43 -07:00
Birunthan Mohanathas 2db38a1d84 Bug 968520 - Add more fallible variants of nsTArray::InsertElementsAt. r=froydnj 2015-06-09 17:27:31 -07:00
Birunthan Mohanathas 5cce2e644c Bug 968520 - Add fallible variants of nsTArray::InsertElementSorted. r=froydnj 2015-06-08 13:39:57 -07:00
Birunthan Mohanathas c864230df7 Bug 968520 - Make nsTArray::InsertElementSorted support moves. r=froydnj 2015-06-08 13:39:53 -07:00
Birunthan Mohanathas 53c8a09de0 Bug 968520 - Add mozilla::fallible to FallibleArray calls in tests. r=froydnj 2015-06-08 13:39:49 -07:00
Nicholas Nethercote b4d714b84f Bug 1171323 - Remove PL_DHashFreeStringKey(), because it's dead. r=froydnj.
--HG--
extra : rebase_source : 1c0d5a858e6deab28c9118f8d2c6dea6a867dd81
2015-06-04 16:14:37 -07:00
Nicholas Nethercote 2fba2d028e Bug 1170934 (part 2) - Fix the comment for PL_DHashTableRemove(). r=froydnj.
--HG--
extra : rebase_source : 85258e2402a9f0b8fbeefd76c4e405cfb8eb887f
2015-06-03 17:05:12 -07:00
Nicholas Nethercote cc64c96ae6 Bug 1170934 (part 1) - Remove PLDHashTable::{Init,Fini}(). r=froydnj.
--HG--
extra : rebase_source : 1d1ac910420fbc12c7e2501c74680cce00387c63
2015-05-20 21:25:55 -07:00
Eric Rahm 518166f0c8 Bug 1165515 - Part 14: Undef PR_LOG macros when using mozilla/Logging.h. r=froydnj
Make it harder for users to accidentally reintroduce usage of the PR_LOG macros
when using 'mozilla/Logging.h'. This can still be worked around by directly
including 'prlog.h' (and not 'mozilla/Logging.h') if absolutely necessary.
2015-06-03 15:26:07 -07:00
Eric Rahm 6c63bbb91a Bug 1165515 - Part 13-1: Add log level enum class. r=froydnj
This adds the mozilla::LogLevel enum class. Additionaly a log_test function is
added to use rather than a macro, this allows us to enforce only
mozilla::LogLevel is passed into the function.
2015-06-03 15:22:39 -07:00
Eric Rahm a21afeb115 Bug 1165515 - Part 6: Add PR_LOG_VERBOSE. r=froydnj 2015-06-03 15:22:31 -07:00
Eric Rahm b4a01ca56b Bug 1165515 - Part 4: Add PR_LOG_INFO. r=froydnj
This is an interstitial step in preparation for adding a new info level. For
now it just maps to debug.
2015-06-03 15:22:29 -07:00
Eric Rahm 1b710d4396 Bug 1165515 - Part 2: Add MOZ_LOG_TEST. r=froydnj 2015-06-03 15:22:26 -07:00
Ryan VanderMeulen 8e70b92b80 Backed out changeset c1cd7aff7c94 (bug 1163320) for causing silent Hazard build bustage.
--HG--
extra : rebase_source : 34f9d17d9c9c3b2bfd5bd8d4be48a05acc0c5908
2015-06-03 12:46:19 -04:00
Nicholas Nethercote 383a496bf6 Bug 1170416 (part 5) - Remove PLDHashTable::IsInitialized(). r=froydnj.
|mOps| is always non-null now, and there's no longer any distinction between
and uninitialized and initialized table. Yay.

--HG--
extra : rebase_source : 3d1fb72aee4dd21ff20db0ff3166d4e932ade897
2015-05-20 21:23:55 -07:00
Nicholas Nethercote 686f24db33 Bug 1170416 (part 4) - Remove some unnecessary casts. r=froydnj.
--HG--
extra : rebase_source : aa90639cb8fb0cbc0fcae0ec9a0388f7e3cf628f
2015-05-20 21:16:59 -07:00
Nicholas Nethercote e849e6588b Bug 1170416 (part 3) - Remove the PLDHashTable2 typedef. r=froydnj.
--HG--
extra : rebase_source : 9510ea47204fffa163cac43aeaaac6ae1ad80419
2015-05-19 16:46:17 -07:00
Nicholas Nethercote 5ea7821921 Bug 1170416 (part 2) - Merge PLDHashTable2 back into PLDHashTable. r=froydnj.
--HG--
extra : rebase_source : 001115f48ce363db098f66457994cc6a3785a156
2015-06-02 01:58:58 -07:00
Nicholas Nethercote 54766ec371 Bug 1170416 (part 1) - Remove PL_DHashTable{Init,Finish,Destroy){} and PL_NewDHashTable(). r=froydnj.
--HG--
extra : rebase_source : 8263b1fecd550ba6356f99537cdaf439c24680ae
2015-05-18 23:02:05 -07:00
Terrence Cole 760b29c216 Bug 1169791 - Strongly type NoteJSRoot; r=mccr8
--HG--
extra : rebase_source : 44b4b6ecb67677caf3180b353fc828c972d4e1f9
2015-05-29 12:57:23 -07:00
Carsten "Tomcat" Book 5471309381 Backed out 14 changesets (bug 1165515) for linux x64 e10s m2 test failures
Backed out changeset d68dcf2ef372 (bug 1165515)
Backed out changeset 7c3b45a47811 (bug 1165515)
Backed out changeset b668b617bef2 (bug 1165515)
Backed out changeset d0916e1283a2 (bug 1165515)
Backed out changeset ac4dc7489942 (bug 1165515)
Backed out changeset e9632ce8bc65 (bug 1165515)
Backed out changeset c16d215cc7e4 (bug 1165515)
Backed out changeset e4d474f3c51a (bug 1165515)
Backed out changeset d87680bf9f7c (bug 1165515)
Backed out changeset b3c0a45ba99e (bug 1165515)
Backed out changeset 9370fa197674 (bug 1165515)
Backed out changeset 50970d668ca1 (bug 1165515)
Backed out changeset ffa4eb6d24b9 (bug 1165515)
Backed out changeset 5fcf1203cc1d (bug 1165515)

--HG--
extra : rebase_source : 6fb850d063cbabe738f97f0380302153e3eae97a
2015-06-02 13:05:56 +02:00
Eric Rahm 38901afce4 Bug 1165515 - Part 14: Undef PR_LOG macros when using mozilla/Logging.h. r=froydnj
Make it harder for users to accidentally reintroduce usage of the PR_LOG macros
when using 'mozilla/Logging.h'. This can still be worked around by directly
including 'prlog.h' (and not 'mozilla/Logging.h') if absolutely necessary.
2015-06-01 22:17:34 -07:00
Eric Rahm 9bc793760d Bug 1165515 - Part 13-1: Add log level enum class. r=froydnj
This adds the mozilla::LogLevel enum class. Additionaly a log_test function is
added to use rather than a macro, this allows us to enforce only
mozilla::LogLevel is passed into the function.
2015-06-01 22:17:31 -07:00
Eric Rahm 5e397ff4b7 Bug 1165515 - Part 6: Add PR_LOG_VERBOSE. r=froydnj 2015-06-01 22:17:22 -07:00
Eric Rahm 8289861381 Bug 1165515 - Part 4: Add PR_LOG_INFO. r=froydnj
This is an interstitial step in preparation for adding a new info level. For
now it just maps to debug.
2015-06-01 22:17:20 -07:00
Eric Rahm ef4c50584c Bug 1165515 - Part 2: Add MOZ_LOG_TEST. r=froydnj 2015-06-01 22:17:17 -07:00
Wes Kocher 4e9f80ed2e Backed out 14 changesets (bug 1165515) for b2g mochitest-6 permafail CLOSED TREE
Backed out changeset 9b97e2aa2ed9 (bug 1165515)
Backed out changeset 150606c022a2 (bug 1165515)
Backed out changeset 4e875a488349 (bug 1165515)
Backed out changeset 467e7feeb546 (bug 1165515)
Backed out changeset d6b6cc373197 (bug 1165515)
Backed out changeset 0615265b593c (bug 1165515)
Backed out changeset fafd1dce9f08 (bug 1165515)
Backed out changeset d1df869245f9 (bug 1165515)
Backed out changeset 6876a7c63611 (bug 1165515)
Backed out changeset b7841c94a9a3 (bug 1165515)
Backed out changeset e5e3617f7c73 (bug 1165515)
Backed out changeset 39be3db95978 (bug 1165515)
Backed out changeset 0ec74176f8de (bug 1165515)
Backed out changeset 5b928dd10d71 (bug 1165515)
2015-06-01 17:57:58 -07:00
Eric Rahm e8a5eb8d6e Bug 1165515 - Part 14: Undef PR_LOG macros when using mozilla/Logging.h. r=froydnj
Make it harder for users to accidentally reintroduce usage of the PR_LOG macros
when using 'mozilla/Logging.h'. This can still be worked around by directly
including 'prlog.h' (and not 'mozilla/Logging.h') if absolutely necessary.
2015-06-01 14:31:01 -07:00
Eric Rahm 7fe9ffc48b Bug 1165515 - Part 13-1: Add log level enum class. r=froydnj
This adds the mozilla::LogLevel enum class. Additionaly a log_test function is
added to use rather than a macro, this allows us to enforce only
mozilla::LogLevel is passed into the function.
2015-06-01 14:31:01 -07:00
Eric Rahm 033d62915a Bug 1165515 - Part 6: Add PR_LOG_VERBOSE. r=froydnj 2015-06-01 14:31:00 -07:00
Eric Rahm a703d6cf7e Bug 1165515 - Part 4: Add PR_LOG_INFO. r=froydnj
This is an interstitial step in preparation for adding a new info level. For
now it just maps to debug.
2015-06-01 14:31:00 -07:00
Eric Rahm f3d3953559 Bug 1165515 - Part 2: Add MOZ_LOG_TEST. r=froydnj 2015-06-01 14:30:59 -07:00
Botond Ballo a1ee749697 Bug 1163320 - Variadic implementation of nsRunnableMethodArguments. r=froydnj
--HG--
extra : source : ed761807105b30069d5a7412f8dacf75429eeeb6
2015-05-11 17:24:21 -04:00