Commit Graph

60146 Commits

Author SHA1 Message Date
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
Kris Maglione
d33959634b Bug 1359653: Part 4 - Fallback to the default JS version when decoding regexps off-thread. r=shu
When decoding off-thread, we can't safely access the JS runtime to get the
current JS version, and doing so causes failed assertions.

MozReview-Commit-ID: Lra437aa8SM

--HG--
extra : source : 16259c1af36e138881d18a3f8b0a803f5d4fc3ec
2017-04-28 11:55:52 -07:00
Kris Maglione
16393582a7 Bug 1359653: Part 2 - Allow CloneAndExecuteScript with non-lexical scripts. r=shu
MozReview-Commit-ID: Hq3rvgjwH3f

--HG--
extra : source : 3f94cd9d95b99436ea5f77aee5d220092b6b32d6
2017-05-02 17:53:51 -07:00
Kris Maglione
81232b555a Bug 1359653: Part 1 - Use a const Range rather than a Vector for XDR decoding. r=shu
MozReview-Commit-ID: JkGNmOAKAxD

--HG--
extra : source : 473e6a1ef169a9ac556486680306b9c286774b74
2017-05-05 15:47:10 -07:00
Sebastian Hengst
6107141ae1 Backed out changeset 473e6a1ef169 (bug 1359653) for rooting hazard and crashing during Marionette's test_quit_restart.py TestQuitRestart.test_in_app_restart_with_callback with [@ js::gc::MergeCompartments] on Linux debug builds. r=backout 2017-05-06 11:06:46 +02:00
Sebastian Hengst
2ca2a7bdb3 Backed out changeset 3f94cd9d95b9 (bug 1359653) 2017-05-06 11:02:37 +02:00
Sebastian Hengst
7238fa169d Backed out changeset 16259c1af36e (bug 1359653) 2017-05-06 11:02:27 +02: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
Kris Maglione
81b48ae1b9 Bug 1359653: Part 4 - Fallback to the default JS version when decoding regexps off-thread. r=shu
When decoding off-thread, we can't safely access the JS runtime to get the
current JS version, and doing so causes failed assertions.

MozReview-Commit-ID: Lra437aa8SM

--HG--
extra : rebase_source : 268fc90f390cf6436f3e8a1368a62fdf274d6f8d
2017-04-28 11:55:52 -07:00
Kris Maglione
5d707d3813 Bug 1359653: Part 2 - Allow CloneAndExecuteScript with non-lexical scripts. r=shu
MozReview-Commit-ID: Hq3rvgjwH3f

--HG--
extra : rebase_source : ce51a28985bf73e8f1370e9e767b016b5399d3c8
2017-05-02 17:53:51 -07:00
Kris Maglione
83a89ed6b9 Bug 1359653: Part 1 - Use a const Range rather than a Vector for XDR decoding. r=shu
MozReview-Commit-ID: JkGNmOAKAxD

--HG--
extra : rebase_source : 77f0cae4b964b216e0a79a415fa8f88fcad08730
2017-05-05 15:47:10 -07:00
Gary Kwong
a6f9d2dd99 Bug 1360220 - Backed out changeset ed8623eefe6c for causing fuzzblocker bug 1362590, rs=shu on IRC 2017-05-05 16:04:52 -07:00
Shu-yu Guo
e418f8fd1b Bug 1361317 - Check Annex B applicability upon Scope exit. (r=anba)
The algorithm:

1. Keep a list of all sloppy functions-in-block FunctionBoxes on the
   innermost scope.

2. When the scope exits, we'll know all its declared names. Check for possible
   early errors for declaring the FiBs as vars. If no early error would occur,

  a. If the innermost scope is the var scope, declare the synthesized
     var and mark the FunctionBox as an Annex B function.

  b. Otherwise, add the FunctionBox to the enclosing scope's list of
     sloppy FiBs.
2017-05-05 13:01:02 -07:00
Shu-yu Guo
82312e2b6b Bug 1161312 - De-offset ScriptSource offsets from starting column in JSScript and LazyScript. (r=jimb)
The JS shell, for testing purposes, allows passing in an OOB column
number, which offsets all token positions by column. These positions
need to be de-offset before being saved as offsets into the
ScriptSource buffer in the script structures.
2017-05-05 13:01:02 -07:00
Carsten "Tomcat" Book
170faef00b Merge mozilla-central to mozilla-inbound 2017-05-05 15:25:16 +02:00
Carsten "Tomcat" Book
fdc689ba16 merge mozilla-inbound to mozilla-central a=merge 2017-05-05 15:17:26 +02:00
Cameron McCormack
14b955a5aa Bug 1361985 - Whitelist Gecko_NewGridTemplateAreasValue from heap write hazard checking, since it pokes at stuff in the object it just created. r=me (CLOSED TREE)
--HG--
extra : amend_source : be20cfdd93de65557b1e343504051c476e17db24
2017-05-05 15:43:37 +08:00
André Bargull
47ef6bdc32 Bug 1360201 - Emit |dup| instead of |dupat 0| when BytecodeEmitter::emitDupAt is called with zero. r=shu 2017-04-27 10:10:03 -07:00
André Bargull
2fefcdbbf3 Bug 1360220 - Replace emitRequireObjectCoercible with JSOP_CHECKOBJCOERCIBLE. r=shu 2017-04-27 09:24:08 -07:00
Benjamin Bouvier
1560f3b506 Bug 1360263: Move WasmActivation::resumePC to the Runtime; r=luke
--HG--
extra : rebase_source : ad02eb061057dec3cff4d2408803c0e47450d5fc
2017-04-27 18:22:05 +02:00
Jon Coppeard
d6029d3ebb Bug 1360526 - Refactor to remove GCSweepTask and associated macros r=sfink 2017-05-04 18:06:59 +01:00
Jon Coppeard
9958de3edd Bug 1360526 - Make weak cache iteration more readable r=sfink 2017-05-04 18:06:58 +01:00
Benjamin Bouvier
87a000b325 Bug 1360211: Remove EntryFrameLayout; r=jandem
--HG--
extra : rebase_source : 0fc6669c8d11d8adce3e366c371b4702d2ede134
2017-04-26 18:31:26 +02:00
Benjamin Bouvier
c3dbe8b3b3 Bug 1360211: Remove dead CalleeStackOffset; r=jandem
--HG--
extra : rebase_source : 7c29864e3028510118b7826f0dede5db697a92ca
2017-04-26 17:46:14 +02:00
Benjamin Bouvier
b3dc24542f Bug 1352506: Don't conflate need for overrecursed check and static alignment in MIRGenerator; r=jandem
--HG--
extra : rebase_source : 6bded02c13b2456082925647c062b9f52e0c9a93
extra : histedit_source : 934351707818b5f3b34c83e18b5ccfba94b46ff3
2017-04-27 15:44:45 +02:00
Benjamin Bouvier
b8c8ba37aa Bug 1352506: Automatically setPerformsCall for LIR call instructions; r=sunfish
--HG--
extra : rebase_source : e226d4d32fa5ad2cdbf58358e75a4089bdb3e6a0
extra : histedit_source : df914d85202d06df5e151dacc50076b179afb46b
2017-04-26 14:40:37 +02:00
Benjamin Bouvier
e9db04ce5c Bug 1352506: Remove dead code in the backtracking allocator; r=luke
--HG--
extra : rebase_source : 5f5e5b5b9b63bb33d15b4db746eba5847991ea19
extra : histedit_source : 33be51bcff189c6fa6609971a08060de7c4b667d
2017-04-26 14:15:30 +02:00
André Bargull
11d5f06b77 Bug 1339395 - Part 8: Add separate variables for wasm debugger test. r=luke
--HG--
extra : rebase_source : cc888ae9dc5b12cee8ae17a95a8f6f9f9cfd81d7
2017-05-04 05:05:45 -07:00
André Bargull
70b1515945 Bug 1339395 - Part 7: Remove no longer needed check for jsid strings which are indices from frontend. r=shu
--HG--
extra : rebase_source : ee734791215296af25cffe86e1a7a18ad3570b19
2017-05-04 05:05:42 -07:00
André Bargull
4dd3aab942 Bug 1339395 - Part 6: Update jit-tests now that object rest/spread properties are a thing. r=shu
--HG--
extra : rebase_source : b74c267295c836c13352e9d8d403f551883d047f
2017-05-04 05:05:39 -07:00
André Bargull
ed0327889b Bug 1339395 - Part 5: Add Reflect.parse tests for object rest and spread properties. r=shu
--HG--
extra : rebase_source : f159c69ff169e254d1c2e5f9265ff6447a2288cf
2017-05-04 05:05:36 -07:00
André Bargull
fd633859dd Bug 1339395 - Part 4: Enable test262 for object rest and spread properties. r=shu
--HG--
extra : rebase_source : ed724580c129f7dd83e51164e7a640fe3d8abb29
2017-05-04 05:05:33 -07:00
André Bargull
b7760379c9 Bug 1339395 - Part 3: Add BytecodeEmitter support for object rest and spread properties. r=shu
--HG--
extra : rebase_source : 7ff5f952d7c55ee0ca45e6090dcee4f29bc149b9
2017-05-04 05:05:29 -07:00
André Bargull
7a954e2045 Bug 1339395 - Part 2: Add parser support for rest and spread object properties. r=shu
--HG--
extra : rebase_source : 2ee4578189fc96180313bcb2b37cb62bda494bc1
2017-05-04 05:05:26 -07:00
André Bargull
ad3c9ffb5f Bug 1339395 - Part 1: Align parse method for object literals to match array literals. r=shu
--HG--
extra : rebase_source : 775bb7d7b13870d0da1546279d39c9d09ee6bd08
2017-05-04 05:05:22 -07:00
André Bargull
3684744df4 Bug 1321789 - Support Unicode extensions with multiple value subtags in BCP47 language tags. r=Waldo
--HG--
extra : rebase_source : e53994788a06eda8435c314735d22410f45b2c81
2017-05-04 05:04:14 -07:00
Benjamin Bouvier
7e59b2c7b6 Bug 1360390: wasm: Preserve the scratch register in builtin thunks if it's volatile; r=luke
Callable prologues/epilogues use the ABINonArgReg0 register as a scratch
register, which is non-volatile on ARM. This means it can get clobbered.
Instead, just preserve it manually.

--HG--
extra : rebase_source : 290f2a7a5cf2ad0240cf9775b411615f94ac5a16
2017-05-04 13:07:52 +02:00
Lars T Hansen
c49dee9e16 Bug 1361980 - Increase a lock priority to avoid conflict during sync deletion, r=me 2017-05-04 13:42:36 +02:00
André Bargull
f21754e0f3 Bug 1317383 - Part 5: Update expected results for wpt typedarray and wasm tests. r=bbouvier
--HG--
extra : rebase_source : 47be2308322e996fa8bef359d5f1b523fac9801e
2017-05-02 14:21:04 -07:00
André Bargull
230ddb3718 Bug 1317383 - Part 4: Add step references to TypedArray constructor methods. r=evilpie
--HG--
extra : rebase_source : 142807e64cb1e801c8a6d7c44b3c4f53fa39d4a6
2017-04-26 05:31:21 -07:00
André Bargull
eef3017b4b Bug 1317383 - Part 3: Use ToIndex when TypedArray constructor is called with ArrayBuffer (ES2017). r=evilpie
--HG--
extra : rebase_source : a9a5eb558303a7182c7a1607d260d90ebf57b937
2017-04-25 09:36:00 -07:00
André Bargull
9f71beec84 Bug 1317383 - Part 2: Use ToIndex when constructing TypedArray with length argument (ES2017). r=evilpie
--HG--
extra : rebase_source : 52beaa7ab1972d24cc3f8a45d1f0c4d63f549df5
2017-05-02 14:20:25 -07:00