Commit graph

415 commits

Author SHA1 Message Date
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