Commit graph

555 commits

Author SHA1 Message Date
Yulia Startsev
55c10abdff 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-09 13:26:15 +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
Yulia Startsev
a5414cfdca 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-09 13:26:14 +00:00
Yulia Startsev
7ca951440d 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-09 13:26:14 +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
2a9a7fae3b Bug 1311726 - Move GetProfilerLabelForRequest to ScriptLoadRequest; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D132951
2021-12-08 16:57:21 +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
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
Butkovits Atila
de7ebaa571 Backed out changeset fbb89c5b851b (bug 1720692) for casuing bustages complaining about 'CommandContext'. 2021-07-16 20:15:54 +03:00
Jon Coppeard
b5d3573fd6 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
1b9b6b72db 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
cc92ef732d 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
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
d06022bd80 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
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
24970ee4f8 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
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
Florian Quèze
cd399a71a2 Bug 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D118680
2021-06-25 13:28:01 +00:00
Denis Palmeiro
f8473d146f Bug 1717642 - Add a pref to force full parse for OMT compiled JS scripts from the ScriptLoader. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D118494
2021-06-24 15:13:42 +00:00
Iain Ireland
672b512c4b Bug 1624792: Remove js::GlobalHasInstrumentation r=tcampbell,smaug
This is no longer needed because we are removing the realm instrumentation code (which was only ever used for WebRR).

Differential Revision: https://phabricator.services.mozilla.com/D116304
2021-06-01 01:31:19 +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
Kagami Sascha Rosylight
924e28c20b Bug 1620505 - Clear currentScript after running microtasks r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D114442
2021-05-06 13:36:34 +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
Matthew Gaudet
a0ff0d57e7 Bug 1702278 - Make CompileOptions a member of JSExecutionContext r=tcampbell
This simplified the use of JSExecutionContext, and make future patches
in this stack simpler.

Differential Revision: https://phabricator.services.mozilla.com/D110458
2021-04-20 15:31:13 +00:00
Yulia Startsev
eed5941314 Bug 1704561 - Ensure that Module return value is an object before binding it to evaluationPromise; r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D111849
2021-04-15 12:28:48 +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
Jonatan Klemets
c845650f07 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 15:22:57 +00:00
Yulia Startsev
c781410bf5 Bug 1681046: fix non-js occuring error throw order for async modules; r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110961
2021-04-08 08:21:57 +00:00
smolnar
8844e16700 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
408b320570 Bug 1681046: fix non-js occuring error throw order for async modules; r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D110961
2021-04-07 08:45:39 +00:00
Ted Campbell
9b6e632d81 Bug 1700954 - Remove remaining BinAST fragments from ScriptLoader. r=arai,hsivonen,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D109765
2021-03-26 13:01:40 +00:00
Tom Schuster
40d981ca3a Bug 1536094 - CC changes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D108532
2021-03-23 11:15:11 +00:00
Tom Schuster
01d4cafbb1 Bug 1536094 - Support dynamic import from content scripts (sandboxed code) r=smaug,jonco
Firstly we need to find a usable ScriptLoader for code in the content script sandbox,
for that we use the normal ScriptLoader associated with DOMWindow wrapped by the sandbox.

Secondly we need to execute the module in the global of the sandbox instead of the
"ScriptGlobal" the ScriptLoader is actually associated with. The main
behavior change here comes from using xpc::NativeGlobal in HostImportModuleDynamically
and passing that global around inside ScriptFetchOptions.

To ensure that content-scripts and the webpage don't share imported modules,
the module map (mFetchingModules and mFetchedModules) now uses a complex key
of <URI, Global>. The Global is a nullptr for normal imports from a webpage.

Differential Revision: https://phabricator.services.mozilla.com/D107076
2021-03-23 11:15:11 +00:00
Bogdan Tara
a3fae8602d Backed out 3 changesets (bug 1536094) for causing bug 1700228 CLOSED TREE
Backed out changeset 464143c2b6ac (bug 1536094)
Backed out changeset 3462cb6573b1 (bug 1536094)
Backed out changeset d566c1c9e82f (bug 1536094)
2021-03-23 00:46:34 +02:00
Tom Schuster
68c7cd7283 Bug 1536094 - CC changes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D108532
2021-03-22 16:22:27 +00:00
Tom Schuster
bcb6e45e17 Bug 1536094 - Support dynamic import from content scripts (sandboxed code) r=smaug,jonco
Firstly we need to find a usable ScriptLoader for code in the content script sandbox,
for that we use the normal ScriptLoader associated with DOMWindow wrapped by the sandbox.

Secondly we need to execute the module in the global of the sandbox instead of the
"ScriptGlobal" the ScriptLoader is actually associated with. The main
behavior change here comes from using xpc::NativeGlobal in HostImportModuleDynamically
and passing that global around inside ScriptFetchOptions.

To ensure that content-scripts and the webpage don't share imported modules,
the module map (mFetchingModules and mFetchedModules) now uses a complex key
of <URI, Global>. The Global is a nullptr for normal imports from a webpage.

Differential Revision: https://phabricator.services.mozilla.com/D107076
2021-03-22 16:22:27 +00:00
Cosmin Sabou
cac540c776 Backed out 3 changesets (bug 1536094) for causing valgrind failures.
Backed out changeset dfe051a9c91a (bug 1536094)
Backed out changeset c73979442002 (bug 1536094)
Backed out changeset 863933e887e8 (bug 1536094)
2021-03-22 20:34:36 +02:00
Tom Schuster
896f971e00 Bug 1536094 - CC changes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D108532
2021-03-22 16:22:27 +00:00
Tom Schuster
aa320997de Bug 1536094 - Support dynamic import from content scripts (sandboxed code) r=smaug,jonco
Firstly we need to find a usable ScriptLoader for code in the content script sandbox,
for that we use the normal ScriptLoader associated with DOMWindow wrapped by the sandbox.

Secondly we need to execute the module in the global of the sandbox instead of the
"ScriptGlobal" the ScriptLoader is actually associated with. The main
behavior change here comes from using xpc::NativeGlobal in HostImportModuleDynamically
and passing that global around inside ScriptFetchOptions.

To ensure that content-scripts and the webpage don't share imported modules,
the module map (mFetchingModules and mFetchedModules) now uses a complex key
of <URI, Global>. The Global is a nullptr for normal imports from a webpage.

Differential Revision: https://phabricator.services.mozilla.com/D107076
2021-03-22 16:22:27 +00:00
Nika Layzell
c733984c4b Bug 1675820 - Part 6: Make DocGroup cycle-collected, r=farre,smaug
Previously, the DocGroup type was not cycle-collected, as it needed to have
references from other threads for Quantum DOM. Nowadays the only off-main-thread
use of DocGroup is for dispatching runnables to the main thread which should be
tracked using a performance counter for about:performance. This means we can
remove the DocGroup references from these dispatching callsites, only storing
the Performance Counter we're interested in, and simplify make DocGroup be
cycle-collected itself.

This fixes a leak caused by adding the WindowGlobalChild getter to
WindowContext, by allowing cycles between the document and its BrowsingContext
to be broken by the cycle-collector.

Differential Revision: https://phabricator.services.mozilla.com/D108865
2021-03-18 19:24:50 +00:00
Simon Giesecke
7c6ccbe4a8 Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-05 15:29:49 +00:00
Alexandru Michis
8c28934f09 Backed out changeset c6b72f3c76ba (bug 1676361) for causing bustages in nsSocketTransportService2.cpp
CLOSED TREE
2021-03-04 23:26:04 +02:00
Simon Giesecke
e41d350c04 Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-04 17:30:48 +00:00
Noemi Erli
11891059f7 Backed out changeset 06452c4c828c (bug 1676361) for causing bustages CLOSED TREE 2021-03-04 19:13:56 +02:00
Simon Giesecke
6c371fcc1c Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-04 16:14:44 +00:00
smolnar
9f8b74a18d Backed out changeset 9062e17fe15c (bug 1676361) on devs request. CLOSED TREE 2021-03-04 16:51:21 +02:00
Simon Giesecke
e1330cc8f0 Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-04 14:32:15 +00:00
Simon Giesecke
9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
yulia
ec9af4d409 Bug 1665330 - If a script is a module, increment the IgnoreDestructiveWrites counter r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D99898
2021-02-05 11:00:23 +00:00
Ted Campbell
a8e1541ef9 Bug 1686572 - Return JS::OffThreadToken* from off-thread script compile. r=arai
Instead of using both an optional out-param and a boolean return value, we
can simply return the token directly. This is less error-prone and requires
no change to callers that did not use the out-param.

Differential Revision: https://phabricator.services.mozilla.com/D101654
2021-01-14 00:51:13 +00:00
Tooru Fujisawa
a8ebb3a149 Bug 1674305 - Always use off-thread parse global in decode task and instantiate off-thread. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D101126
2021-01-13 23:31:16 +00:00
Dorel Luca
2a0e56c384 Backed out changeset 760123aa1758 (bug 1665330) for WPT failures in /html/webappapis/dynamic-markup-insertion/document-write/module-tla-import.html. CLOSED TREE 2021-01-13 16:57:11 +02:00
yulia
c897e5a544 Bug 1665330 - If a script is a module, increment the IgnoreDestructiveWrites counter r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D99898
2021-01-13 11:41:01 +00:00
Tooru Fujisawa
33a5756351 Bug 1681308 - Add alignment requirement to XDR buffer. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D101125
2021-01-13 02:18:26 +00:00
yulia
0ff486bf16 Bug 1681664 - Allow Top-level await modules which fail to evaluate due to user action to fail without crashing. r=jonco,mconley
Differential Revision: https://phabricator.services.mozilla.com/D99809
2021-01-11 17:08:59 +00:00
Christoph Kerschbaumer
cd9e96dc19 Bug 1677179: Allow module scripts in sandboxed iframe within about: page to load. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D98765
2021-01-10 18:42:04 +00:00
Masatoshi Kimura
3f402bfcc4 Bug 1683464 - Reduce nsContentPolicyType usage. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D100181
2021-01-07 15:18:52 +00:00
Razvan Maries
6a4eb25b10 Backed out 4 changesets (bug 1683464) for multiple perma failures. CLOSED TREE
Backed out changeset a5d315c017d0 (bug 1683464)
Backed out changeset 5f91001e4923 (bug 1683464)
Backed out changeset 1b7fe904e8af (bug 1683464)
Backed out changeset eb1c479fddca (bug 1683464)
2021-01-05 16:47:22 +02:00
Masatoshi Kimura
dfb97ca7cf Bug 1683464 - Reduce nsContentPolicyType usage. r=ckerschb
Depends on D100180

Differential Revision: https://phabricator.services.mozilla.com/D100181
2021-01-05 12:21:46 +00:00
Razvan Maries
47f941747c Backed out changeset 540c9159c3c6 (bug 1681664) for perma failures on test_bug1681664.html. 2020-12-18 22:00:52 +02:00
yulia
a1a1c495ea Bug 1681664 - Allow Top-level await modules which fail to evaluate due to user action to fail without crashing. r=jonco,mconley
Differential Revision: https://phabricator.services.mozilla.com/D99809
2020-12-18 12:37:36 +00:00
yulia
02bcdf5bde Bug 1519100 - Use pref to completely pref-off top-level await in the browser; r=emilio,jonco
Differential Revision: https://phabricator.services.mozilla.com/D97184
2020-12-04 08:54:10 +00:00
yulia
0d160e1e0d Bug 1519100 - Implement module promises in html r=emilio,jonco
Differential Revision: https://phabricator.services.mozilla.com/D95885
2020-12-04 08:54:03 +00:00
Razvan Maries
8cbedc3a4d Backed out 15 changesets (bug 1519100) as per Yulia's request. CLOSED TREE
Backed out changeset 16dc37dadf05 (bug 1519100)
Backed out changeset 019b00c63941 (bug 1519100)
Backed out changeset 1155eecec034 (bug 1519100)
Backed out changeset 53a792431e11 (bug 1519100)
Backed out changeset 55918f941155 (bug 1519100)
Backed out changeset 683743bd0395 (bug 1519100)
Backed out changeset 63d506024693 (bug 1519100)
Backed out changeset 8b5244786634 (bug 1519100)
Backed out changeset 3a0a021acc08 (bug 1519100)
Backed out changeset d5bff6c95feb (bug 1519100)
Backed out changeset bab7e81a6c2c (bug 1519100)
Backed out changeset b521ccd694f8 (bug 1519100)
Backed out changeset 9f559a616909 (bug 1519100)
Backed out changeset 98146209da6f (bug 1519100)
Backed out changeset a3ea6c49dbf7 (bug 1519100)
2020-12-03 20:37:45 +02:00
yulia
f710026703 Bug 1519100 - Use pref to completely pref-off top-level await in the browser; r=emilio,jonco
Differential Revision: https://phabricator.services.mozilla.com/D97184
2020-12-03 15:26:04 +00:00
yulia
4883191845 Bug 1519100 - Implement module promises in html r=emilio,jonco
Differential Revision: https://phabricator.services.mozilla.com/D95885
2020-12-03 15:25:54 +00:00
Bogdan Tara
c1b7803fbd Backed out 15 changesets (bug 1519100) for wpt leaks CLOSED TREE
Backed out changeset 7302ebdbaa35 (bug 1519100)
Backed out changeset 5b89081f0f08 (bug 1519100)
Backed out changeset ee02050e3c97 (bug 1519100)
Backed out changeset 47cf4bde107e (bug 1519100)
Backed out changeset bfd96f55a3bd (bug 1519100)
Backed out changeset c9afefd66eb7 (bug 1519100)
Backed out changeset 90b61247d071 (bug 1519100)
Backed out changeset e0250e4cba61 (bug 1519100)
Backed out changeset 5f90543431cb (bug 1519100)
Backed out changeset d7f3440addc7 (bug 1519100)
Backed out changeset 10194540aff0 (bug 1519100)
Backed out changeset 880873b815a4 (bug 1519100)
Backed out changeset d99f0109da7a (bug 1519100)
Backed out changeset c723f6b16b67 (bug 1519100)
Backed out changeset da24af409d92 (bug 1519100)
2020-12-02 21:14:35 +02:00
yulia
7a2f0f89ab Bug 1519100 - Use pref to completely pref-off top-level await in the browser; r=emilio,jonco
Differential Revision: https://phabricator.services.mozilla.com/D97184
2020-12-02 12:40:21 +00:00
yulia
21104289bb Bug 1519100 - Implement module promises in html r=emilio,jonco
Differential Revision: https://phabricator.services.mozilla.com/D95885
2020-12-02 12:40:08 +00:00
Tooru Fujisawa
c41f83e22a Bug 1678243 - Clear exception set by JS::FinishIncrementalEncoding. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D98015
2020-11-26 20:08:59 +00:00
Simon Giesecke
e9f54e05c6 Bug 1676361 - Move ExecutionContext to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D97618

Depends on D97617
2020-11-23 16:12:26 +00:00
Simon Giesecke
5bfbb2a572 Bug 1673931 - Avoid including Document.h from header files. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95046

Depends on D95045
2020-11-23 16:07:43 +00:00
Simon Giesecke
971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Denis Palmeiro
0ef77ed7df Bug 1666724 - Cancel all off thread compilations at Shutdown r=smaug
Register a shutdown observer for scriptloader and cancel all script load requests upon observation.

Differential Revision: https://phabricator.services.mozilla.com/D96778
2020-11-19 00:00:44 +00:00
Gerald Squelart
cc0abcfaee Bug 1675409 - Migrated TextMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96052
2020-11-18 21:54:13 +00:00
Razvan Maries
b7eeb731df Backed out 23 changesets (bug 1675409) for build bustages on Preferences.cpp. CLOSED TREE
Backed out changeset c1a131a55767 (bug 1675409)
Backed out changeset 47d210802a5d (bug 1675409)
Backed out changeset e8ebb1c58d30 (bug 1675409)
Backed out changeset 69a1e9aeff2a (bug 1675409)
Backed out changeset 68f330b387a8 (bug 1675409)
Backed out changeset e4750d9ef5a1 (bug 1675409)
Backed out changeset bb6bb71e5ab3 (bug 1675409)
Backed out changeset 988d7f4716df (bug 1675409)
Backed out changeset ca41382e891c (bug 1675409)
Backed out changeset 90f3fbbbbeda (bug 1675409)
Backed out changeset 9b109d61a6f6 (bug 1675409)
Backed out changeset 3dd66abfdaa2 (bug 1675409)
Backed out changeset 44181df5f0db (bug 1675409)
Backed out changeset bb2603d947fc (bug 1675409)
Backed out changeset 97055cf20a56 (bug 1675409)
Backed out changeset f88fcf09de0d (bug 1675409)
Backed out changeset 7963e1c49786 (bug 1675409)
Backed out changeset 4c379c1061c3 (bug 1675409)
Backed out changeset b8be8ae7da63 (bug 1675409)
Backed out changeset 0b90aa89421e (bug 1675409)
Backed out changeset c10fb46467c9 (bug 1675409)
Backed out changeset 894ac233b290 (bug 1675409)
Backed out changeset 075d1d8e34c2 (bug 1675409)
2020-11-18 20:06:28 +02:00
Gerald Squelart
786dd07114 Bug 1675409 - Migrated TextMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96052
2020-11-17 22:23:38 +00:00
Mihai Alexandru Michis
c0d25b01b2 Backed out 24 changesets (bug 1666566, bug 1675409) for causing hazard failures in profiler/core/platform.cpp
CLOSED TREE

Backed out changeset 4d8af8533fd4 (bug 1666566)
Backed out changeset f031a3a8a20f (bug 1675409)
Backed out changeset 2b7e1a031921 (bug 1675409)
Backed out changeset bda5a24b2d0a (bug 1675409)
Backed out changeset 4282e2284314 (bug 1675409)
Backed out changeset 0637f1b26e9f (bug 1675409)
Backed out changeset 67ae04c8f607 (bug 1675409)
Backed out changeset 6c7b3f3618ef (bug 1675409)
Backed out changeset 2f325c22d169 (bug 1675409)
Backed out changeset 1e48ff70ad8f (bug 1675409)
Backed out changeset 1dfc32d6871d (bug 1675409)
Backed out changeset 4f1f218a777b (bug 1675409)
Backed out changeset e6ac8722b38e (bug 1675409)
Backed out changeset cf132e15fb57 (bug 1675409)
Backed out changeset a126e6b00ba9 (bug 1675409)
Backed out changeset fbc7fbb04f33 (bug 1675409)
Backed out changeset 554c69681474 (bug 1675409)
Backed out changeset 44d0521c701f (bug 1675409)
Backed out changeset 04653dfe4720 (bug 1675409)
Backed out changeset 41ca2c043a00 (bug 1675409)
Backed out changeset 264ae4c805d4 (bug 1675409)
Backed out changeset 5f3bbdac0d52 (bug 1675409)
Backed out changeset 11311c11a6e8 (bug 1675409)
Backed out changeset 0355fbc44baf (bug 1675409)
2020-11-17 19:31:28 +02:00
Gerald Squelart
7e40dbb3c5 Bug 1675409 - Migrated TextMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96052
2020-11-17 11:38:06 +00:00
Andi-Bogdan Postelnicu
6c639eb537 Bug 1626555 - Add dom/script to the list of non-unified-build-compatible directories. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D96401
2020-11-09 16:50:39 +00:00
Jeff Walden
c7bc4f2846 Bug 1663365 - Don't include "js/friend/ErrorMessages.h" in jsfriendapi.h. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D95208
2020-10-30 06:33:56 +00:00
Denis Palmeiro
71434198b6 Bug 1664475: Add telemetry probes to collect data for script delazification, xdr encoding time, bytecode caching time, and baseline compilation time. r=nbp,Dexter,sefeng,smaug
Differential Revision: https://phabricator.services.mozilla.com/D90798
2020-10-08 13:46:29 +00:00
Gerald Squelart
ee701f64d7 Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 11:02:23 +00:00
Bogdan Tara
ababae891b Backed out 2 changesets (bug 1667915) for platform related bustage CLOSED TREE
Backed out changeset e7a0788a1741 (bug 1667915)
Backed out changeset d34505b2d81b (bug 1667915)
2020-10-01 12:34:39 +03:00
Gerald Squelart
e07ae06a1d Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 01:44:47 +00:00
Christoph Kerschbaumer
359ca7017e Bug 1666419: Assert IsSafeToRunScript. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D91391
2020-09-28 06:29:44 +00:00
Simon Giesecke
de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Denis Palmeiro
27ec435b3b Bug 1665724: Clear mRunnable of request if user goes OOM while trying to off-thread compile. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D90645
2020-09-18 10:31:45 +00:00
Denis Palmeiro
63cdb2b343 Bug 1652126: Obtain an OffThreadToken immediately so parse tasks can be canceled anytime, and clean up dangling Runnables during cancellation. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D89465
2020-09-11 15:28:04 +00:00
Gerald Squelart
a087b2df35 Bug 1663554 - Convert AUTO_PROFILER_TEXT_MARKER_... to new AUTO_PROFILER_MARKER_TEXT - r=gregtatum
The name `AUTO_PROFILER_MARKER_TEXT` is more consistent with the equivalent non-`AUTO` macro, and similarly arguments have been re-ordered to be the same, i.e.: Name, category&options, text.

The different macros with different argument sets can now be collapsed into one macro, and the optional arguments (timing, inner window id, backtrace) can easily be added to the `MarkerOptions` where needed.

As a bonus, a specific start time can optionally be provided at construction time.

Differential Revision: https://phabricator.services.mozilla.com/D89588
2020-09-11 00:42:51 +00:00
Denis Palmeiro
ab8287fd08 Bug 1663051 - Do not process off thread requests that are already pending in a list r=smaug
Check if the off thread compilation request is already in a list before calling ProcessRequest.  See https://bugzilla.mozilla.org/show_bug.cgi?id=1663051#c0 for a more detailed description of the problem.

Differential Revision: https://phabricator.services.mozilla.com/D89257
2020-09-06 16:58:37 +00:00
Denis Palmeiro
b53dc3619e Bug 1662435 - Assert request is not already in another list before appending to bytecode cache queue. r=smaug
Add a safety check before appending a request to the bytecode cache queue to see if it already exists in another list.

Differential Revision: https://phabricator.services.mozilla.com/D88984
2020-09-01 17:14:32 +00:00
Jon Coppeard
7252dcb2ac Bug 1656248 - Associate the JS script with the loader script for scripts loaded from the bytecode cache like we do for compiled scripts r=smaug
The problem is that ResolveModuleSpecifier is being passed a null script and is falling back to using the document base URL to resolve the module import (which is the correct thing to do in some cases). This is happening because the referring JS script was not assoicated with a loader script when it was loaded since it came from the bytecode cache and the logic to do that is missing on this path.

Differential Revision: https://phabricator.services.mozilla.com/D86352
2020-08-24 19:33:53 +00:00
Honza Bambas
3135c5c5f9 Bug 1657961 - MOZ_LOG NotifyOffThreadScriptLoadCompletedRunnable dispatch and run spanning the JS helper thread off-main-thread parsing, r=froydnj
Depends on D86738

Differential Revision: https://phabricator.services.mozilla.com/D86739
2020-08-13 14:41:16 +00:00
Steven MacLeod
b329c4ff4c Bug 1646547 - fix ScriptLoader::ReadyToExecuteParserBlockingScripts stopping at OOP ancestors. r=kmag
`ReadyToExecuteParserBlockingScripts` was walking the ancestor chain but
would stop if it hit an OOP ancestor. With this change we walk the
`WindowContext` tree instead, so that we may skip over OOP ancestors
and continue checking all in process ancestors.

Differential Revision: https://phabricator.services.mozilla.com/D86436
2020-08-09 23:50:35 +00:00
Simon Giesecke
1e02318b49 Bug 1653335 - Replace MakeSpan uses by constructor calls. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83817
2020-08-07 07:49:47 +00:00