Commit Graph

178 Commits

Author SHA1 Message Date
Nicolas B. Pierron
4702d3114a 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
49ef0b3e9d 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
a1a9c5bf48 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
fb527b6e15 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
4ec118ae45 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
84938470df 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
d746224796 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
878f6f28be 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
ea92cf1380 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
f12cf15dc9 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
10fbaad49e 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
b29042faba 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
b905a794bf 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
e817f6c949 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
e8267b23ad 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
69c348d423 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
7b20b31503 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
e83fdb85a5 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
b94d8df7b4 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
ba617bc017 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
ab9188203c 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
dd113ed4be 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
71d9fc6639 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
b2e1a62bf0 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
06ea8c8ba2 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
43274f4c34 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
975f3f78b3 Bug 1731629 - Add CompileOptions.borrowBuffer. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D126120
2021-09-21 03:18:02 +00:00
sanketh
14ad16df4d 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
94418db4aa 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
90eee006e3 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
088f368bb4 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
43de611a6f 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
ea8216c78b 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
2d4c5bad4b 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
7e81703ebd 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
08011d5dc6 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
9f6fd31328 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
30a9c6f910 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
9963d29fe7 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
Dorel Luca
55c4a2a43e Backed out 2 changesets (bug 1697560, bug 1709803) for Spidermonkey failures in Debugger-allowUnobservedAsmJS-02.js. CLOSED TREE
Backed out changeset 15c327320950 (bug 1709803)
Backed out changeset 8ebf02188fbf (bug 1697560)
2021-05-07 17:32:38 +03:00
Lars T Hansen
d591cfad96 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 14:01:23 +00:00
Matthew Gaudet
53b4bde8f3 Bug 1702278 - Defer setting debug metadata until after script compilation is finished. r=tcampbell,smaug
Differential Revision: https://phabricator.services.mozilla.com/D110459
2021-04-20 15:31:14 +00:00
Yulia Startsev
965f7c4ccc Bug 1681046 - Enable Top Level Await by default r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110394
2021-04-08 08:21:56 +00:00
smolnar
735995919c Backed out 3 changesets (bug 1681046) for causing jsreftest failures in ScriptLoader. CLOSED TREE
Backed out changeset 6704600819ed (bug 1681046)
Backed out changeset 37f56518116b (bug 1681046)
Backed out changeset f61cb7496a35 (bug 1681046)
2021-04-07 12:50:28 +03:00
Yulia Startsev
1e2cdc64ea Bug 1681046 - Enable Top Level Await by default r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110394
2021-04-07 08:45:37 +00:00
Brindusan Cristian
337abd9f72 Backed out 2 changesets (bug 1681046) for causing wpt failures in bare-specifiers.sub.html. CLOSED TREE
Backed out changeset a26ecd8063ea (bug 1681046)
Backed out changeset e161663a5a7c (bug 1681046)
2021-04-06 18:02:15 +03:00
Yulia Startsev
fa2446f331 Bug 1681046 - Enable Top Level Await by default r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110394
2021-04-06 12:10:12 +00:00
Alexandru Michis
dfc8752401 Backed out changeset 0da564b9ec2e (bug 1681046) for causing dt failures in browser_webconsole_worklet_error.js
CLOSED TREE
2021-04-01 15:27:02 +03:00
Yulia Startsev
d1aa681f95 Bug 1681046 - Enable Top Level Await by default r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110394
2021-04-01 11:08:44 +00:00
Chris Peterson
3c62b4f8e2 Bug 1684092 - Part 3: Remove unnecessary #includes of Attributes.h for MOZ_MUST_USE in js/src/. r=jandem
We don't need to #include Attributes.h now that we're using [[nodiscard]] instead of MOZ_MUST_USE.

Differential Revision: https://phabricator.services.mozilla.com/D100414
2021-02-12 04:09:24 +00:00