Yulia Startsev
523e5eee80
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
1574c2e5d3
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
c884bc1185
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
226b73f68a
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
dc53a1d420
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
f0319391a8
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
ccb851f62f
Bug 1311726 - Create ScriptLoaderInterface; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D132614
2021-12-08 09:44:13 +00:00
Yulia Startsev
c0b942a291
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
c7b13912f8
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
c52c6cab45
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
503b02ed48
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
ed41770b4a
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
85fcc0427e
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
dca3099826
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
eaa6717a61
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
fd523172c1
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
f33667d6a0
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
8d491cff49
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
76dbf51229
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
eb72edfe18
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
283cacade0
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
ea4e9a5d01
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
25ff601677
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
ee8075c82e
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
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
ssummar
43e270e58d
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
3b4f87f69c
Backed out changeset 7e8e3747c3f8 (bug 1603127) for causing toolchains build bustages (Bug 1739589). CLOSED TREE
2021-11-05 07:23:45 -04:00
ssummar
f2f04d2ae8
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
277c9da949
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
b7e03bdd6d
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
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
Yury Delendik
8abe488102
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
975f3f78b3
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
5226ca352c
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
b049c9741a
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
7430f772bb
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
c65323a56c
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
3f9e70360a
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
7ea1512946
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
3b87c58aa1
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
Butkovits Atila
14b16e4bae
Backed out changeset fbb89c5b851b (bug 1720692) for casuing bustages complaining about 'CommandContext'.
2021-07-16 20:15:54 +03:00
Jon Coppeard
b87ba9523a
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
Tom Ritter
7830c4464f
Bug 1666222: Cut over a ton of NowUnfuzzed calls -> Now 4/5 r=smaug,extension-reviewers,zombie
...
With Fuzzyfox removed, Now() does what NowUnfuzzed() did.
Differential Revision: https://phabricator.services.mozilla.com/D119639
2021-07-14 18:18:17 +00:00
Tooru Fujisawa
0986662ce6
Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp
...
Differential Revision: https://phabricator.services.mozilla.com/D119619
2021-07-13 11:52:42 +00:00
Jon Coppeard
c61f167a5e
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
4c9bc4cf55
Bug 1678774 - Rename ScriptLoadRequestList::Cancel to CancelRequestsAndClear r=dpalmeiro
...
It's not otherwise obvious that calling this cancels all the requests in the list.
Differential Revision: https://phabricator.services.mozilla.com/D119491
2021-07-12 16:30:59 +00:00
Jon Coppeard
a62fd4d79c
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
c292bb3282
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
acf11cfc0d
Bug 1678774 - Rename ScriptLoadRequestList::Cancel to CancelRequestsAndClear r=dpalmeiro
...
It's not otherwise obvious that calling this cancels all the requests in the list.
Differential Revision: https://phabricator.services.mozilla.com/D119491
2021-07-09 14:07:06 +00:00
Jon Coppeard
6d290c66ee
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