Commit Graph

288 Commits

Author SHA1 Message Date
Cosmin Sabou
14938bad3b Backed out 10 changesets (bug 1550108) for causing build bustages on StartupCache.cpp.
Backed out changeset cbadfa2bbd7e (bug 1550108)
Backed out changeset 2560f0ab6ebf (bug 1550108)
Backed out changeset 0a1fa8d8bb3c (bug 1550108)
Backed out changeset 62416909cf67 (bug 1550108)
Backed out changeset 60991713b1e2 (bug 1550108)
Backed out changeset f950e30afd90 (bug 1550108)
Backed out changeset e63d0a1fec38 (bug 1550108)
Backed out changeset 7a009d42e7e7 (bug 1550108)
Backed out changeset 395affa4c205 (bug 1550108)
Backed out changeset 0fd41e9dbd2a (bug 1550108)

--HG--
rename : mfbt/lz4/lz4.c => mfbt/lz4.c
rename : mfbt/lz4/lz4.h => mfbt/lz4.h
2019-09-29 01:14:31 +03:00
Doug Thayer
4fce63cac2 Bug 1550108 - Reduce stack size on StartupCache threads r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D46225

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:23 +00:00
Doug Thayer
8d6b517ecd Bug 1550108 - Prefetch StartupCache off main thread r=froydnj
Does what it says on the tin. Once we have a central scheduling
system this should likely just consume that.

Differential Revision: https://phabricator.services.mozilla.com/D35454

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:21 +00:00
Doug Thayer
4187f5ece3 Bug 1550108 - Compact the StartupCache if it is bloated r=froydnj
The first run loads more things into the StartupCache than are
used on the second and subsequent runs. This just ensures that if
the StartupCache diverges too far from its actual use that we will
rebuild it.

Differential Revision: https://phabricator.services.mozilla.com/D34654

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:17 +00:00
Doug Thayer
cf2166a011 Bug 1550108 - Eliminate large buffer copies from StartupCache r=froydnj
The signatures were updated in the previous patch to hand us the raw,
uncopied buffers. This just adjusts the callsites to match.

Differential Revision: https://phabricator.services.mozilla.com/D34653

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:13 +00:00
Doug Thayer
eb024f4ee6 Bug 1550108 - Change StartupCache format from zip to custom r=froydnj
I am not aware of anything that depends on StartupCache being a
zip file, and since I want to use lz4 compression because inflate
is showing up quite a lot in profiles, it's simplest to just use
a custom format. This loosely mimicks the ScriptPreloader code,
with a few diversions:

- Obviously the contents of the cache are compressed. I used lz4
  for this as I hit the same file size as deflate at a compression
  level of 1, which is what the StartupCache was using previously,
  while decompressing an order of magnitude faster. Seemed like
  the most conservative change to make. I think it's worth
  investigating what the impact of slower algs with higher ratios
  would be, but for right now I settled on this. We'd probably
  want to look at zstd next.
- I use streaming compression for this via lz4frame. This is not
  strictly necessary, but has the benefit of not requiring as
  much memory for large buffers, as well as giving us a built-in
  checksum, rather than relying on the much slower CRC that we
  were doing with the zip-based approach.
- I coded the serialization of the headers inline, since I had to
  jump back to add the offset and compressed size, which would
  make the nice Code(...) method for the ScriptPreloader stuff
  rather more complex. Open to cleaner solutions, but moving it
  out just felt like extra hoops for the reader to jump through
  to understand without the benefit of being more concise.

Differential Revision: https://phabricator.services.mozilla.com/D34652

--HG--
extra : moz-landing-system : lando
2019-09-27 22:15:35 +00:00
Doug Thayer
5f9554635c Bug 1550108 - Avoid decompressing entries just to check if they exist r=kmag
This will not behave exactly the same if we had previously written bad
data for the entry that would fail to decompress. I imagine this is rare
enough, and the consequences are not severe enough, that this should be
fine.

Differential Revision: https://phabricator.services.mozilla.com/D30643

--HG--
extra : moz-landing-system : lando
2019-09-27 22:15:01 +00:00
Doug Thayer
5775d5e284 Bug 1550108 - Don't read from app/gre caches in StartupCache r=kmag
I thought I had already written out the patch to remove these, but
apparently not. Per discussion in the startup cache telemetry bug,
there should be no reason for doing this.

Differential Revision: https://phabricator.services.mozilla.com/D31491

--HG--
extra : moz-landing-system : lando
2019-09-27 22:15:01 +00:00
Tom Schuster
0e913c22c4 Bug 1558915 - Use infallible nsIURI::SchemeIs in various places r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D40677

--HG--
extra : moz-landing-system : lando
2019-08-07 19:49:40 +00:00
Cosmin Sabou
c3430326e6 Backed out changeset ca88862d6b63 (bug 1558915) for causing build bustages on StartupCacheUtils. CLOSED TREE 2019-08-07 13:20:32 +03:00
Tom Schuster
8bc1f5ada8 Bug 1558915 - Use infallible nsIURI::SchemeIs in various places r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D40677

--HG--
extra : moz-landing-system : lando
2019-08-07 09:36:56 +00:00
Razvan Maries
eedbf1137f Backed out changeset b197ca57677a (bug 1558915) for build bustages. CLOSED TREE 2019-08-07 01:04:43 +03:00
Tom Schuster
03c7998ef2 Bug 1558915 - Use infallible nsIURI::SchemeIs in various places r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D40677

--HG--
extra : moz-landing-system : lando
2019-08-06 20:19:41 +00:00
Mark Banner
e88940a4dc Bug 1554162 - Enable ESLint for startupcache/. r=froydnj
Depends on D32493

Differential Revision: https://phabricator.services.mozilla.com/D32494

--HG--
rename : startupcache/test/browser.ini => startupcache/test/browser/browser.ini
rename : startupcache/test/browser_startupcache_telemetry.js => startupcache/test/browser/browser_startupcache_telemetry.js
extra : moz-landing-system : lando
2019-05-25 02:07:26 +00:00
Mike Conley
ddb4502ec8 Bug 1544037 - Skip exists check when trying to open startupcache zip file archive. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31086

--HG--
extra : moz-landing-system : lando
2019-05-21 17:32:45 +00:00
Andreea Pavel
846e7d0d9b Backed out 2 changesets (bug 1544037) for build bustages at StartupCache.cpp on a CLOSED TREE
Backed out changeset 8242c6c52f6c (bug 1544037)
Backed out changeset c19e86931d1a (bug 1544037)
2019-05-21 17:06:26 +03:00
Mike Conley
8cfb70661e Bug 1544037 - Skip exists check when trying to open startupcache zip file archive. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31086

--HG--
extra : moz-landing-system : lando
2019-05-16 18:53:59 +00:00
Sylvestre Ledru
e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Gijs Kruitbosch
8ea5584575 Bug 1543970 - give up removing the startup cache file from the previous profile location after 6 years, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D27280

--HG--
extra : moz-landing-system : lando
2019-04-12 14:07:40 +00:00
Mark Banner
444bfa1fba Bug 1536091 - Relax the startup cache test restrictions to account for QuantumBar not loading search-one-offs.js. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D26684

--HG--
extra : moz-landing-system : lando
2019-04-11 07:20:16 +00:00
Gijs Kruitbosch
1e96300cf3 Bug 1353013 - create preloaded newtab browser from an idle task, only in top window(s), r=dthayer
This limits us to 1 preloaded browser per window, in the top 3 normal windows + top 3 private windows.
If we try to create additional browsers beyond that, we instead move a pre-existing browser across.

Differential Revision: https://phabricator.services.mozilla.com/D21129

--HG--
extra : moz-landing-system : lando
2019-03-19 17:29:48 +00:00
shindli
a7af1edc71 Backed out 3 changesets (bug 1353013) for a11y failures in accessible/tests/mochitest/relations/test_tabbrowser.xul CLOSED TREE
Backed out changeset af8bce2330e9 (bug 1353013)
Backed out changeset a3d1302b06c0 (bug 1353013)
Backed out changeset 976afd1adf84 (bug 1353013)
2019-03-18 18:21:16 +02:00
Gijs Kruitbosch
e306931fb1 Bug 1353013 - create preloaded newtab browser from an idle task, only in top window(s), r=dthayer
This limits us to 1 preloaded browser per window, in the top 3 normal windows + top 3 private windows.
If we try to create additional browsers beyond that, we instead move a pre-existing browser across.

Differential Revision: https://phabricator.services.mozilla.com/D21129

--HG--
extra : moz-landing-system : lando
2019-03-12 14:34:39 +00:00
Doug Thayer
55db157391 Bug 1364235 - Collect telemetry stats on startup cache hits and misses r=kmag
In bug 1264235 we have some indication that observed bugs with the
startup cache might have been resolved, but we don't really know
until we collect data. Collecting these stats will give us the
ability to have more certainty that the startup cache is functioning
correctly in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D19573

--HG--
extra : moz-landing-system : lando
2019-03-05 16:52:57 +00:00
Alex Gaynor
0e903787da Bug 1415508 - use Span in constructing a byte input stream; r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D20687

--HG--
extra : moz-landing-system : lando
2019-02-25 19:11:20 +00:00
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Ehsan Akhgari
490e611801 Bug 1508472 - Part 5: Fifth batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

Differential Revision: https://phabricator.services.mozilla.com/D13371

--HG--
extra : moz-landing-system : lando
2018-11-29 10:30:46 +00:00
Gabriele Svelto
266ef73c96 Bug 1503207 - Remove nsWeakPtr.h and cleanup all files including weak reference-related headers r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D10251

--HG--
extra : moz-landing-system : lando
2018-10-31 20:39:03 +00:00
Andrew McCreight
837f0af066 Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.

Differential Revision: https://phabricator.services.mozilla.com/D6861

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:01 +00:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Eric Rahm
0e7bb34ef8 Bug 1439047 - Part 2: Cleanup StartupCache::PutBuffer hashtable usage. r=froydnj
This switches over to using `LookupForAdd` which allows us to avoid a second
lookup when adding the entry. Addtionally `nsDependentCString` is used to
avoid copying the id string when looking up the entry.

--HG--
extra : rebase_source : 2dbb54fb992f4c79347150198af61438ee5b4eec
extra : source : 718961d941d4d495426e59c6b5044302059489f9
2018-02-16 15:58:30 -08:00
Eric Rahm
7337adec45 Bug 1439047 - Part 1: Make StartupCache::PutBuffer take ownership of the buffer. r=froydnj
This avoids a redundant alloc and copy in `PutBuffer`. All existing callers
were destroying the passed in buffer after the call.

--HG--
extra : rebase_source : 065505219d70d26bad49c7eba2cec8edf0e9939d
extra : amend_source : 118eddad4dc901da02817c788fb98f6f4c85a3f0
extra : source : 7f0cedfb4bd85bfe1a523168019864c9c6c0e665
2018-02-16 15:30:47 -08:00
Narcis Beleuzu
01dffd73eb Backed out 2 changesets (bug 1439047) for Android build bustages. CLOSED TREE
Backed out changeset 718961d941d4 (bug 1439047)
Backed out changeset 7f0cedfb4bd8 (bug 1439047)
2018-02-24 01:10:22 +02:00
Eric Rahm
340c6c4613 Bug 1439047 - Part 2: Cleanup StartupCache::PutBuffer hashtable usage. r=froydnj
This switches over to using `LookupForAdd` which allows us to avoid a second
lookup when adding the entry. Addtionally `nsDependentCString` is used to
avoid copying the id string when looking up the entry.

--HG--
extra : rebase_source : e929431b4ab277345e455fb0b220a8aa6839b37f
2018-02-16 15:58:30 -08:00
Eric Rahm
8b8acc64f2 Bug 1439047 - Part 1: Make StartupCache::PutBuffer take ownership of the buffer. r=froydnj
This avoids a redundant alloc and copy in `PutBuffer`. All existing callers
were destroying the passed in buffer after the call.

--HG--
extra : rebase_source : 39a21686becedf32c38e58fa832ae47845b2f5e0
2018-02-16 15:30:47 -08:00
Masatoshi Kimura
4872102e9d Bug 1428557 - Stop using GetNativePath in xpcom/. r=froydnj
MozReview-Commit-ID: GnSFQ1wprzb

--HG--
extra : rebase_source : 7c25e0361d7f4e8aea730672a931cf78a581e062
extra : intermediate-source : e055aee7306b6636d27abe6fc0b02012b0075260
extra : source : d0831f473c8f85996c106693c9a4ce3783dd9447
2017-12-15 06:53:37 +09:00
Valentin Gosu
da90b10e9f Bug 1431204 - Change calls to nsIURI.spec setter to use nsIURIMutator instead r=mayhemer
* changes call to use nsIURIMutator.setSpec()
* Add new NS_MutateURI constructor that takes new Mutator object
* Make nsSimpleNestedURI::Mutate() and nsNestedAboutURI::Mutate() return mutable URIs
* Make the finalizers for nsSimpleNestedURI and nsNestedAboutURI make the returned URIs immutable

MozReview-Commit-ID: 1kcv6zMxnv7

--HG--
extra : rebase_source : 99b13e9dbc8eaaa9615843b05e1539e19b527504
2018-01-19 15:19:42 +01:00
Andrew McCreight
09ab49e463 Bug 1410471 - Remove StartupCacheWrapper and friends. r=froydnj
This class was needed for testing, but no longer.

MozReview-Commit-ID: AIk0kKlbScs

--HG--
extra : rebase_source : 35eed188e44dc4c9899479b35882461dd2cf4624
2017-10-20 10:40:50 -07:00
Andrew McCreight
5738242a26 Bug 1408017 - Clear gStartupCacheWrapper in the dtor. r=froydnj 2017-10-26 16:47:27 -04:00
Kris Maglione
257d9118dc Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj
Right now, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR expects singleton
constructors to return already-addrefed raw pointers, and while it accepts
constructors that return already_AddRefed, most existing don't do so.

Meanwhile, the convention elsewhere is that a raw pointer return value is
owned by the callee, and that the caller needs to addref it if it wants to
keep its own reference to it.

The difference in convention makes it easy to leak (I've definitely caused
more than one shutdown leak this way), so it would be better if we required
the singleton getters to return an explicit already_AddRefed, which would
behave the same for all callers.


This also cleans up several singleton constructors that left a dangling
pointer to their singletons when their initialization methods failed, when
they released their references without clearing their global raw pointers.

MozReview-Commit-ID: 9peyG4pRYcr

--HG--
extra : rebase_source : 2f5bd89c17cb554541be38444672a827c1392f3f
2017-10-16 21:08:42 -07:00
Kris Maglione
4a767c7e6e Bug 1404198: Part 2j - Switch to NS_NewTimer* everywhere else. r=njn
MozReview-Commit-ID: LmGIgfmNSmk

--HG--
extra : rebase_source : bf34e852beb0c8f6eafd09184c2e0cda95f95f83
2017-09-24 19:57:48 -07:00
Kris Maglione
3876d40960 Bug 1404198: Part 1 - Add non-virtual constructor for nsIObject(Input|Output)Stream and update existing callers. r=njn
MozReview-Commit-ID: 3eoh6AwDJyz

--HG--
extra : rebase_source : 92b18b6ef07d276cac79ce735ca0b592cffbf87e
2017-10-04 20:06:28 -07:00
Nicholas Nethercote
8a68e6fb83 Bug 1403868 (part 4) - Reduce tools/profiler/public/*.h to almost nothing in non-MOZ_GECKO_PROFILER builds. r=mstange.
Currently the Gecko Profiler defines a moderate amount of stuff when
MOZ_GECKO_PROFILER is undefined. It also #includes various headers, including
JS ones. This is making it difficult to separate Gecko's media stack for
inclusion in Servo.

This patch greatly simplifies how things are exposed. The starting point is:

- GeckoProfiler.h can be #included unconditionally;

- everything else from the profiler must be guarded by MOZ_GECKO_PROFILER.

In practice this introduces way too many #ifdefs, so the patch loosens it by
adding no-op macros for a number of the most common operations.

The net result is that #ifdefs and macros are used a bit more, but almost
nothing is exposed in non-MOZ_GECKO_PROFILER builds (including
ProfilerMarkerPayload.h and GeckoProfiler.h), and understanding what is exposed
is much simpler than before.

Note also that in BHR, ThreadStackHelper is now entirely absent in
non-MOZ_GECKO_PROFILER builds.
2017-10-04 09:11:18 +11:00
Eric Rahm
fe18bf0131 Bug 1386825 - Part 4: Remove remaining instances of MOZ_B2G. r=froydnj
MozReview-Commit-ID: 8r4eMwiZ4Vg
2017-08-08 14:41:09 -07:00
Masatoshi Kimura
f143125cc2 Bug 1326520 - Rename nsIURI.path to pathQueryRef. r=valentin.gosu
MozReview-Commit-ID: DqJdTGopR9G

--HG--
extra : rebase_source : e8c9eb03468c075b79013b6e0bd8b367229c24cd
2017-07-29 20:50:21 +09:00
Kris Maglione
b136b1f059 Bug 1383215: Part 2 - Split out URI resolution code into ResolveURI helper. r=mccr8
MozReview-Commit-ID: Bfr67WQPq9l

--HG--
extra : rebase_source : bbf9090d03c15d6c541aec12b090ab4dadcdab68
extra : histedit_source : 68a54268e601c1cb7521abb305fad2288ab4a03a
2017-07-21 15:12:32 -07:00
Sylvestre Ledru
4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Nicholas Nethercote
58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Nicholas Nethercote
033f83145c Bug 1375387 - Reorder and section-ify GeckoProfiler.h. r=mstange.
This patch gives some structure and order to the profiler's API.

It also renames AutoProfilerRegister as AutoProfilerRegisterThread, to match
profiler_register_thread().
2017-06-22 14:28:47 +10:00