Граф коммитов

531 Коммитов

Автор SHA1 Сообщение Дата
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
Florian Quèze c4c51c4002 Bug 1720358 - Make AutoProfilerLabel available even when MOZ_GECKO_PROFILER is not defined, and remove ifdefs, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D119795
2021-07-15 22:04:22 +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
Peter Van der Beken f206ae96e4 Bug 1712725 - Stop clearing JS things when calling mozilla::DropJSObjects. r=mccr8
There's a pattern of clearing JS things when calling mozilla::DropJSObjects,
but mozilla::DropJSObjects already clears the JS things itself by calling
CycleCollectedJSRuntime::RemoveJSHolder.

Differential Revision: https://phabricator.services.mozilla.com/D115885
2021-05-27 08:35:40 +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
Ted Campbell 89afad4d44 Bug 1706937 - Cleanup JS source-element callback. r=jandem
Rename the JSGetElementCallback hook to JSSourceElementCallback to avoid
confusion with GetElement operations.

Differential Revision: https://phabricator.services.mozilla.com/D113985
2021-05-03 20:08:06 +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
Andrew McCreight 77cb6426d5 Bug 1699784 - Fix two 'outselves' typos. r=smaug DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D109106
2021-03-19 18:32:09 +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
Chris Peterson 2d4ca059e8 Bug 1691889 - Replace MOZ_MUST_USE with [[nodiscard]] in dom/. r=peterv
The MOZ_MUST_USE macro is defined as clang's and gcc's nonstandard __attribute__((warn_unused_result)). Now that we compile as C++17 by default (bug 1560664), we can replace MOZ_MUST_USE with C++17's standard [[nodiscard]] attribute.

The [[nodiscard]] attribute must precede a function declaration's declaration specifiers (like static, extern, inline, or virtual). The __attribute__((warn_unused_result)) attribute does not have this order restriction.

Differential Revision: https://phabricator.services.mozilla.com/D107355
2021-03-10 08:19:25 +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