Commit Graph

16225 Commits

Author SHA1 Message Date
L. David Baron
07c2f2dc49 Bug 1352889 - Ensure that PLDHashTable's second hash doesn't have padding with 0 bits for tables with capacity larger than 2^16. r=njn
PLDHashTable takes the result of the hash function and multiplies it by
kGoldenRatio to ensure that it has a good distribution of bits across
the 32-bit hash value, and then zeroes out the low bit so that it can be
used for the collision flag.  This result is called hash0.  From hash0
it computes two different numbers used to find entries in the table
storage:  hash1 is used to find an initial position in the table to
begin searching for an entry; hash2 is then used to repeatedly offset
that position (mod the size of the table) to build a chain of positions
to search.

In a table with capacity 2^c entries, hash1 is simply the upper c bits
of hash0.  This patch does not change this.

Prior to this patch, hash2 was the c bits below hash1, padded at the low
end with zeroes when c > 16.  (Note that bug 927705, changeset
1a02bec165e16f370cace3da21bb2b377a0a7242, increased the maximum capacity
from 2^23 to 2^26 since 2^23 was sometimes insufficient!)  This manner
of computing hash2 is problematic because it increases the risk of long
chains for very large tables, since there is less variation in the hash2
result due to the zero padding.

So this patch changes the hash2 computation by using the low bits of
hash0 instead of shifting it around, thus avoiding 0 bits in parts of
the hash2 value that are significant.

Note that this changes what hash2 is in all cases except when the table
capacity is exactly 2^16, so it does change our hashing characteristics.
For tables with capacity less than 2^16, it should be using a different
second hash, but with the same amount of random-ish data.  For tables
with capacity greater than 2^16, it should be using more random-ish
data.

Note that this patch depends on the patch for bug 1353458 in order to
avoid causing test failures.

MozReview-Commit-ID: JvnxAMBY711

--HG--
extra : transplant_source : 2%D2%C2%CE%E1%92%C8%F8H%D7%15%A4%86%5B%3Ac%0B%08%3DA
2017-05-31 13:44:02 -07:00
L. David Baron
f22aab91c2 Bug 1352888 - Don't set the collision flag when adding to PLDHashTable if we've already found the entry we're going to add. r=njn
PLDHashTable's entry store has two types of unoccupied entries:  free
entries and removed entries.  The search of a chain of entries
(determined by the hash value) in the entry store to search for an entry
can stop at free entries, but it continues across removed entries,
because removed entries are entries that may have been skipped over when
we were adding the value we're searching for to the hash, but have since
been removed.  For live entries, we also maintain this distinction by
using one bit of storage for a collision flag, which notes that if the
hashtable entry is removed, its place in the entry store must become a
removed entry rather than a free entry.

When we add a new entry to the table, Add's semantics require that we
return an existing entry if there is one, and only create a new entry if
no existing entry exists.  (Bug 1352198 suggests the possibility of a
faster alternative Add API where the caller guarantees that the key is
not already in the hashtable.)  When we search for the existing entry,
we must thus continue the search across removed entries, even though we
record the first removed entry found to return if the search for an
existing entry fails.

The existing code adds the collision flag through the entire table
search during an Add.  This patch changes that behavior so that we only
add the collision flag prior to finding the first removed entry.  Adding
it after we find the first removed entry is unnecessary, since we are
not making that entry part of a path to a new entry.  If it is part of a
path to an existing entry, it will already have the collision flag set.

This patch effectively puts an if (!firstRemoved) around the else branch
of the if (MOZ_UNLIKELY(EntryIsRemoved(entry))), and then refactors that
condition outwards since it is now around the contents of both the if
and else branches.

MozReview-Commit-ID: CsXnMYttHVy

--HG--
extra : transplant_source : %80%9E%83%EC%CCY%B4%B0%86%86%18%99%B6U%21o%5D%29%AD%04
2017-05-31 13:44:02 -07:00
Ryan VanderMeulen
b9fe830aa0 Merge inbound to m-c. a=merge
CLOSED TREE
2017-05-31 14:32:55 -04:00
Bevis Tseng
024ff96b5b Bug 1363318 - Part 2: Label FetchBody. r=baku 2017-05-16 18:12:24 +08:00
Carl Corcoran
3ec4012254 Bug 1367899: Add handling for call reg opcode; r=dmajor
MozReview-Commit-ID: 2ncXsGf2H95

--HG--
extra : rebase_source : 70419541bf28844af4ce6348e343691d073556c3
2017-05-25 19:39:43 +02:00
Carl Corcoran
f203b4e69b Bug 1367899: Add handling for test r/m32, r32 and jne rel8 opcodes; r=dmajor
MozReview-Commit-ID: 3Cnx5tYrqMT

--HG--
extra : rebase_source : 723d961913e8d2788dcf3ce9b18aa6dffee4e963
2017-05-26 01:56:07 +02:00
Carsten "Tomcat" Book
b318c7dca7 merge mozilla-inbound to mozilla-central + UPGRADE_NSS_RELEASE a=merge
--HG--
rename : toolkit/components/extensions/test/xpcshell/xpcshell.ini => toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
extra : amend_source : 458fd54fe8070ca3034ac441267ff7025adb5251
2017-05-30 11:37:46 +02:00
Ehsan Akhgari
632ef747e7 Bug 1368286 - Take the idle queue into account in nsThread::HasPendingEvents(); r=smaug 2017-05-29 14:34:34 -04:00
Olli Pettay
5e7b0d0105 Bug 1368358 - ThrottledEventQueue::Inner::IsOnCurrentThread should work similarly to other IsOnCurrentThread implementations, r=bkelly
--HG--
extra : rebase_source : 976c25959938bb6572c95ff6120552b9ebad65d7
2017-05-29 17:04:36 +03:00
JW Wang
80a1b6063a Bug 1367674. P2 - remove unused code. r=gerald
MozReview-Commit-ID: 5OHWP5rpiff

--HG--
extra : rebase_source : 723d07adf131912a73b81738b0b43e9d67673c6c
2017-05-25 15:42:35 +08:00
JW Wang
6f82ddffdf Bug 1367674. P1 - add templates to deal with CV and argument number correctly. r=gerald
MozReview-Commit-ID: 5qeSBDny6uc

--HG--
extra : rebase_source : 92530c9efd7cdaaf50fba56d423532546059f37e
2017-05-25 15:41:01 +08:00
Manish Goregaokar
e104a8487b Bug 1367619 - Use RWLock when accessing font prefs service off main thread; r=heycam
MozReview-Commit-ID: Dxdq6Etbwxa

--HG--
extra : rebase_source : ec9f847c7dce6a101db6a3d157395f5b73d87ba1
2017-05-25 15:04:13 -07:00
Ryan VanderMeulen
25cb66b774 Merge m-c to autoland on a CLOSED TREE. a=merge 2017-05-26 15:45:41 -04:00
Milan Sreckovic
831111d1d7 Bug 1361724: Remove unused offset parameter from StripChar, StripChars, StripTaggedASCII, StripCRLF. r=froydnj
MozReview-Commit-ID: 3MV5TFMxGjn

--HG--
extra : rebase_source : de7ee1fd36e1b18427c67d9ac6e98f50f780a498
2017-05-17 13:49:52 -04:00
Olli Pettay
2c06db876d Bug 1311425, review comment fix to ensure low priority timers aren't taken into account when calling NS_GetTimerDeadlineHintOnCurrentThread, r=smaug 2017-05-26 09:13:39 -04:00
Olli Pettay
d9d7f6e11e Bug 1311425 - gtests for NS_GetTimerDeadlineHintOnCurrentThread, r=ehsan
--HG--
extra : rebase_source : 3c0164dac2d12705838fc6663bc8f824f17bbbea
2017-05-25 21:20:00 -04:00
Andreas Farre
1cf93d7962 Bug 1311425 - Avoid expiration timers when scheduling idle runnables, r=froydnj
--HG--
extra : rebase_source : b20edf82a69a24965b4bb6300ff9b1be39ad7b8a
2017-05-24 21:17:06 -04:00
Andreas Farre
892408079a Bug 1311425 - Add pref for how far into the timer queue, r=smaug,f=froydnj
--HG--
extra : rebase_source : 170404bed646efffa71f1e5b0970ec69f6dc4ce5
2017-05-24 21:14:29 -04:00
Andreas Farre
8e2322bcce Bug 1311425 - Make idle callbacks aware of nsITimers, r=froydnj
--HG--
extra : rebase_source : 3baa3054c1ca08783fd0d04dab91d3f97d2e65f1
2017-05-24 21:12:55 -04:00
Andreas Farre
0833711613 Bug 1311425 - Prepare for handling several sources of idleness, r=smaug
--HG--
extra : rebase_source : 7f771167ae460a50715f23c587eea10d5fe7e815
2017-05-24 21:11:12 -04:00
Carsten "Tomcat" Book
e92dffa1b6 merge mozilla-inbound to mozilla-central a=merge 2017-05-26 11:06:11 +02:00
Nicholas Nethercote
0840bb61c6 Bug 1366650 (part 1) - Move PseudoStack into SpiderMonkey. r=mstange,shu.
This includes renaming its fields to match SpiderMonkey naming conventions
instead of Gecko naming conventions.

This patch is just about moving the code. The next patch will change
SpiderMonkey to actually use PseudoStack directly.

--HG--
extra : rebase_source : 27e77ddf950201eb6bdba60003218056442cf7ab
2017-05-26 09:37:28 +10:00
Carl Corcoran
42a16ea02c Bug 1343149: Add handling for movups opcode; r=dmajor
MozReview-Commit-ID: 3fDrr2FkfD

--HG--
extra : rebase_source : 09b094868e0c6d754abf8e92b696699c70976382
2017-05-25 22:52:16 +02:00
Kan-Ru Chen
c54925d495 Bug 1365827 - Make MozPromise::Private::{Resolve,Reject} no-op when it's not pending. r=jwwang
MozReview-Commit-ID: 5HbUS9yA29K

--HG--
extra : rebase_source : ffbf53148e486757e5b36bdc0510bacce424a5e5
2017-05-24 13:46:19 -04:00
Gabriele Svelto
69f2bbaf90 Bug 1366711 - Make it possible to hide applications launched with nsIProcess; r=bsmedberg
MozReview-Commit-ID: K3vadzPg8SR

--HG--
extra : rebase_source : 9803bdca46c7dceb9bae0eefa4972369c7b36202
2017-05-22 10:23:00 +02:00
Samael Wang
ecbe18e933 Bug 1363036 - Part 1: Remove MOZ_DIAGNOSTIC_ASSERTs previously added for bug hunting. r=smaug
MozReview-Commit-ID: BAkuRlHtMcP

--HG--
extra : rebase_source : 5e708d0dacec9a673851d689d1f5274a0f1b69aa
2017-05-22 11:25:54 +08:00
Sebastian Hengst
011ef9ea3e merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 2iKvbnEUJsY
2017-05-25 10:32:22 +02:00
Ryan VanderMeulen
ce2fe4e709 Merge m-c to autoland. a=merge 2017-05-24 20:48:16 -04:00
Olli Pettay
67c78feadf Bug 1358476, add support for timeout when doing idle dispatch, tests, p=farre,smaug, r=nfroyd
--HG--
extra : rebase_source : 054bb7a4b7fdb41f255199bdc60a210149957292
2017-05-24 15:36:49 -04:00
Olli Pettay
bc787a0ec7 Bug 1358476, add support for timeout when doing idle dispatch, p=farre,smaug, r=nfroyd
--HG--
extra : rebase_source : 8561bd1e1aad04be8b9d3efa7b43d4833a4703bf
2017-05-24 17:34:50 -04:00
Andrew McCreight
e437a7e4e5 Bug 1367496 - Add more release asserts to the cycle collector. r=smaug
A previous bug missed a few places where we could theoretically
reenter the CC.

MozReview-Commit-ID: I0otlAEwyZa

--HG--
extra : rebase_source : 064b127a2c28a52b2807cd78031de9af4f258f60
2017-05-24 10:13:02 -07:00
L. David Baron
f2c24eea94 Backed out changeset e4ac2148c920 (bug 1352888) to see if it is responsible for input latency regression bug 1362094.
--HG--
extra : rebase_source : bfb451e911058496c2a6498d658cb6ab777da8e6
2017-05-24 11:42:19 -04:00
L. David Baron
34315c4eee Backed out changeset 52fff3b1e209 (bug 1352889) to see if it is responsible for input latency regressions in bug 1365334 or bug 1366156.
--HG--
extra : rebase_source : 387401d1417a29c19e5dbc1ee7413d9d6f810d23
2017-05-24 11:41:02 -04:00
Ehsan Akhgari
b1a6df0904 Backout the experimental patch for bug 1366156 because it didn't help 2017-05-24 09:46:39 -04:00
Andreas Farre
9b389ab049 Bug 1353206 - Expose nsIThread::idleDispatch to script. r=froydnj 2017-05-24 12:16:04 +02:00
Bill McCloskey
226f6b9185 Bug 1366869 - Make DISPATCH_NORMAL be the default flags argument for nsIEventTarget::Dispatch (r=froydnj)
MozReview-Commit-ID: 5DVcIaMHH95
2017-05-23 12:05:43 -07:00
Michael Layzell
590b8f81b4 Bug 1363883 - Share memory maps between BHR native stacks, dr=bsmedberg, r=froydnj
MozReview-Commit-ID: IQ1fMXUD0ch
2017-05-23 13:41:52 -04:00
David Parks
51b34f2689 Bug 1363290 - Part 4: Extend DLL interceptor to handle mov r32, imm32. r=dmajor
The code already handles this if the r32 is eax.  This allows it to use the other 32-bit registers.

--HG--
extra : histedit_source : 1cff5b54640cc48a0574b0b4323ad909e8a7e7b2
2017-05-16 14:48:56 -07:00
David Parks
efb6b228f4 Bug 1363290 - Part 2: Add movxsd instruction to WindowsDllInterceptor. r=dmajor
movxsd moves 32-bit register values to 64-bit registers, sign-extending them.  It is used by SetCursorPos.
2017-05-16 14:42:58 -07:00
Andreas Farre
5a1916b791 Bug 1366750 - Rename nsIIncrementalRunnable to nsIIdleRunnable. r=smaug
The name nsIIdleRunnable makes more sense, since its main use is in
nsIThread::idleDispatch.

MozReview-Commit-ID: H6qchxKnt7a
2017-05-23 13:24:25 +02:00
Nathan Froyd
d0e620966f Bug 1363172 - add mozilla::RWLock; r=erahm
This sort of lock is mostly useful in the context of Stylo right now,
but perhaps there are other applications waiting to be written.
2017-05-22 21:26:26 -04:00
Nathan Froyd
e75f6bd810 Bug 1353755 - remove nsCharTraits::assign; r=erahm
We don't need the tiny helper function for single-character assignment,
and the multi-argument assign() method is the only thing that uses it,
which is also itself unused.  So remove them both.
2017-05-22 09:23:09 -04:00
Nicholas Nethercote
d1e495344b Bug 1365854 - Remove FRAME_LABEL_COPY. r=mstange,shu.
ProfileEntry has |string|, which can be static or dynamic, and |dynamicString|.
If |string| is dynamic, the FRAME_LABEL_COPY flag must be set, and it will be
copied into profiler output.

But there is only one place that uses dynamic |string| values, in SpiderMonkey.
And that place doesn't use |dynamicString|. So this patch changes that place to
use an empty |string| and put the old dynamic |string| value in
|dynamicString|. This in turn removes the need for FRAME_LABEL_COPY.

One minor wrinkle is that when |dynamicString| is used the old code put a space
between |string| and |dynamicString|. The new code omits the space if |string|
is empty.

The patch also renames ProfileEntry::string as ProfileEntry::label_, which
better matches how it's used, and ProfileEntry::dynamicString as
ProfileEntry::dynamicString_ so the getter can be renamed dynamicString().
2017-05-18 17:17:46 +10:00
Bill McCloskey
b71d032b99 Bug 1363877 - Label IPC shmem messages as SystemGroup (r=dvander)
MozReview-Commit-ID: 3I5ny0wxVHI
2017-05-19 16:38:12 -07:00
Bill McCloskey
24b1d128db Bug 1363474 - Add a method to ask whether it's safe to run code related to a given SchedulerGroup (r=froydnj)
MozReview-Commit-ID: F8uZUTfUM9v
2017-05-19 14:31:52 -07:00
Bill McCloskey
2f4cd5e241 Revert "Bug 1363474 - Add a method to ask whether it's safe to run code related to a given SchedulerGroup (r=froydnj)"
This reverts commit 51714e98c2d248c02b326aeea64f3af0cbdecd50.
2017-05-19 14:24:45 -07:00
Bill McCloskey
f63847577a Bug 1363474 - Add a method to ask whether it's safe to run code related to a given SchedulerGroup (r=froydnj)
MozReview-Commit-ID: F8uZUTfUM9v
2017-05-19 13:59:24 -07:00
Ehsan Akhgari
f5567643a3 Bug 1366156 - Temporarily disable the collection of content js delay event telemetry probes to investigate whether they are the cause of child process INPUT_EVENT_RESPONSE_MS regressions; r=farre 2017-05-19 09:46:30 -04:00
Cervantes Yu
2dc8565a99 Bug 1348747 - Part 2: Support stub functions starting with jmp rel8 in WindowsDllDetourPatcher. r=handyman
MozReview-Commit-ID: 5hPBmxtBCnu

--HG--
extra : rebase_source : 52a1d43c9f57c9c8b70ded93cbcb76218922ea8b
extra : amend_source : 6377d7eb2246b38e69b95b2a7f507a0f86e300b1
extra : histedit_source : 5cc91dfb4613431466ccde12610a36578361bf53
2017-05-19 15:53:54 +08:00
Cervantes Yu
cd7a0759ce Bug 1348747 - Part 1: Fix WindowsDllDetourPatcher that generates extra 0xff byte when generating a x64 jmp instruction. r=handyman
MozReview-Commit-ID: 8TfcwXh6GUN

--HG--
extra : rebase_source : dae5e7e517bdac97eae0983fe4eedacd59f33deb
extra : amend_source : 8332240c2eeff58bc6cd9ea6e6175f2b860777f8
extra : histedit_source : f287291c7405a283f62c15e7ad2a9d8a1c283e06
2017-05-19 15:53:44 +08:00