Commit graph

446 commits

Author SHA1 Message Date
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
4437eb66e3 Bug 1311726 - Move module hook instantiation to ModuleLoader constructor; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132677
2021-12-08 16:57:20 +00:00
Yulia Startsev
b99ae84f56 Bug 1311726 - ModuleLoadRequest loader is a ModuleLoader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132825
2021-12-08 16:57:20 +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
3d669259a1 Bug 1311726 - Remove second initialization of currentScript in EvaluateScript; r=jonco
first initialization is on line 3140 and covers the module case.

Differential Revision: https://phabricator.services.mozilla.com/D132606
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
Yulia Startsev
30323cd365 Bug 1311726 - Switch MarkerInnerWindowIdFromDocShell to MarkerInnerWindowIdFromJSContext; r=canaltinova
The Scriptloader will be shared by multiple modules, not all of them have ready access to the
 docshell (MozJSComponentLoader currently uses the JSContext for this purpose. Workers and worklets
 are not tracking performance yet). Our profiling code relies on the docShell present in the script loader. This changes the
 current profiling code to use the JSContext instead.

Differential Revision: https://phabricator.services.mozilla.com/D132604
2021-12-08 16:57:16 +00:00
Yulia Startsev
f291451846 Bug 1311726 - Only set "ProcessingScript" tag when executing; r=jonco
Previously, we were setting the ProcessingScriptTag for Module compilation as well as script
execution. This patch creates a helper function (GetGlobalWithContext) and removes a superfluous
setting of the "ProcessingScriptTag".

ProcessingScriptTag should be set when a script is executing, as it helps correct our behavior
around history replacement during JS execution: https://searchfox.org/mozilla-central/rev/e9cd2997be1071b9bb76fc14df0f01a2bd721c30/dom/base/LocationBase.cpp#223-231

Differential Revision: https://phabricator.services.mozilla.com/D132603
2021-12-08 16:57:15 +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
e0f5c1b284 Bug 1311726 - Move GetProfilerLabelForRequest to ScriptLoadRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132951
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
6be15af67a Bug 1311726 - Move module hook instantiation to ModuleLoader constructor; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132677
2021-12-08 09:44:12 +00:00
Yulia Startsev
ee7e04d0e4 Bug 1311726 - ModuleLoadRequest loader is a ModuleLoader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132825
2021-12-08 09:44:11 +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
81fb618107 Bug 1311726 - Remove second initialization of currentScript in EvaluateScript; r=jonco
first initialization is on line 3140 and covers the module case.

Differential Revision: https://phabricator.services.mozilla.com/D132606
2021-12-08 09:44:08 +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
Yulia Startsev
b0ecf6c126 Bug 1311726 - Switch MarkerInnerWindowIdFromDocShell to MarkerInnerWindowIdFromJSContext; r=canaltinova
The Scriptloader will be shared by multiple modules, not all of them have ready access to the
 docshell (MozJSComponentLoader currently uses the JSContext for this purpose. Workers and worklets
 are not tracking performance yet). Our profiling code relies on the docShell present in the script loader. This changes the
 current profiling code to use the JSContext instead.

Differential Revision: https://phabricator.services.mozilla.com/D132604
2021-12-08 09:44:08 +00:00
Yulia Startsev
4a72b703fb Bug 1311726 - Only set "ProcessingScript" tag when executing; r=jonco
Previously, we were setting the ProcessingScriptTag for Module compilation as well as script
execution. This patch creates a helper function (GetGlobalWithContext) and removes a superfluous
setting of the "ProcessingScriptTag".

ProcessingScriptTag should be set when a script is executing, as it helps correct our behavior
around history replacement during JS execution: https://searchfox.org/mozilla-central/rev/e9cd2997be1071b9bb76fc14df0f01a2bd721c30/dom/base/LocationBase.cpp#223-231

Differential Revision: https://phabricator.services.mozilla.com/D132603
2021-12-08 09:44:07 +00:00
Jonatan Klemets
c32210afec Bug 1736060 - Part 4: Implement HostGetSupportedImportAssertions. r=mgaudet,arai
Differential Revision: https://phabricator.services.mozilla.com/D126044
2021-12-01 18:26:09 +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
ssummar
0992acc367 Bug 1603127 - Replaced mozilla::Tuple with std::tuple and applied structured bindings in mozilla/Encoding.h. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D129920
2021-11-08 08:14:00 +00:00
Cristian Tuns
71486b8924 Backed out changeset 7e8e3747c3f8 (bug 1603127) for causing toolchains build bustages (Bug 1739589). CLOSED TREE 2021-11-05 07:23:45 -04:00
ssummar
508562cc85 Bug 1603127 - Replaced mozilla::Tuple with std::tuple and applied structured bindings in mozilla/Encoding.h. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D129920
2021-11-05 05:33:58 +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
ssummar
51c0ff21e5 Bug 1626517 - Replaced mozilla::Unused with mozilla::Ignore in mozilla::Decoder/mozilla::Encoder calls. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D129022
2021-10-25 12:31:41 +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
Yury Delendik
04ca8c2532 Bug 1487113 - nsICacheInfoChannel.alternativeDataInputStream as attribute. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D117360
2021-10-15 21:13:43 +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
Marian-Vasile Laza
381c254e6d Backed out 3 changesets (bug 1487113) for causing hazard bustages. CLOSED TREE
Backed out changeset 13bf04fc644f (bug 1487113)
Backed out changeset 5b7fe5d564aa (bug 1487113)
Backed out changeset 02236ccd64b4 (bug 1487113)
2021-09-17 22:58:33 +03:00
Yury Delendik
19b0d24e7f Bug 1487113 - nsICacheInfoChannel.alternativeDataInputStream as attribute. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D117360
2021-09-17 12:16:23 +00:00
Cristian Tuns
f2f6eac4d6 Backed out 3 changesets (bug 1487113) for causing mochitest failures. CLOSED TREE
Backed out changeset b20e5d76c77e (bug 1487113)
Backed out changeset b0b2b27dcb68 (bug 1487113)
Backed out changeset 9214b396eb84 (bug 1487113)
2021-09-14 17:38:32 -04:00
Yury Delendik
0b78665a0e Bug 1487113 - nsICacheInfoChannel.alternativeDataInputStream as attribute. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D117360
2021-09-14 20:12:51 +00:00
André Bargull
d2bbf86876 Bug 1726123 - Part 5: Add missing "js/" includes outside of SM. r=arai
In preparation for the next part, add missing includes to "js/" public headers.

Differential Revision: https://phabricator.services.mozilla.com/D122843
2021-08-17 15:45:39 +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
d021d948ec Bug 1720692 - Remove all preload requests from the off-thread compiling requests list when the preload request is used r=dpalmeiro
When a preload request is used, it might be being compiled off-thread.
Currently this is handled for defer and async requests in AddDeferRequest and
AddAsyncRequest but not for XSLT or other kinds of requests. The patch handles
this whenever we use a preload request.

I don't know for sure that this is what's causing the crash but it seems likely
given the assertion.

Depends on D120072

Differential Revision: https://phabricator.services.mozilla.com/D120073
2021-07-16 16:46:54 +00:00