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

16132 Коммитов

Автор SHA1 Сообщение Дата
Carsten "Tomcat" Book 455239782b Merge mozilla-central to mozilla-inbound 2017-05-10 15:30:44 +02:00
Carsten "Tomcat" Book d66b9f27d5 merge mozilla-inbound to mozilla-central a=merge 2017-05-10 15:07:28 +02:00
Bill McCloskey c197e07ff2 Bug 1363560 - Name more runnables (r=mccr8)
MozReview-Commit-ID: 3hxZDA4JlTV
2017-05-09 21:53:25 -07:00
Bill McCloskey 64eae5b86d Bug 1361561 - Add GetCurrentVirtualThread function (r=froydnj)
This change adds some functions that should be used instead of PR_GetCurrentThread. They both return a PRThread. GetCurrentPhysicalThread does exactly the same thing as PR_GetCurrentThread, but it makes it clearer what you're getting when there are cooperatively scheduled threads running.

GetCurrentVirtualThread returns the same value for all threads in a cooperative thread pool. The actual value it returns is somewhat immaterial.

MozReview-Commit-ID: 4lFwsF2NuzC
2017-05-09 21:53:23 -07:00
kedziorski.lukasz@gmail.com f815a0af4b Bug 1359436 - Add leak checking to CycleCollectedJSContext and related classes. r=mccr8 2017-05-09 13:59:00 +02:00
JW Wang 4f8f4d86e6 Bug 1362912. P1 - disallow promise chaining when any of the Then callbacks doesn't return a promise. r=gerald
A template won't be instatiated until used. We make it a compile error
to call Then() on ThenCommand<false> to disallow promise chaining.

MozReview-Commit-ID: BUCFgfX4FTJ

--HG--
extra : rebase_source : 0b46b9d10a9b7dec3f15ad4596d9726365f6f859
extra : source : 5676128a7a3ee68bf9eee01bbdf8b983117d5655
2017-05-09 23:11:42 +08:00
Xidorn Quan fa9c49fce4 Bug 1330235 - Remove NS_STDCALL_FUNCPROTO and replace its usage with decltype. r=froydnj
MozReview-Commit-ID: 5jrTqTfDzSk

--HG--
extra : rebase_source : e2345a4f518757ed9760618d07599a60353875cc
2017-05-09 23:00:37 +10:00
Carsten "Tomcat" Book 76ca853e3e Merge mozilla-central to mozilla-inbound 2017-05-09 14:40:11 +02:00
Andrea Marchesini c41696993b Bug 1361654 - Initializing all the member variables in SlicedInputStream, r=qdot 2017-05-04 08:36:35 +02:00
Franziskus Kiefer 647c94e8af Bug 1359335 - collect telemetry on aes-ni support, r=gfritzsche
MozReview-Commit-ID: 23YbAcCls1H

--HG--
extra : rebase_source : e70869f3cb88052cb756649e4581f6690363acfe
2017-03-31 19:03:03 +02:00
Jonathan Watt 6f36936674 Bug 1362891, part 1 - Add an XRE_IsE10sParentProcess function. r=froydnj
MozReview-Commit-ID: 6neyZj71i3r

--HG--
extra : rebase_source : a172d64a03f2af8b2b1e4820645295c8d64e8118
2017-04-24 09:38:10 +01:00
Wes Kocher f5ba7a67d6 Merge m-c to inbound, a=merge
MozReview-Commit-ID: 9QuGHXqdxTb
2017-05-08 16:14:34 -07:00
Wes Kocher cbfdaf8fb2 Merge inbound to central, a=merge CLOSED TREE
MozReview-Commit-ID: 5kxOZZxjMEl
2017-05-08 16:07:25 -07:00
Tom Tromey aa6e054b71 Bug 1334279 - mark vsprintf-likes with MOZ_FORMAT_PRINTF; r=froydnj
This annotates vsprintf-like functions with MOZ_FORMAT_PRINTF.  This may
provide some minimal checking of such calls (the GCC docs say that it
checks for the string for "consistency"); but in any case shouldn't
hurt.

MozReview-Commit-ID: HgnAK1LiorE

--HG--
extra : rebase_source : 9c8d715d6560f89078c26ba3934e52a2b5778b6a
2017-05-04 12:10:19 -06:00
Byron Campen [:bwc] 2394603d23 Bug 1361098: Simplify TimerThread::Init some. r=froydnj
--HG--
extra : rebase_source : dad786e4130964e48aef9812773e7cf4840ba46d
extra : amend_source : f6d7b3421c036bc94a2067439244b78dc75ccb68
2017-05-01 13:42:11 -05:00
Ehsan Akhgari 772e364199 Bug 1360971 - Part 1: Add the nsCategoryCache<T>::GetCachedEntries() API; r=froydnj
This provides a more efficient way to read the entries out of an
XPCOM category cache.
2017-05-08 10:31:13 -04:00
Ehsan Akhgari 5de2ecd325 Bug 1361745 - Part 1: Improve the nsClassHashtable::LookupForAdd() API; r=froydnj
The OrInsert() method adds the new entry to the hashtable if needed, and
returns the newly added entry or the pre-existing one.  It allows for a
more concise syntax at the call site.
2017-05-08 10:02:04 -04:00
Steve Fink 7ef280069e Bug 1322560 - Record minor GC timings in profiles, r=jonco, mccr8, mstange
--HG--
extra : rebase_source : 073eceb4216b0505f8cbce0947e3e5091626ead1
2017-04-25 13:24:34 -07:00
Steve Fink 4b00aab714 Bug 1322560 - Inject detailed GC timing info into profiles, r=mstange
--HG--
extra : rebase_source : fdd7f21bbb783ee759d3b0b614264d078fa2213f
extra : source : 5fe280e53d4f474f5f16ff834e0b9cf55745d746
2017-05-02 16:13:49 -07:00
Kris Maglione 15e7adf3aa Bug 1359653: Part 5 - Pre-load scripts needed during startup in a background thread. r=shu,erahm
One of the things that I've noticed in profiling startup overhead is that,
even with the startup cache, we spend about 130ms just loading and decoding
scripts from the startup cache on my machine.

I think we should be able to do better than that by doing some of that work in
the background for scripts that we know we'll need during startup. With this
change, we seem to consistently save about 3-5% on non-e10s startup overhead
on talos. But there's a lot of room for tuning, and I think we get some
considerable improvement with a few ongoing tweeks.

Some notes about the approach:

- Setting up the off-thread compile is fairly expensive, since we need to
create a global object, and a lot of its built-in prototype objects for each
compile. So in order for there to be a performance improvement for OMT
compiles, the script has to be pretty large. Right now, the tipping point
seems to be about 20K.

  There's currently no easy way to improve the per-compile setup overhead, but
we should be able to combine the off-thread compiles for multiple smaller
scripts into a single operation without any additional per-script overhead.

- The time we spend setting up scripts for OMT compile is almost entirely
CPU-bound. That means that we have a chunk of about 20-50ms where we can
safely schedule thread-safe IO work during early startup, so if we schedule
some of our current synchronous IO operations on background threads during the
script cache setup, we basically get them for free, and can probably increase
the number of scripts we compile in the background.

- I went with an uncompressed mmap of the raw XDR data for a storage format.
That currently occupies about 5MB of disk space. Gzipped, it's ~1.2MB, so
compressing it might save some startup disk IO, but keeping it uncompressed
simplifies a lot of the OMT and even main thread decoding process, but, more
importantly:

- We currently don't use the startup cache in content processes, for a variety
of reasons. However, with this approach, I think we can safely store the
cached script data from a content process before we load any untrusted code
into it, and then share mmapped startup cache data between all content
processes. That should speed up content process startup *a lot*, and very
likely save memory, too. And:

- If we're especially concerned about saving per-process memory, and we keep
the cache data mapped for the lifetime of the JS runtime, I think that with
some effort we can probably share the static string data from scripts between
content processes, without any copying. Right now, it looks like for the main
process, there's about 1.5MB of string-ish data in the XDR dumps. It's
probably less for content processes, but if we could save .5MB per process
this way, it might make it easier to increase the number of content processes
we allow.

MozReview-Commit-ID: CVJahyNktKB

--HG--
extra : source : 1c7df945505930d2d86a076ee20807104324c8cc
extra : histedit_source : 75e193839edf727874f01b2a9f6852f6c1f087fb%2C3ce966d7dcf2bd0454a7d673d0467097456bd782
2017-05-06 12:24:22 -07:00
Sebastian Hengst 544da0524c Backed out changeset 1c7df9455059 (bug 1359653) 2017-05-06 11:02:23 +02:00
Kris Maglione a4368ffba1 Bug 1359653: Part 5 - Pre-load scripts needed during startup in a background thread. r=shu,erahm
One of the things that I've noticed in profiling startup overhead is that,
even with the startup cache, we spend about 130ms just loading and decoding
scripts from the startup cache on my machine.

I think we should be able to do better than that by doing some of that work in
the background for scripts that we know we'll need during startup. With this
change, we seem to consistently save about 3-5% on non-e10s startup overhead
on talos. But there's a lot of room for tuning, and I think we get some
considerable improvement with a few ongoing tweeks.

Some notes about the approach:

- Setting up the off-thread compile is fairly expensive, since we need to
create a global object, and a lot of its built-in prototype objects for each
compile. So in order for there to be a performance improvement for OMT
compiles, the script has to be pretty large. Right now, the tipping point
seems to be about 20K.

  There's currently no easy way to improve the per-compile setup overhead, but
we should be able to combine the off-thread compiles for multiple smaller
scripts into a single operation without any additional per-script overhead.

- The time we spend setting up scripts for OMT compile is almost entirely
CPU-bound. That means that we have a chunk of about 20-50ms where we can
safely schedule thread-safe IO work during early startup, so if we schedule
some of our current synchronous IO operations on background threads during the
script cache setup, we basically get them for free, and can probably increase
the number of scripts we compile in the background.

- I went with an uncompressed mmap of the raw XDR data for a storage format.
That currently occupies about 5MB of disk space. Gzipped, it's ~1.2MB, so
compressing it might save some startup disk IO, but keeping it uncompressed
simplifies a lot of the OMT and even main thread decoding process, but, more
importantly:

- We currently don't use the startup cache in content processes, for a variety
of reasons. However, with this approach, I think we can safely store the
cached script data from a content process before we load any untrusted code
into it, and then share mmapped startup cache data between all content
processes. That should speed up content process startup *a lot*, and very
likely save memory, too. And:

- If we're especially concerned about saving per-process memory, and we keep
the cache data mapped for the lifetime of the JS runtime, I think that with
some effort we can probably share the static string data from scripts between
content processes, without any copying. Right now, it looks like for the main
process, there's about 1.5MB of string-ish data in the XDR dumps. It's
probably less for content processes, but if we could save .5MB per process
this way, it might make it easier to increase the number of content processes
we allow.

MozReview-Commit-ID: CVJahyNktKB

--HG--
extra : rebase_source : 2ec24c8b0000f9187a9bf4a096ee8d93403d7ab2
extra : absorb_source : bb9d799d664a03941447a294ac43c54f334ef6f5
2017-05-05 16:15:04 -07:00
Phil Ringnalda e099f834fe Backed out 2 changesets (bug 1360992, bug 1361654) for a 70% failure rate in test_fileReader.html on ASan e10s
Backed out changeset ab9fdee3a6a4 (bug 1360992)
Backed out changeset 141c2dfd49ff (bug 1361654)

MozReview-Commit-ID: 3rSzvmc5FPx
2017-05-05 12:35:57 -07:00
Nathan Froyd 844bb853dd Bug 1362390 - make Base64Encode tolerant of allocation failures; r=mccr8 2017-05-05 11:33:36 -04:00
Nathan Froyd 880d162a51 Bug 1362194 - part 3 - make Base64Decode even more tolerant of allocation failures; r=mccr8
The lossy conversion to ASCII here can also fail; we should handle that
as well.  Rewriting the code to use MakeScopeExit also avoids tangled
logic and/or duplicating calls to ensure the destination string is
truncated on failure.
2017-05-05 11:33:36 -04:00
Nathan Froyd 8b000da91e Bug 1362194 - part 2 - make Base64Decode tolerant of allocation failures; r=mccr8
We need to use a fallible CopyASCIItoUTF16 function, since we might not
have enough memory to perform the copy.
2017-05-05 11:33:36 -04:00
Nathan Froyd f6465f98b9 Bug 1362194 - part 1 - add a fallible CopyASCIItoUTF16 function; r=mccr8
We already have all the machinery to expose a function like this, we
just need to write it.
2017-05-05 11:33:36 -04:00
Carsten "Tomcat" Book fdc689ba16 merge mozilla-inbound to mozilla-central a=merge 2017-05-05 15:17:26 +02:00
Olli Pettay 0096f25b51 Bug 1358761 - replace PurpleBlock with SegmentedVector to reduce indirect memory accesses when calling suspect, r=mccr8,nfroyd
--HG--
extra : rebase_source : e74be6bfb9efbba9361d2ce3c22518379a332200
2017-05-05 00:49:22 +03:00
L. David Baron 5191ef7b3b 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 : rebase_source : dbde93b9312dd10fb3a549ee4098b57e1df5cadf
2017-05-04 15:17:50 -07:00
Andreas Farre 7cd708c02f Bug 1322184 - Measure time spent in content JS that causes delay in paint. r=billm, data-r=bsmedberg
MozReview-Commit-ID: Iz31CKSnDdc

--HG--
extra : rebase_source : e0db2419ee2ef868d2f4d1b47d45547e55bd2036
2017-05-02 08:10:00 -04:00
Andrea Marchesini f62189c258 Bug 1361443 - nsMultiplexInputStream should implement nsIAsyncInputStream, r=smaug 2017-05-04 14:44:35 +02:00
Carsten "Tomcat" Book eb1fd0ed7f Backed out changeset c0e3f3edf36a (bug 1361443) for crashes in [@ mozilla::Base64EncodeInputStream] and test failures in test_fileReaderSync.xul 2017-05-04 16:40:14 +02:00
Andrea Marchesini a9df58d062 Bug 1361443 - nsMultiplexInputStream should implement nsIAsyncInputStream, r=smaug 2017-05-04 14:44:35 +02:00
Andrea Marchesini 4d39fea437 Bug 1361654 - Initializing all the member variables in SlicedInputStream, r=qdot 2017-05-04 08:36:35 +02:00
David Major a063c99655 Bug 1349444: Teach the disassembler about "cmp byte ptr [relative], imm8". r=handyman 2017-05-03 17:11:59 -04:00
Wes Kocher 21203b47b5 Merge inbound to m-c a=merge
MozReview-Commit-ID: JgXkqrOwl3N
2017-05-03 13:40:24 -07:00
Patrick McManus 72b59b72e3 Bug 1361601 - Remove nsSystemInfo.getProperty("host") r=froydnj
See also bug 1361495 - PR_SI_HOSTNAME is implemented in NSPR on
Windows as initializing winsock which can be janky. There don't seem
to be any users of this property, and it has tracker concerns anyhow -
so remove it.

MozReview-Commit-ID: S2AwzMUgYk

--HG--
extra : rebase_source : 552bed219913f40c002b807be3239d4666a5284b
2017-05-02 16:54:46 -04:00
Ehsan Akhgari 49ea4e277a Bug 1359848 - Part 1: Add the nsClassHashtable::LookupForAdd() API to allow consumers to lookup and add an entry to a class hashtable if it doesn't exist already with a single lookup; r=froydnj 2017-05-03 08:59:48 -04:00
Iris Hsiao 1401934d7b merge mozilla-inbound to mozilla-central a=merge 2017-05-02 11:04:36 +08:00
Michael Layzell 25ff5420dd Bug 1358619 - Fetch the stack and native stack within the same pause of the target thread, r=froydnj 2017-05-01 13:40:37 -04:00
Michael Layzell 5f77ef972f Bug 1346415 - Collect native stacks at the same time as pseudostacks on nightly, r=mconley 2017-05-01 13:40:37 -04:00
Michael Layzell 58464c1919 Bug 1346415 - Use FramePointerStackWalk for less deadlocking when stackwalking on x86, r=njn
MozReview-Commit-ID: CAHarvGSuTY
2017-05-01 13:40:37 -04:00
Nicholas Nethercote 9471adc672 Bug 1359000 (part 4) - De-inline profiler_call_{enter,exit}. r=mstange.
This possibly incurs an extra function call (depends on exactly how much inling
the compiler does). But it helps enormously with subsequent refactorings,
because PseudoStack (and related types) don't need to be visible in
GeckoProfiler.h, which is exported outside the profiler.

--HG--
extra : rebase_source : f2dc5952d7444dfe12e627e86e6d37632b283107
2017-04-27 07:36:11 +10:00
Bill McCloskey 34a4f034bb Bug 1359245 - Remove references to context from the cycle collector (r=mccr8)
MozReview-Commit-ID: 1QoNEiZMvBf
2017-04-27 15:34:46 -07:00
Bill McCloskey 9862d9c932 Bug 1359245 - Remove some tracing callbacks at shutdown (r=mccr8)
When we just had CycleCollectedJSContext (and no CycleCollectedJSRuntime) a
weird thing happened at shutdown:
1. We would call JS_DestroyContext from ~CycleCollectedJSContext. By that time,
   the ~XPCJSContext destructor had already finished.
2. Destroying the context runs a final GC. That GC would call back into various
   GC callbacks, such as TraceBlackJS and TraceGrayJS.
3. These callbacks would do a virtual method call:
   http://searchfox.org/mozilla-central/rev/876c7dd30586f9c6f9c99ef7444f2d73c7acfe7c/xpcom/base/CycleCollectedJSRuntime.cpp#791
4. Normally this method call would call into
   XPCContext::TraceNativeBlackRoots. However, C++ changes the vtable for an
   object during destruction. So we would only call CycleCollectedJSContext's
   version of TraceNativeBlackRoots, which is empty. So we never traced anything.

When I moved this code into the runtime, we actually do call into
XPCJSRuntime::TraceNativeBlackRoots at that time. So the behavior changed, and
that was causing crashes once I nulled out the TLS as you asked. So I removed
these callbacks for the last GC.

MozReview-Commit-ID: 3do13bjpwQj
2017-04-27 15:34:46 -07:00
Bill McCloskey 1d5c5ef48b Bug 1359245 - Keep a linked list of CycleCollectedJSContexts in the runtime (r=mccr8)
This patch keeps a list of all the cooperatively scheduled contexts that are
linked to a runtime. In places where we need to iterate over all contexts (for
GC, specifically), it iterates over the list.

MozReview-Commit-ID: 3pKJX78f2l0
2017-04-27 15:34:46 -07:00
Bill McCloskey 267ad1f2b0 Bug 1359245 - Initial support for cooperative contexts (r=mccr8)
This patch adds initial support for cooperatively scheduled
CycleCollectedJSContexts.

MozReview-Commit-ID: 5pfPubHUanL
2017-04-27 15:34:46 -07:00
Bill McCloskey ee9f642133 Bug 1359245 - Remove CycleCollectedJSRuntime::mJSContext (r=mccr8,sfink)
This patch eliminates a field where we assume that there is one
CycleCollectedJSContext per runtime.

MozReview-Commit-ID: 5cEL5Ml6Y9v
2017-04-27 15:34:46 -07:00
Bill McCloskey 11b1f07146 Bug 1359245 - Get rid of CycleCollectedJSRuntime::MainContext (r=mccr8)
This is another method that assumes one context per runtime. This patch
eliminates the method.

MozReview-Commit-ID: JHcQ1nyiHSP
2017-04-27 15:34:46 -07:00