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

139 Коммитов

Автор SHA1 Сообщение Дата
Nicolas B. Pierron 7d50cd5850 Bug 1774796 - Add largest-first delazification strategy. r=arai
This patch adds a new off-thread delazification strategy, which adds a bit of
overhead to queue function with a priority order, which put the largest function
as the first functions to be delazified.

The intent of this new strategy is to limit the usage of main-thread
delazification to the smallest function, in case where the main-thread would win
the delazification race.

Differential Revision: https://phabricator.services.mozilla.com/D149651
2022-06-20 13:33:49 +00:00
Sylvestre Ledru 42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Nicolas B. Pierron 4d3d87d56e Bug 1756003 part 2 - Compare concurrent and on-demand delazification. r=arai
Adds a delazification mode, which spawn a concurrent depth-first delazification
of all function to fill the stencil cache, to later compare cached results with
stencils produced by on-demand delazification.

The delazification mode also works when being used from a main-thread top-level
compilation, in which case the delazification tasks are created and potentially
blocking the main thread, while the delazification is happening.

This way of doing help comparing on-demand delazification, based on instantiated
stencils with concurrent delazification, based on stencils. Which is a good
mode for fuzzing purposes.

Differential Revision: https://phabricator.services.mozilla.com/D145992
2022-05-17 10:53:04 +00:00
Iulian Moraru aa0ddc72c9 Backed out 3 changesets (bug 1756003) for causing multiple thread sanitizer failures. CLOSED TREE
Backed out changeset cf1af3ce0798 (bug 1756003)
Backed out changeset 672e8694ef7d (bug 1756003)
Backed out changeset 3b6f96fb26fa (bug 1756003)
2022-05-14 04:00:29 +03:00
Tooru Fujisawa 4689a44e09 Bug 1766761 - Part 1: Add compile option to de-optimize module global variables. r=jonco
This is necessary for putting all global `var`s in `ModuleEnvironmentObject`,
instead of local slot, so that they're accessible in Part 4 patch.

Differential Revision: https://phabricator.services.mozilla.com/D146033
2022-05-13 22:02:38 +00:00
Cristian Tuns 2bea2f32be Backed out 8 changesets (bug 1766976, bug 1768922, bug 1769029, bug 1766761, bug 1768060) for causing spidermonkey failures on Modules.cpp CLOSED TREE
Backed out changeset da102935dfd2 (bug 1769029)
Backed out changeset e080258f38a7 (bug 1768922)
Backed out changeset 36e9e0301a24 (bug 1766976)
Backed out changeset dd28b0eb27ef (bug 1768060)
Backed out changeset 682c4afbcfe9 (bug 1766761)
Backed out changeset a7a37e912b90 (bug 1766761)
Backed out changeset d8099b6d970b (bug 1766761)
Backed out changeset 435acc6d6abd (bug 1766761)
2022-05-13 12:49:49 -04:00
Nicolas B. Pierron 8a874a8014 Bug 1756003 part 2 - Compare concurrent and on-demand delazification. r=arai
Adds a delazification mode, which spawn a concurrent depth-first delazification
of all function to fill the stencil cache, to later compare cached results with
stencils produced by on-demand delazification.

The delazification mode also works when being used from a main-thread top-level
compilation, in which case the delazification tasks are created and potentially
blocking the main thread, while the delazification is happening.

This way of doing help comparing on-demand delazification, based on instantiated
stencils with concurrent delazification, based on stencils. Which is a good
mode for fuzzing purposes.

Differential Revision: https://phabricator.services.mozilla.com/D145992
2022-05-13 16:41:29 +00:00
Tooru Fujisawa 5cb4889325 Bug 1766761 - Part 1: Add compile option to de-optimize module global variables. r=jonco
This is necessary for putting all global `var`s in `ModuleEnvironmentObject`,
instead of local slot, so that they're accessible in Part 4 patch.

Differential Revision: https://phabricator.services.mozilla.com/D146033
2022-05-13 15:23:14 +00:00
Bogdan Szekely c77f0e3113 Backed out 4 changesets (bug 1756003, bug 1764280) for causing build bustages on ScriptLoader.cpp. CLOSED TREE
Backed out changeset 51b6c13941b6 (bug 1764280)
Backed out changeset 399a9a92ff78 (bug 1756003)
Backed out changeset 2dc65ba6edce (bug 1756003)
Backed out changeset 5b982beda860 (bug 1756003)
2022-05-13 15:48:34 +03:00
Nicolas B. Pierron a0fea91aea Bug 1756003 part 2 - Compare concurrent and on-demand delazification. r=arai
Adds a delazification mode, which spawn a concurrent depth-first delazification
of all function to fill the stencil cache, to later compare cached results with
stencils produced by on-demand delazification.

The delazification mode also works when being used from a main-thread top-level
compilation, in which case the delazification tasks are created and potentially
blocking the main thread, while the delazification is happening.

This way of doing help comparing on-demand delazification, based on instantiated
stencils with concurrent delazification, based on stencils. Which is a good
mode for fuzzing purposes.

Differential Revision: https://phabricator.services.mozilla.com/D145992
2022-05-13 12:19:46 +00:00
Jon Coppeard 690922317a Bug 1432901 - Part 13: Re-enable compile option to disallow top-level await r=yulia
Differential Revision: https://phabricator.services.mozilla.com/D145795
2022-05-10 12:58:10 +00:00
Nicolas B. Pierron 2a3a2f2c85 Bug 1760333 - Add CompilationInput::dump function. r=arai
This patch adds the ability to dump most of the content of CompilationInput.

To avoid adding extra dependencies in CompileOptions.h, a method named
`dumpWith` is added, and uses a template parameter to let the caller implement
what has to be done for each fields, with the expectation that C++ overloading
would be used to distinguish between the various types.

Differential Revision: https://phabricator.services.mozilla.com/D141511
2022-03-22 13:48:12 +00:00
Nicolas B. Pierron 95eb456ef7 Bug 1753709 - JavaScript: Add a preference to switch between delazification strategies. r=arai
This patch changes the way we parse JavaScript coming from Necko while loading
web pages, by adding an about:config flag named
javascript.options.delazification.strategy which is used to select between:

 0 - On Demand
 1 - Concurrent Depth First
 255 - Parse Everything Eagerly

Previously, we moved from On-demand delazification, to parsing everything
eagerly to improve responsiveness of the browser, but we knew that more room for
optimization exists.

This toogle is meant to explore the space of delazification strategies, such
that we can parse functions of JavaScript files on an helper thread, while the
JavaScript file is being executed on the main thread. The space of
delazification strategies goes from ordering the order in which functions are
processed, as well as filtering functions which are processed. Not all functions
have to be delazified, and if the main thread needs a function which is not
parsed yet, it will fallback to parsing it on-demand.

Differential Revision: https://phabricator.services.mozilla.com/D138034
2022-03-01 15:00:03 +00:00
Nicolas B. Pierron 4a30e45969 Bug 1753709 - Remove unused DelazificationOption. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D138339
2022-03-01 15:00:03 +00:00
Matthew Gaudet 263eb08d2e Bug 1757035 - Remove Class static block preference code r=arai
Depends on D139653

Differential Revision: https://phabricator.services.mozilla.com/D139654
2022-02-25 02:29:12 +00:00
Matthew Gaudet 6722233332 Bug 1756204 - Remove Private Field (and method) Preferences r=arai
Depends on D139652

Differential Revision: https://phabricator.services.mozilla.com/D139653
2022-02-25 02:29:12 +00:00
Cristian Tuns c82feaecab Backed out 3 changesets (bug 1753709) for causing mochitest failures on test_delazification_strategy.html CLOSED TREE
Backed out changeset b908fc38d2d3 (bug 1753709)
Backed out changeset 56a169a692b9 (bug 1753709)
Backed out changeset 224f4cf66993 (bug 1753709)
2022-02-22 11:44:40 -05:00
Nicolas B. Pierron 01430ae030 Bug 1753709 - JavaScript: Add a preference to switch between delazification strategies. r=arai
This patch changes the way we parse JavaScript coming from Necko while loading
web pages, by adding an about:config flag named
javascript.options.delazification.strategy which is used to select between:

 0 - On Demand
 1 - Concurrent Depth First
 255 - Parse Everything Eagerly

Previously, we moved from On-demand delazification, to parsing everything
eagerly to improve responsiveness of the browser, but we knew that more room for
optimization exists.

This toogle is meant to explore the space of delazification strategies, such
that we can parse functions of JavaScript files on an helper thread, while the
JavaScript file is being executed on the main thread. The space of
delazification strategies goes from ordering the order in which functions are
processed, as well as filtering functions which are processed. Not all functions
have to be delazified, and if the main thread needs a function which is not
parsed yet, it will fallback to parsing it on-demand.

Differential Revision: https://phabricator.services.mozilla.com/D138034
2022-02-22 14:59:17 +00:00
Nicolas B. Pierron 08d4fb865e Bug 1753709 - Remove unused DelazificationOption. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D138339
2022-02-22 14:59:17 +00:00
Marian-Vasile Laza 3f7e0b2d4f Backed out 3 changesets (bug 1753709) for causing build bustages on ScriptLoader.cpp. CLOSED TREE
Backed out changeset eb7704e8a30c (bug 1753709)
Backed out changeset 193409767cf2 (bug 1753709)
Backed out changeset 891174ee20ee (bug 1753709)
2022-02-21 09:45:40 -08:00
Nicolas B. Pierron e6b364b472 Bug 1753709 - JavaScript: Add a preference to switch between delazification strategies. r=arai
This patch changes the way we parse JavaScript coming from Necko while loading
web pages, by adding an about:config flag named
javascript.options.delazification.strategy which is used to select between:

 0 - On Demand
 1 - Concurrent Depth First
 255 - Parse Everything Eagerly

Previously, we moved from On-demand delazification, to parsing everything
eagerly to improve responsiveness of the browser, but we knew that more room for
optimization exists.

This toogle is meant to explore the space of delazification strategies, such
that we can parse functions of JavaScript files on an helper thread, while the
JavaScript file is being executed on the main thread. The space of
delazification strategies goes from ordering the order in which functions are
processed, as well as filtering functions which are processed. Not all functions
have to be delazified, and if the main thread needs a function which is not
parsed yet, it will fallback to parsing it on-demand.

Differential Revision: https://phabricator.services.mozilla.com/D138034
2022-02-21 17:26:03 +00:00
Nicolas B. Pierron d6e0c74306 Bug 1753709 - Remove unused DelazificationOption. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D138339
2022-02-21 17:26:03 +00:00
Marian-Vasile Laza 28f5fc0dc0 Backed out 3 changesets (bug 1753709) for causing build bustages on ScriptLoader.cpp. CLOSED TREE
Backed out changeset 8d2f548f2b46 (bug 1753709)
Backed out changeset 9d41db9f2e17 (bug 1753709)
Backed out changeset 13dbf5b806ec (bug 1753709)
2022-02-16 18:51:37 +02:00
Nicolas B. Pierron 85b56fc607 Bug 1753709 - JavaScript: Add a preference to switch between delazification strategies. r=arai
This patch changes the way we parse JavaScript coming from Necko while loading
web pages, by adding an about:config flag named
javascript.options.delazification.strategy which is used to select between:

 0 - On Demand
 1 - Concurrent Depth First
 255 - Parse Everything Eagerly

Previously, we moved from On-demand delazification, to parsing everything
eagerly to improve responsiveness of the browser, but we knew that more room for
optimization exists.

This toogle is meant to explore the space of delazification strategies, such
that we can parse functions of JavaScript files on an helper thread, while the
JavaScript file is being executed on the main thread. The space of
delazification strategies goes from ordering the order in which functions are
processed, as well as filtering functions which are processed. Not all functions
have to be delazified, and if the main thread needs a function which is not
parsed yet, it will fallback to parsing it on-demand.

Differential Revision: https://phabricator.services.mozilla.com/D138034
2022-02-16 11:01:33 +00:00
Nicolas B. Pierron 4f7cb4fbd0 Bug 1753709 - Remove unused DelazificationOption. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D138339
2022-02-16 11:01:32 +00:00
Nicolas B. Pierron 5f4d269659 Bug 1715976 - Add DelazificationOption type. r=arai
Previously, we had only 2 modes, either we delazify everything on demand, when
the code is being executed, or we delazify everything ahead when doing the
syntax parsing.

These 2 modes will have to be refined in the future, to reduce the number of
delazified function which are written in the bytecode cache, and to eagerly and
concurrently delazify function out-side the main-thread and out-side the syntax
parsing phase.

This change add a `DelazificationOption` type to enumerate the various modes
which could be a middle ground between these 2 options, and replaces the
`forceFullParse_` flag, as it is a specialized case of the delazification
option.

Differential Revision: https://phabricator.services.mozilla.com/D136336
2022-01-27 17:02:14 +00:00
Tooru Fujisawa fbb9c44cf3 Bug 1734098 - Part 11: Add JS::DecodeStencilOffThread. r=tcampbell
Also make JS::CanDecodeOffThread to receive JS::DecodeOptions.

Differential Revision: https://phabricator.services.mozilla.com/D133052
2021-12-10 04:28:29 +00:00
Tooru Fujisawa f2f5da13ab Bug 1744178 - Add JS::InstantiationStorage. r=nbp
In order to support allocating CompilationGCOutput off main thread with
stencil-based off-thread API, add public type that wraps CompilationGCOutput,
and make stencil-based off-thread API return pre-allocated CompilationGCOutput
if the `options.allocateInstantiationStorage` is true.

Differential Revision: https://phabricator.services.mozilla.com/D133041
2021-12-10 04:28:25 +00:00
Iulian Moraru 777ce42897 Backed out 17 changesets (bug 1744178, bug 1734098) for causing leaks. CLOSED TREE
Backed out changeset 08070838c7d2 (bug 1734098)
Backed out changeset cfdf7ed9a5a2 (bug 1734098)
Backed out changeset 02d7ca7fc45c (bug 1734098)
Backed out changeset 7b7c59fc644b (bug 1734098)
Backed out changeset 630055366dac (bug 1734098)
Backed out changeset da83b4571cf2 (bug 1734098)
Backed out changeset 323af9d3e0e1 (bug 1734098)
Backed out changeset cf458ad5345a (bug 1734098)
Backed out changeset a85846f79eb5 (bug 1734098)
Backed out changeset 0d07931e6bc8 (bug 1734098)
Backed out changeset ffd72fa3fc59 (bug 1734098)
Backed out changeset 3174f1ecfd03 (bug 1734098)
Backed out changeset cfb19671fd4e (bug 1734098)
Backed out changeset c3b9c8221059 (bug 1734098)
Backed out changeset 532328aedaaa (bug 1734098)
Backed out changeset 48aa5ca15135 (bug 1734098)
Backed out changeset 6ca5bceb693c (bug 1744178)
2021-12-09 23:36:34 +02:00
Tooru Fujisawa 7238b56ae6 Bug 1734098 - Part 11: Add JS::DecodeStencilOffThread. r=tcampbell
Also make JS::CanDecodeOffThread to receive JS::DecodeOptions.

Differential Revision: https://phabricator.services.mozilla.com/D133052
2021-12-09 18:21:13 +00:00
Tooru Fujisawa 144be37fce Bug 1744178 - Add JS::InstantiationStorage. r=nbp
In order to support allocating CompilationGCOutput off main thread with
stencil-based off-thread API, add public type that wraps CompilationGCOutput,
and make stencil-based off-thread API return pre-allocated CompilationGCOutput
if the `options.allocateInstantiationStorage` is true.

Differential Revision: https://phabricator.services.mozilla.com/D133041
2021-12-09 18:21:09 +00:00
Tooru Fujisawa b52fdc98b8 Bug 1743975 - Copy all POD fields in TransitiveCompileOptions::copyPODTransitiveOptions. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D132680
2021-12-03 00:43:08 +00:00
Jonatan Klemets c6df6aff2f Bug 1736060 - Part 1: Add option for import assertions. r=mgaudet,arai
Differential Revision: https://phabricator.services.mozilla.com/D126041
2021-12-01 18:26:08 +00:00
Tooru Fujisawa 86d257a783 Bug 1687973 - Part 1: Remove CompileOptions.useOffThreadParseGlobal. r=tcampbell
Changed all off-thread tasks not to use parse global.
Removed bug-1138390.js because off-thread script decode no longer wait for GC.

 * ParseTask::parseGlobal is removed in Part 2
 * OffThreadParsingMustWaitForGC is removed in Part 3
 * GlobalHelperThreadState::parseWaitingOnGC is removed in Part 3
 * GlobalHelperThreadState::generateLCovSources is removed in Part 5
 * ParseTask::scripts is removed in Part 6
 * ModuleObject::fixEnvironmentsAfterRealmMerge is removed in Part 7
 * Zone::{setCreatedForHelperThread,clearUsedByHelperThread} are removed in
   bug 538450
 * RealmCreationOptions::setMergeable is removed in bug 1655768
 * MergeRealms is removed in bug 1655768

Differential Revision: https://phabricator.services.mozilla.com/D131354
2021-11-19 04:43:03 +00:00
Tooru Fujisawa c30ad11d7f Bug 1726498 - Add JS::DecodeOptions. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D128345
2021-10-21 21:48:48 +00:00
Tooru Fujisawa 0792d1689a Bug 1720619 - Part 2: Add JS::InstantiateOptions. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D120201
2021-10-18 17:08:06 +00:00
Tooru Fujisawa 657899b5a5 Bug 1688791 - Part 2: Remove CompileOptions.useStencilXDR. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D121268
2021-09-21 18:45:15 +00:00
Tooru Fujisawa 6d6d53e831 Bug 1731629 - Add CompileOptions.borrowBuffer. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D126120
2021-09-21 03:18:02 +00:00
sanketh 0689bd0869 Bug 531915 - part 6 - optionally use fdlibm's sin, cos, and tan in jsmath r=tjr,arai
Adds a new preference javascript.options.use_fdlibm_for_sin_cos_tan (default
false) and uses fdlibm for Math.sin, Math.cos, and Math.tan conditioned on it.

Differential Revision: https://phabricator.services.mozilla.com/D119426
2021-08-13 11:57:07 +00:00
Iulian Moraru 538f123b07 Backed out 6 changesets (bug 531915) for causing build bustages. CLOSED TREE
Backed out changeset 65cf5929d5f2 (bug 531915)
Backed out changeset c9d70e46dfca (bug 531915)
Backed out changeset a4824d5f29fd (bug 531915)
Backed out changeset 9ec88b43d7a1 (bug 531915)
Backed out changeset 5f15204ccca9 (bug 531915)
Backed out changeset 14c95ef3dc44 (bug 531915)
2021-08-12 13:33:31 +03:00
sanketh 21ef77522a Bug 531915 - part 6 - optionally use fdlibm's sin, cos, and tan in jsmath r=tjr,arai
Adds a new preference javascript.options.use_fdlibm_for_sin_cos_tan (default
false) and uses fdlibm for Math.sin, Math.cos, and Math.tan conditioned on it.

Differential Revision: https://phabricator.services.mozilla.com/D119426
2021-08-12 09:59:03 +00:00
André Bargull 0890c035b4 Bug 1723155 - Part 10: Cleanup BytecodeCompilation header. r=mgaudet
While removing unnecessary `mozilla::Maybe` in the last part, I've noticed that
this header has many unused or unnecessary includes.

Depends on D121743

Differential Revision: https://phabricator.services.mozilla.com/D121745
2021-08-10 10:05:04 +00:00
Iain Ireland 12c702970e Bug 1624792: Remove instrumention code from bytecode emitter r=tcampbell
This removes the changes from bug 1554524 part 5.

Depends on D116306

Differential Revision: https://phabricator.services.mozilla.com/D116307
2021-06-01 01:31:21 +00:00
Matthew Gaudet 6ea6ca495f Bug 1712138 - Add option for class-static blocks r=arai
Differential Revision: https://phabricator.services.mozilla.com/D115627
2021-05-27 15:01:34 +00:00
Tooru Fujisawa 89ca7c2e9a Bug 1710987 - Borrow ImmutableScriptData from XDR buffer in self-hosted JS. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D115124
2021-05-20 12:00:26 +00:00
Lars T Hansen 5906d4f47f Bug 1711817 - guard an error message on a limit. r=rhunt
When reporting an invalid asm.js heap length, we must also guard the
message on the max such heap length or we risk asserting in the function
that computes the max heap length from the given invalid length.

Drive-by fix: Better error reporting for link errors.

Differential Revision: https://phabricator.services.mozilla.com/D115464
2021-05-20 05:08:33 +00:00
Dorel Luca 7d63ff6349 Backed out changeset a8c663dad696 (bug 1711817) for for Spidermonkey failures in js/src/jit-test/tests/asm.js/testAddressErrors.js. CLOSED TREE 2021-05-19 23:06:34 +03:00
Lars T Hansen 0b631c0e13 Bug 1711817 - guard an error message on a limit. r=rhunt
When reporting an invalid asm.js heap length, we must also guard the
message on the max such heap length or we risk asserting in the function
that computes the max heap length from the given invalid length.

Drive-by fix: Better error reporting for link errors.

Differential Revision: https://phabricator.services.mozilla.com/D115464
2021-05-19 18:53:17 +00:00
Ted Campbell 451710d727 Bug 1710953 - Set discard-source when compiling self-hosted source. r=arai
Instead of setting the realm-behaviour on the self-hosted realm, set it on the
CompileOptions directly when parsing. This is in preparation for removal of the
self-hosted Zone. Also set NoScriptRVal at same time.

Differential Revision: https://phabricator.services.mozilla.com/D115028
2021-05-13 00:01:08 +00:00
Lars T Hansen 16eeb5062c Bug 1697560 - Compute asm.js pref correctly for CompileOptions. r=jseward
The computation of CompileOptions captures only the asmjs flag value,
but this is insufficient to determine if asmjs compilation is actually
supported: we must also determine whether a wasm compiler is available
to compile the wasm that is emitted by the asmjs front end.

This has been a pretty typical error pattern for us in the past, hence
the introduction of the class of wasm::WhateverAvailable(cx)
predicates to work around this.  That fix needs to be used here too.

This patch adds the necessary check to the computation of
CompileOptions and for maximum clarity also distinguishes this case
from the case where the asmjs pref is turned off, even though that's
not necessary.  A couple of new predicates are introduced to keep the
check clean.

Differential Revision: https://phabricator.services.mozilla.com/D114479
2021-05-07 15:06:21 +00:00