Commit Graph

5732 Commits

Author SHA1 Message Date
Kris Maglione
a8eba3c140 Bug 1361900: Part 2 - Add process types field to cached script data. r=erahm
MozReview-Commit-ID: Gvh672XD0ar

--HG--
extra : rebase_source : 4391f60ab8f1eaa3df646f7acbc2652be2487f0c
extra : source : 39ffa8a7801a7807a1097ea2c9290c772cd54a9b
2017-05-03 17:21:31 -07:00
Sebastian Hengst
0bc683dcda Backed out changeset 39ffa8a7801a (bug 1361900) 2017-05-13 18:53:50 +02:00
Sebastian Hengst
20ecaf5c4c Backed out changeset bd55bd27bb1e (bug 1361900) 2017-05-13 18:53:45 +02:00
Sebastian Hengst
e1ddae17f8 Backed out changeset ad243db647c7 (bug 1361900) 2017-05-13 18:53:40 +02:00
Sebastian Hengst
185936c593 Backed out changeset 540ecb4c1f0f (bug 1361900) 2017-05-13 18:53:35 +02:00
Sebastian Hengst
0f6e08c578 Backed out changeset 4227bcda00ba (bug 1361900) 2017-05-13 18:53:30 +02:00
Sebastian Hengst
aa75233439 Backed out changeset 3c716b3b4541 (bug 1361900) 2017-05-13 18:53:25 +02:00
Sebastian Hengst
f2d93e36db Backed out changeset 2a48f8b743d1 (bug 1361900) 2017-05-13 18:53:15 +02:00
Sebastian Hengst
b5071f569a Backed out changeset 75b28187fa5e (bug 1361900) 2017-05-13 18:53:10 +02:00
Sebastian Hengst
68e5b1d383 Backed out changeset 9795dacd97e1 (bug 1361900) 2017-05-13 18:52:53 +02:00
Sebastian Hengst
9c58d83d6f Backed out changeset 8d47499f43b3 (bug 1361900) 2017-05-13 18:52:48 +02:00
Sebastian Hengst
f8b2c3d68c Backed out changeset 0b38ac21c7a5 (bug 1361900) 2017-05-13 18:52:25 +02:00
Sebastian Hengst
1e386fe967 Backed out changeset 23dc7b443bb0 (bug 1361900) 2017-05-13 18:51:57 +02:00
Kris Maglione
8d9a00892f Bug 1361900: Fix one last merge botch, and fix a false rooting hazard warning.
MozReview-Commit-ID: JpKYYEBpbQj

--HG--
extra : rebase_source : 5bbb462ed3255c631cc1c280359af8c9c2224239
extra : histedit_source : 444c4c02eb1a3ced85cef09f7b7a6e7f5b9235b5%2Cb16ca4316a1aabf5e5c1b8641a0e1818d815da76
2017-05-12 18:14:12 -07:00
Kris Maglione
40bbc14054 Bug 1361900: Follow-up: Fix order of execution issue. r=me
MozReview-Commit-ID: DcmTlzxskUj
2017-05-12 15:46:34 -07:00
Kris Maglione
26511894d2 Bug 1361900: Follow-up: Fix another rebase botch. r=me
MozReview-Commit-ID: BuvkimQCRDP
2017-05-12 15:17:25 -07:00
Kris Maglione
53cf532feb Bug 1361900: Follow-up: Fix rebase botch. r=me
MozReview-Commit-ID: 3KIbvGYhnlG
2017-05-12 14:59:34 -07:00
Kris Maglione
a4e4191399 Bug 1356826: Part 4 - Add Cu.isInAutomation and Cu.crashIfNotInAutomation helpers. r=bholley
MozReview-Commit-ID: ADqVqF2XraG

--HG--
extra : rebase_source : 5b4ff1ceb7f3123f585559a954e59291c91e5554
extra : source : c46fed6e4f6a928df2b06fca6b3f004fd4bb0cc7
2017-04-15 14:23:58 -07:00
Kris Maglione
23518f0244 Bug 1361900: Part 10 - Replace linked lists with a single hashtable. r=erahm
MozReview-Commit-ID: 3qXnswsP6Z0

--HG--
extra : rebase_source : 1edbf92171003d9ad2c4cfebabbb8a1d7f2d4e24
2017-05-03 16:57:31 -07:00
Kris Maglione
220b0239c3 Bug 1361900: Part 9 - Sort scripts by initial load time before saving. r=erahm
MozReview-Commit-ID: 54UN2DVK4xM

--HG--
extra : rebase_source : f7cb39eb05bb86a03a17b97cbe2cb9d8dd1008fe
2017-05-01 14:12:01 -07:00
Kris Maglione
4948d82519 Bug 1361900: Part 7 - Use the script preloader in content processes in subscript and component loaders. r=mccr8
MozReview-Commit-ID: 4b5XwORYlAz

--HG--
extra : rebase_source : a43936bc2eaaa87c24cc8933e54e99a9386e12e3
2017-04-30 21:53:49 -07:00
Kris Maglione
2a49ee963d Bug 1361900: Part 6 - Add content process support for the script preloader. r=erahm,gabor
MozReview-Commit-ID: 6hDQAI52bKC

--HG--
extra : rebase_source : a7a32c6ebca0ce1b6449030e33656a9d416e910e
2017-05-02 17:17:52 -07:00
Kris Maglione
d3eae9806f Bug 1361900: Part 5 - Add support for IPC FileDescriptors to AutoMemMap. r=erahm
MozReview-Commit-ID: 3HBuKLVNdWT

--HG--
extra : rebase_source : b5c331223808810c0dceeafccbbf7a2de7d98bc4
2017-04-30 22:54:00 -07:00
Kris Maglione
34e20a0617 Bug 1361900: Part 4 - Use a separate script cache for scripts loaded in the child process. r=erahm,gabor
MozReview-Commit-ID: EIdwmuTOl90

--HG--
extra : rebase_source : bce9efcd7b97c281bf4e17e30eed31e6e93c614a
2017-05-09 19:52:17 -07:00
Kris Maglione
c0f737d8d9 Bug 1361900: Part 3 - Add a helper script to decode and inspect script cache data. r=erahm
MozReview-Commit-ID: DOj7X46NaZ5

--HG--
extra : rebase_source : f974fa6dc5cf0316b463bc7d1c7f6cd4478c4b59
2017-04-30 13:00:55 -07:00
Kris Maglione
4b6d93f595 Bug 1361900: Part 2 - Add process types field to cached script data. r=erahm
MozReview-Commit-ID: Gvh672XD0ar

--HG--
extra : rebase_source : 022d4a8d3116ae1817189d1f03c3180087997487
2017-05-03 17:21:31 -07:00
Iris Hsiao
6559420d58 Backed out 15 changesets (bug 1358846, bug 1356826) for talos error. a=backout
Backed out changeset 96ea13bb00c5 (bug 1358846)
Backed out changeset b533d7f9b9c2 (bug 1358846)
Backed out changeset 7dcb80a051a3 (bug 1358846)
Backed out changeset 26825f1e33dd (bug 1358846)
Backed out changeset 98b57ff82a54 (bug 1358846)
Backed out changeset b9088593e34f (bug 1358846)
Backed out changeset cb2518673c56 (bug 1358846)
Backed out changeset 889c487a5d41 (bug 1358846)
Backed out changeset 459b36092b7a (bug 1356826)
Backed out changeset c861e23ec8ef (bug 1356826)
Backed out changeset d47998fa24cd (bug 1356826)
Backed out changeset b02e89c67132 (bug 1356826)
Backed out changeset c46fed6e4f6a (bug 1356826)
Backed out changeset 237268e3d9d2 (bug 1356826)
Backed out changeset 527435fc20db (bug 1356826)
2017-05-12 17:45:21 +08:00
Kris Maglione
602cb201f5 Bug 1356826: Part 4 - Add Cu.isInAutomation and Cu.crashIfNotInAutomation helpers. r=bholley
MozReview-Commit-ID: ADqVqF2XraG

--HG--
extra : rebase_source : ea5df06eb9162f9f8c5816f49fb44d9f41947126
2017-04-15 14:23:58 -07:00
Wes Kocher
1b5ad2c128 Merge inbound to central, a=merge
MozReview-Commit-ID: DfRZi0gKjit
2017-05-10 16:48:03 -07:00
Carsten "Tomcat" Book
455239782b Merge mozilla-central to mozilla-inbound 2017-05-10 15:30:44 +02: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
Andrew McCreight
087c406acb Bug 1363538 - Remove some derelict testing code from XPCShellImpl.cpp. r=mrbkap
MozReview-Commit-ID: 96UyB317H0W

--HG--
extra : source : 0a74ed4854d784856f28cf48a422f4aa0763fd22
2017-05-09 14:35:23 -07:00
Alexandre Poirot
097e90a04c Bug 1363539 - Remove dependency on DevTools from test_onGarbageCollection.html. r=sfink
MozReview-Commit-ID: LQ8oCAyC7sF

--HG--
extra : rebase_source : 82284076bcff9fa34d7410b22ce90bb6182d3a09
2017-02-22 12:45:11 +01:00
Andrea Marchesini
1981f67eb3 Bug 1362119 - part 1 - Moving dom/base/Script{Loader,Element}.* in dom/script, r=ehsan
This patch does these things:

1. it moves nsScriptElement, nsScriptLoader, ScriptSettings, nsIScriptElement
   and nsIScriptLoaderObserver in dom/script
2. it renames nsScriptElement to mozilla::dom::ScriptElement
3. it renames nsScriptLaoder to mozilla::dom::ScriptLoader

--HG--
rename : dom/base/nsScriptElement.cpp => dom/script/ScriptElement.cpp
rename : dom/base/nsScriptElement.h => dom/script/ScriptElement.h
rename : dom/base/nsScriptLoader.cpp => dom/script/ScriptLoader.cpp
rename : dom/base/nsScriptLoader.h => dom/script/ScriptLoader.h
rename : dom/base/ScriptSettings.cpp => dom/script/ScriptSettings.cpp
rename : dom/base/ScriptSettings.h => dom/script/ScriptSettings.h
rename : dom/base/nsIScriptElement.h => dom/script/nsIScriptElement.h
rename : dom/base/nsIScriptLoaderObserver.idl => dom/script/nsIScriptLoaderObserver.idl
2017-05-08 08:24:22 +02:00
Carsten "Tomcat" Book
f0d6de60d7 Backed out changeset 5d77f6b14633 (bug 1362119) for android bustage in nsCCUncollectableMarker.cpp:500:7: error: 'TraceScriptHolder' is not a member of 'mozilla'
--HG--
rename : dom/script/ScriptSettings.cpp => dom/base/ScriptSettings.cpp
rename : dom/script/ScriptSettings.h => dom/base/ScriptSettings.h
rename : dom/script/nsIScriptElement.h => dom/base/nsIScriptElement.h
rename : dom/script/nsIScriptLoaderObserver.idl => dom/base/nsIScriptLoaderObserver.idl
rename : dom/script/ScriptElement.cpp => dom/base/nsScriptElement.cpp
rename : dom/script/ScriptElement.h => dom/base/nsScriptElement.h
rename : dom/script/ScriptLoader.cpp => dom/base/nsScriptLoader.cpp
rename : dom/script/ScriptLoader.h => dom/base/nsScriptLoader.h
2017-05-08 09:54:38 +02:00
Andrea Marchesini
7a4ef797cb Bug 1362119 - part 1 - Moving dom/base/Script{Loader,Element}.* in dom/script, r=ehsan
This patch does these things:

1. it moves nsScriptElement, nsScriptLoader, ScriptSettings, nsIScriptElement
   and nsIScriptLoaderObserver in dom/script
2. it renames nsScriptElement to mozilla::dom::ScriptElement
3. it renames nsScriptLaoder to mozilla::dom::ScriptLoader

--HG--
rename : dom/base/nsScriptElement.cpp => dom/script/ScriptElement.cpp
rename : dom/base/nsScriptElement.h => dom/script/ScriptElement.h
rename : dom/base/nsScriptLoader.cpp => dom/script/ScriptLoader.cpp
rename : dom/base/nsScriptLoader.h => dom/script/ScriptLoader.h
rename : dom/base/ScriptSettings.cpp => dom/script/ScriptSettings.cpp
rename : dom/base/ScriptSettings.h => dom/script/ScriptSettings.h
rename : dom/base/nsIScriptElement.h => dom/script/nsIScriptElement.h
rename : dom/base/nsIScriptLoaderObserver.idl => dom/script/nsIScriptLoaderObserver.idl
2017-05-08 08:24:22 +02:00
Kris Maglione
9c1bafbab4 Bug 1359653: Follow-up: Don't cache mochikit scripts as a temporary bustage workaround.
MozReview-Commit-ID: I4FcZWRKlWr

--HG--
extra : amend_source : c34f3bcb023b9063a4d1a53a6bb3873fdb499d1c
2017-05-06 14:41:22 -07:00
Kris Maglione
e8e5fe66b7 Bug 1359653: Part 9 - Observe "startupcache-invalidate" and flush the cache when received. r=erahm
Flushing the cache at startup is already handled automatically by the
AppStartup code, which removes the entire startupCache directory when
necessary. The add-on manager requires being able to flush the cache at
runtime, though, for the sake of updating bootstrapped add-ons.

MozReview-Commit-ID: LIdiNHrXYXu

--HG--
extra : source : 8f4637881ddc42a948c894e62c8486fe8677a938
extra : histedit_source : e69395a2b87b2b0edb394686ed6ee24731ba9fb8
2017-05-03 12:31:51 -07:00
Kris Maglione
6df68230e0 Bug 1359653: Part 6 - Use the script precompiler in the JS component loader and subscript loader. r=mccr8,shu
MozReview-Commit-ID: HMl0xbAARHK

--HG--
extra : source : a505dcbe8a02bf4b4f975e62cc2b651ef7eebdd0
extra : histedit_source : 288bbb8633d2296200abb66f359619785ac7d2d8
2017-05-03 22:06:33 -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
Sebastian Hengst
a71ff9882a Backed out changeset a505dcbe8a02 (bug 1359653) 2017-05-06 11:02:18 +02:00
Sebastian Hengst
0584d6d6d4 Backed out changeset 8f4637881ddc (bug 1359653) 2017-05-06 11:02:04 +02:00
Kris Maglione
c1b1876797 Bug 1359653: Part 9 - Observe "startupcache-invalidate" and flush the cache when received. r=erahm
Flushing the cache at startup is already handled automatically by the
AppStartup code, which removes the entire startupCache directory when
necessary. The add-on manager requires being able to flush the cache at
runtime, though, for the sake of updating bootstrapped add-ons.

MozReview-Commit-ID: LIdiNHrXYXu

--HG--
extra : rebase_source : e5b16490f47e20c78d081ad03dec02c6b2874fc3
extra : absorb_source : 6cd94504c8247f375161b2afdca5c61d59cf8f01
2017-05-03 12:31:51 -07:00
Kris Maglione
e1eeeaf349 Bug 1359653: Part 6 - Use the script precompiler in the JS component loader and subscript loader. r=mccr8,shu
MozReview-Commit-ID: HMl0xbAARHK

--HG--
extra : rebase_source : 257ac78f3438d67725b5c1630c214a1d0627193d
extra : absorb_source : e70948dbfa5517b1868cafe804a71248e57ef022
2017-05-03 22:06:33 -07: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
André Bargull
11bb19e7da Bug 1359294 - Remove toLocaleLowerCase/toLocaleUpperCase callbacks in XPCLocale. r=Waldo
--HG--
extra : rebase_source : 711d5bfc896a48f63b6c825823ba5aef5c93413c
extra : histedit_source : 7a34417565cf6151c39d7c68c776505142098f24
2017-05-03 09:55:06 -07:00
Nathan Froyd
3261352ea3 Bug 1361514 - convert XPCLocaleObserver to NS_DECL_OWNINGTHREAD; r=gabor
The pattern we're using here has a name, so let's use that instead.
2017-05-03 11:48:54 -04:00
Sebastian Hengst
f4f104e7e0 merge mozilla-central to autoland. r=merge a=merge 2017-04-29 11:11:48 +02:00
Andrew Swan
f38ced1fc9 Bug 1354682 Add transform to XPCOMUtils.defineLazyPreferenceGetter r=kmag
MozReview-Commit-ID: Lm59IHMNcy9

--HG--
extra : rebase_source : 3250d759b1b9909bcc7564139a3d7066d8376b60
2017-04-28 22:39:13 -07:00