Commit graph

155 commits

Author SHA1 Message Date
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
Yulia Startsev
0cfaecf34e 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 09:44:12 +00:00
Yulia Startsev
b72431af17 Bug 1311726 - Move Dynamic Import Methods to ModuleLoader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132613
2021-12-08 09:44:11 +00:00
Yulia Startsev
4390c6bbe9 Bug 1311726 - Move CheckModuleDependeciesLoaded to ModuleLoadRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132612
2021-12-08 09:44:11 +00:00
Yulia Startsev
5359ecaee6 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 09:44:10 +00:00
Yulia Startsev
0d64ee28d9 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 09:44:10 +00:00
Yulia Startsev
cd670cb995 Bug 1311726 - Create ModuleLoader Class; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132609
2021-12-08 09:44:09 +00:00
Yulia Startsev
157f0f2054 Bug 1311726 - Pass JSContext instead of JSAPI to FillCompileOptionsForRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132608
2021-12-08 09:44:09 +00:00
Yulia Startsev
fa5cfd155f Bug 1311726 - Split EvaluateScript into EvaluateScript and EvaluateModule; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132607
2021-12-08 09:44:09 +00:00
Yulia Startsev
290ca1ee40 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 09:44:08 +00:00
Denis Palmeiro
a728edfd6d Bug 1736057 - Enable off thread full parsing by default for external JS scripts r=smaug,bas
The results from a nightly experiment, found at https://protosaur.dev/partybal/bug_1722551_pref_full_js_parsing_experiment_nightly_94_94.html, indicate that there is a 2% improvement in the page load time by enabling full parsing for external JS scripts.  This is most noticeable in the low cpu segment, where improvements of up to 10% can be seen.  This all comes at a memory increase of about 1% in the median, and 4% in the worst case.

Differential Revision: https://phabricator.services.mozilla.com/D129158
2021-10-25 14:54:26 +00:00
Yulia Startsev
84e1ae58eb Bug 1725621 - Remove Top Level Await preference and associated code; r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D122586
2021-08-17 13:08:00 +00:00
Jon Coppeard
bc6660ee39 Bug 1678774 - Track more top level load requests while they are being parsed off-thread r=dpalmeiro
The original patch had caused some assertions so I rewrote it. This now puts
all untracked top-level requests on the new list while they are being compiled
so handles preload requests too.

Differential Revision: https://phabricator.services.mozilla.com/D119386
2021-07-12 16:31:00 +00:00
Jon Coppeard
596f5488eb Bug 1678774 - Cancel off-thread compilations when destroying a ScriptLoader r=dpalmeiro
There are parse tasks present when the JS engine is being shut down that have
finished but haven't had their results collected by the embedding. This
shouldn't happen, and I think it's happening here because we're leaking a
JSRuntime (we cancel these when we shut down a runtime).

There's a comment that says this isn't necessary but cancelling outstanding
compile requests in ScriptLoader::Destroy fixes this problem on try. I don't
understand well enough to know what's going wrong with the current approach but
this fixes both the crash and the leak.

Differential Revision: https://phabricator.services.mozilla.com/D119315
2021-07-12 16:30:59 +00:00
Butkovits Atila
1bbbede5ea Backed out 3 changesets (bug 1678774) for causing assertion failures at LinkedList.h. CLOSED TREE
Backed out changeset ed10a56d576e (bug 1678774)
Backed out changeset 31612eaf974f (bug 1678774)
Backed out changeset 867422c9aa5e (bug 1678774)
2021-07-09 18:37:41 +03:00
Jon Coppeard
d6e815ae33 Bug 1678774 - Track more top level load requests while they are being parsed off-thread r=dpalmeiro
Depends on D119315

Differential Revision: https://phabricator.services.mozilla.com/D119386
2021-07-09 14:07:05 +00:00
Jon Coppeard
86f8c9170b Bug 1678774 - Cancel off-thread compilations when destroying a ScriptLoader r=dpalmeiro
There are parse tasks present when the JS engine is being shut down that have
finished but haven't had their results collected by the embedding. This
shouldn't happen, and I think it's happening here because we're leaking a
JSRuntime (we cancel these when we shut down a runtime).

There's a comment that says this isn't necessary but cancelling outstanding
compile requests in ScriptLoader::Destroy fixes this problem on try. I don't
understand well enough to know what's going wrong with the current approach but
this fixes both the crash and the leak.

Differential Revision: https://phabricator.services.mozilla.com/D119315
2021-07-09 14:07:05 +00:00
Denis Palmeiro
d2a8c4a659 Bug 1709139 - Replace JS pageload proportion probes with absolute time measurements and add new probes to measure GC and main thread parsing impact during page load. r=sfink,iain,smaug
Replace JS pageload proportion probes with absolute time measurements and add new probes to measure GC and main thread parsing impact during page load.

Differential Revision: https://phabricator.services.mozilla.com/D114388
2021-05-12 16:38:40 +00:00
Matthew Gaudet
810f80185c 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
Jonatan Klemets
5c6179f100 Bug 1668330 - Part 2: Modify the ScriptLoader to work with the API changes for import-assertions. r=yulia
Differential Revision: https://phabricator.services.mozilla.com/D109495
2021-04-14 18:04:48 +00:00
Bogdan Tara
d593453f4a Backed out 2 changesets (bug 1668330) for GlobalObject.h related bustage and spidermonkey failures CLOSED TREE
DONTBUILD
Backed out changeset 2d76323e5c0c (bug 1668330)
Backed out changeset ac4f085c9f32 (bug 1668330)
2021-04-14 18:36:35 +03:00