Commit graph

175 commits

Author SHA1 Message Date
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
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
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
Yulia Startsev
79409316d1 Bug 1742437 - re-scope all generic module/script loader files under js/loader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D138133
2022-02-21 15:39:09 +00:00
Yulia Startsev
401faea928 Bug 1742437 - Move module loader files into a central folder; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137532
2022-02-21 15:39:08 +00:00
Yulia Startsev
65b14f6546 Bug 1742437 - move DOM module loader into own file; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137531
2022-02-21 15:39:08 +00:00
Yulia Startsev
720155230b Bug 1742437 - Create DOM specific Module Loader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137298
2022-02-21 15:39:07 +00:00
Yulia Startsev
03e65d88dc Bug 1742437 - move mIsPreload from ScriptFetchOptions to DOMScriptLoadContext, and introduce GetRootModule; r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D136743
2022-02-21 15:39:05 +00:00
Yulia Startsev
7ded97bc1a Bug 1742437 - Split ScriptLoadRequest into ScriptLoadRequest and DOMScriptLoadContext; r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D134041
2022-02-21 15:39:04 +00:00
Norisz Fay
4c85ac47c5 Backed out 12 changesets (bug 1742437) for causing Bp-hybrid bustages on ModuleLoader.obj
Backed out changeset 7d5683180ac3 (bug 1742437)
Backed out changeset a48aff5f2555 (bug 1742437)
Backed out changeset 7e54a223001d (bug 1742437)
Backed out changeset 3a34d557d474 (bug 1742437)
Backed out changeset f29451ea18dc (bug 1742437)
Backed out changeset c0bd1d29be62 (bug 1742437)
Backed out changeset 8b970fb6e4e6 (bug 1742437)
Backed out changeset 729c48e34d6b (bug 1742437)
Backed out changeset 9355004c7f6a (bug 1742437)
Backed out changeset 0a5f61274aed (bug 1742437)
Backed out changeset a50f60a612d3 (bug 1742437)
Backed out changeset 0ac6d9d26e2b (bug 1742437)
2022-02-18 00:00:41 +02:00
Yulia Startsev
499559431e Bug 1742437 - re-scope all generic module/script loader files under js/loader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D138133
2022-02-17 15:57:52 +00:00
Yulia Startsev
77471489aa Bug 1742437 - Move module loader files into a central folder; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137532
2022-02-17 15:57:52 +00:00
Yulia Startsev
7393cf9895 Bug 1742437 - move DOM module loader into own file; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137531
2022-02-17 15:57:51 +00:00
Yulia Startsev
9d88a43372 Bug 1742437 - Create DOM specific Module Loader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137298
2022-02-17 15:57:50 +00:00
Yulia Startsev
c413fa305d Bug 1742437 - move mIsPreload from ScriptFetchOptions to DOMScriptLoadContext, and introduce GetRootModule; r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D136743
2022-02-17 15:57:48 +00:00
Yulia Startsev
f212e8a1c1 Bug 1742437 - Split ScriptLoadRequest into ScriptLoadRequest and DOMScriptLoadContext; r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D134041
2022-02-17 15:57:48 +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
Kagami Sascha Rosylight
d5c873e8f4 Bug 1539884 - Part 17: Mark nsIScriptLoaderObserver::scriptEvaluated as can_run_script r=masayuki
Depends on D134107

Differential Revision: https://phabricator.services.mozilla.com/D134108
2021-12-17 13:27:52 +00:00
Yulia Startsev
598c3cb599 Bug 1311726 - Split ScriptLoader into ScriptLoader and ModuleLoader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132683
2021-12-09 13:26:21 +00:00
Yulia Startsev
05b2c1af0b Bug 1311726 - Create ScriptLoaderInterface; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132614
2021-12-09 13:26:20 +00:00
Yulia Startsev
a578ef834d Bug 1311726 - Move getScriptSource to ScriptLoadRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132950
2021-12-09 13:26:19 +00:00
Yulia Startsev
2746eb0099 Bug 1311726 - Move Module Evaluation into ModuleLoader; r=jonco
Module evaluation is independent of it's context. We just need the globalObject to set up the
execution environment.

Differential Revision: https://phabricator.services.mozilla.com/D132678
2021-12-09 13:26:19 +00:00
Yulia Startsev
93e166bd7d Bug 1311726 - Move Dynamic Import Methods to ModuleLoader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132613
2021-12-09 13:26:18 +00:00
Yulia Startsev
b7b6684dd0 Bug 1311726 - Move CheckModuleDependeciesLoaded to ModuleLoadRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132612
2021-12-09 13:26:17 +00:00
Yulia Startsev
453d007f20 Bug 1311726 - Move methods related to resolution and error handling to ModuleLoader;r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132611
2021-12-09 13:26:17 +00:00
Yulia Startsev
b015eed4e9 Bug 1311726 - Move methods related to instantiating the module tree to ModuleLoader;r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132610
2021-12-09 13:26:17 +00:00
Yulia Startsev
df9a671ebb Bug 1311726 - Create ModuleLoader Class; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132609
2021-12-09 13:26:16 +00:00
Yulia Startsev
dab56eff57 Bug 1311726 - Pass JSContext instead of JSAPI to FillCompileOptionsForRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132608
2021-12-09 13:26:16 +00:00
Yulia Startsev
c4e62d3282 Bug 1311726 - Split EvaluateScript into EvaluateScript and EvaluateModule; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132607
2021-12-09 13:26:16 +00:00
Yulia Startsev
645b855eb8 Bug 1311726 - Split StartLoad into StartClassicLoad, StartModuleLoad, StartLoadInternal; r=jonco
The goal of splitting classic script loading from module script loading was to keep a minimum
selection of methods for other script loaders to implement. In addition, the security
flags were distinct for the two cases, and had no overlap.

Caching behavior was left as shared, as it is likely modules will have this soon.

Differential Revision: https://phabricator.services.mozilla.com/D132605
2021-12-09 13:26:15 +00:00
Butkovits Atila
98978d8670 Backed out 18 changesets (bug 1311726) for causing Hazard failures at ScriptLoader.cpp:. CLOSED TREE
Backed out changeset 0e1179305bc2 (bug 1311726)
Backed out changeset fd3a9e4f5e5e (bug 1311726)
Backed out changeset d6f6a7d13dc2 (bug 1311726)
Backed out changeset 7b266f1fbbff (bug 1311726)
Backed out changeset 9ecb9ac4f2f7 (bug 1311726)
Backed out changeset 2deb35690efb (bug 1311726)
Backed out changeset a151ddb7068d (bug 1311726)
Backed out changeset 79aac20615b8 (bug 1311726)
Backed out changeset 258188246118 (bug 1311726)
Backed out changeset 0ef6c06dac5b (bug 1311726)
Backed out changeset 340bd3d73849 (bug 1311726)
Backed out changeset d130a9772d31 (bug 1311726)
Backed out changeset 15df1b7e0208 (bug 1311726)
Backed out changeset ebc87f932050 (bug 1311726)
Backed out changeset 68ab853d072d (bug 1311726)
Backed out changeset eac12c9d76b7 (bug 1311726)
Backed out changeset beb9e9b17522 (bug 1311726)
Backed out changeset bfea110e6afe (bug 1311726)
2021-12-09 02:23:18 +02:00
Yulia Startsev
29f1022620 Bug 1311726 - Split ScriptLoader into ScriptLoader and ModuleLoader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132683
2021-12-08 16:57:23 +00:00
Yulia Startsev
abc7789e21 Bug 1311726 - Create ScriptLoaderInterface; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132614
2021-12-08 16:57:22 +00:00
Yulia Startsev
41bcae4c62 Bug 1311726 - Move getScriptSource to ScriptLoadRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132950
2021-12-08 16:57:21 +00:00
Yulia Startsev
01a27f4163 Bug 1311726 - Move Module Evaluation into ModuleLoader; r=jonco
Module evaluation is independent of it's context. We just need the globalObject to set up the
execution environment.

Differential Revision: https://phabricator.services.mozilla.com/D132678
2021-12-08 16:57:21 +00:00
Yulia Startsev
5636bc7506 Bug 1311726 - Move Dynamic Import Methods to ModuleLoader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132613
2021-12-08 16:57:19 +00:00
Yulia Startsev
a36b884c58 Bug 1311726 - Move CheckModuleDependeciesLoaded to ModuleLoadRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132612
2021-12-08 16:57:19 +00:00
Yulia Startsev
35e623cf0c Bug 1311726 - Move methods related to resolution and error handling to ModuleLoader;r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132611
2021-12-08 16:57:19 +00:00
Yulia Startsev
ea65368a13 Bug 1311726 - Move methods related to instantiating the module tree to ModuleLoader;r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132610
2021-12-08 16:57:18 +00:00
Yulia Startsev
43278ebc5a Bug 1311726 - Create ModuleLoader Class; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132609
2021-12-08 16:57:18 +00:00
Yulia Startsev
ccde25e131 Bug 1311726 - Pass JSContext instead of JSAPI to FillCompileOptionsForRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132608
2021-12-08 16:57:17 +00:00
Yulia Startsev
a18e270dd9 Bug 1311726 - Split EvaluateScript into EvaluateScript and EvaluateModule; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132607
2021-12-08 16:57:17 +00:00
Yulia Startsev
b31e96faf2 Bug 1311726 - Split StartLoad into StartClassicLoad, StartModuleLoad, StartLoadInternal; r=jonco
The goal of splitting classic script loading from module script loading was to keep a minimum
selection of methods for other script loaders to implement. In addition, the security
flags were distinct for the two cases, and had no overlap.

Caching behavior was left as shared, as it is likely modules will have this soon.

Differential Revision: https://phabricator.services.mozilla.com/D132605
2021-12-08 16:57:16 +00:00
Narcis Beleuzu
ff5735371d Backed out 18 changesets (bug 1311726) for failures on test_script_loader_js_cache.html . CLOSED TREE
Backed out changeset 1f9c13be6642 (bug 1311726)
Backed out changeset 2f4e89d930b0 (bug 1311726)
Backed out changeset 03f767c08221 (bug 1311726)
Backed out changeset b21e580a778f (bug 1311726)
Backed out changeset 4597b327e9be (bug 1311726)
Backed out changeset 558fec312301 (bug 1311726)
Backed out changeset b758abeed4cc (bug 1311726)
Backed out changeset a909be9fa973 (bug 1311726)
Backed out changeset 8db98e65b147 (bug 1311726)
Backed out changeset ee2e01e59950 (bug 1311726)
Backed out changeset 40c635fb36eb (bug 1311726)
Backed out changeset 6ba119a4e33e (bug 1311726)
Backed out changeset 1ad7d1308b5f (bug 1311726)
Backed out changeset dd2dbe11315d (bug 1311726)
Backed out changeset a8279e757309 (bug 1311726)
Backed out changeset 1de8b528723e (bug 1311726)
Backed out changeset f1e4c9199289 (bug 1311726)
Backed out changeset 23ea474c05ec (bug 1311726)
2021-12-08 12:46:07 +02:00
Yulia Startsev
e33460fcd0 Bug 1311726 - Split ScriptLoader into ScriptLoader and ModuleLoader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132683
2021-12-08 09:44:14 +00:00
Yulia Startsev
b37eb59838 Bug 1311726 - Create ScriptLoaderInterface; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132614
2021-12-08 09:44:13 +00:00
Yulia Startsev
4a879a389d Bug 1311726 - Move getScriptSource to ScriptLoadRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132950
2021-12-08 09:44:12 +00:00