Commit Graph
859 Commits
Author SHA1 Message Date
Daniel Holbert efbf700080 Bug 2043788: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/{base,ds}/. r=xpcom-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D303597
2026-05-30 17:24:05 +00:00
agoloman 445c467866 Revert "Bug 2043790: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/tests/. r=xpcom-reviewers,emilio" for causing build bustages @TestNonBlockingAsyncInputStream.cpp.
This reverts commit ed098a6dfc.

Revert "Bug 2043789: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/{io,ioutils}/. r=xpcom-reviewers,emilio"

This reverts commit aa8e617fd8.

Revert "Bug 2043788: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/{base,ds}/. r=xpcom-reviewers,emilio"

This reverts commit 4f52fb1147.
2026-05-30 17:00:34 +00:00
Daniel Holbert 4f52fb1147 Bug 2043788: Use MakeRefPtr to do allocation for various RefPtr variables in xpcom/{base,ds}/. r=xpcom-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D303597
2026-05-30 15:26:20 +00:00
Bas Schouten 802d95988e Bug 2035873: Ensure significantly more GC/CC probes report process-specific data. r=smaug,TravisLong
Differential Revision: https://phabricator.services.mozilla.com/D297581
2026-05-01 15:55:01 +00:00
agoloman ae549657c5 Revert "Bug 2035873: Ensure significantly more GC/CC probes report process-specific data. r=smaug,TravisLong" for causing xpc failires @test_TelemetryHistograms.js.
This reverts commit 966d14cf6e.
2026-04-30 18:50:02 +00:00
Bas Schouten 966d14cf6e Bug 2035873: Ensure significantly more GC/CC probes report process-specific data. r=smaug,TravisLong
Differential Revision: https://phabricator.services.mozilla.com/D297581
2026-04-30 17:42:49 +00:00
Atila Butkovits 7cc41b76c9 Revert "Bug 2035873: Ensure significantly more GC/CC probes report process-specific data. r=smaug" for causing failures at TestTelemetryMirrors.
This reverts commit 089574a134.
2026-04-30 10:37:01 +00:00
Bas Schouten 089574a134 Bug 2035873: Ensure significantly more GC/CC probes report process-specific data. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D297581
2026-04-30 10:13:43 +00:00
Jon Coppeard 806ccbefee Bug 2028231 - Cycle collector integration for JS WeakRefs r=sfink,mccr8
This fixes the problem by clearing the targets of WeakRefs when those tagets
are found to be part of a gray cycle by the cycle collector. This is the same
thing that happens for nsWeakReferences which should be cleared when their
targets are unlinked.

This patch looks up all WeakRef targets in the cycle collector table to check
whether they are white. If so their corresponding WeakRefs are cleared. This
requires a hash table lookup for every weak ref.

Differential Revision: https://phabricator.services.mozilla.com/D293099
2026-04-11 07:43:20 +00:00
Florian Quèze 7b92246a72 Bug 2020003 - Add weak map edge support to nsICycleCollectorHandler. r=mccr8,devtools-reviewers,ochameau
nsICycleCollectorHandler now exposes noteWeakMapEntry, allowing JS
consumers to receive weak map entries from the CC graph. This enables
ShutdownLeakPathFinder and CCAnalyzer to find retention paths that
pass through weak maps.

Differential Revision: https://phabricator.services.mozilla.com/D285345
2026-03-17 00:23:58 +00:00
Sylvestre Ledru 6149f49299 Bug 2023419 - Remove Emacs/Vim modelines from xpcom/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287878
2026-03-16 17:22:07 +00:00
serge-sans-paille eb509f640a Bug 2020587 - Replace copy assignment by move assignment in xpcom/ r=xpcom-reviewers,jstutte
Commit automatically generated through clang-tidy's
performance-use-std-move new pass.

- nsCOMPtr benefits from being moved

Differential Revision: https://phabricator.services.mozilla.com/D285675
2026-03-05 09:09:18 +00:00
Andreea Silaghi df905fef77 Revert "Bug 2020587 - Replace copy assignment by move assignment in xpcom/ r=xpcom-reviewers,jstutte" for causing failures at TestFileSystemHelpers This reverts commit d3c7b9c4d1.
This reverts commit 38c02da27e.
2026-03-04 08:20:03 +00:00
serge-sans-paille d3c7b9c4d1 Bug 2020587 - Replace copy assignment by move assignment in xpcom/ r=xpcom-reviewers,jstutte
Commit automatically generated through clang-tidy's
performance-use-std-move new pass.

- nsCOMPtr benefits from being moved

Differential Revision: https://phabricator.services.mozilla.com/D285675
2026-03-04 07:00:33 +00:00
Andrew McCreight 2511fadea6 Bug 2019360 - Don't give up hope if reserve fails in CCGraph::Init. r=smaug
This reserve call improves performance, but it is still possible that we can
complete a CC with a smaller graph, so we shouldn't give up immediately.
This matches the existing behavior when we fail to add things to mPtrInfoMap.

Differential Revision: https://phabricator.services.mozilla.com/D285078
2026-02-26 23:47:07 +00:00
Damien Carver d4d96c1939 Bug 1979356 - Remove the "searchable" flag from marker schema fields r=necko-reviewers,profiler-reviewers,toolkit-telemetry-reviewers,canaltinova,jesup
Differential Revision: https://phabricator.services.mozilla.com/D281769
2026-02-06 14:49:32 +00:00
unknown 6e08dc78bc Bug 2004126: Maintain min-size for CCGraph::mPtrInfoMap r=mccr8
The approved patch in bug 1477627 was not the one that landed.  The landed
code fails to maintain the min-size of an internal GC pointer map (16K)
and, after the first GC, reduces it to the min (4... as in 4, not 4K).  This
causes the GC to constantly do rehashes, which constitute over 20% of time
taken by GC in a profile with a very long (10 second) GC.

The patch in bug 1477627 also used HashSet::initialized in CCGraph::IsEmpty,
but that seems wrong and no longer exists anyway.

Differential Revision: https://phabricator.services.mozilla.com/D275109
2025-12-09 03:30:34 +00:00
Jon Coppeard 83ce0f2026 Bug 1997118 - Mark gray bits as invalid if we abort GC during marking r=sfink
We depend on GC marking to propagate gray umarking through zones that are being
marked incrementally. Aborting this raises the possibility of creating black to
gray edges as previously happened with this testcase.

Marking the gray bits as invalid will cause the CC to perform another GC to
redo the marking. Aborting GC is pretty rare in practice so I don't expect this
to have a performance impact.

Differential Revision: https://phabricator.services.mozilla.com/D270546
2025-10-30 13:04:27 +00:00
pstanciu 12bf2b1c53 Revert "Bug 1997118 - Mark gray bits as invalid if we abort GC during marking r=sfink" for causing assertion failure in Bug 1997268
This reverts commit 7a852d3774.
2025-10-30 11:04:35 +00:00
Jon Coppeard 7a852d3774 Bug 1997118 - Mark gray bits as invalid if we abort GC during marking r=sfink
We depend on GC marking to propagate gray umarking through zones that are being
marked incrementally. Aborting this raises the possibility of creating black to
gray edges as previously happened with this testcase.

Marking the gray bits as invalid will cause the CC to perform another GC to
redo the marking. Aborting GC is pretty rare in practice so I don't expect this
to have a performance impact.

Differential Revision: https://phabricator.services.mozilla.com/D270546
2025-10-30 08:07:43 +00:00
serge-sans-paille 2680f1aa2a Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth
Differential Revision: https://phabricator.services.mozilla.com/D269780
2025-10-27 10:48:42 +00:00
Cristian Tuns 6f66cdf3c7 Revert "Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth" for causing build bustages in TargetFunction.h
This reverts commit 10e5184168.
2025-10-27 08:58:03 +00:00
serge-sans-paille 10e5184168 Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth
Differential Revision: https://phabricator.services.mozilla.com/D269780
2025-10-27 08:00:43 +00:00
serge-sans-paille 1667ec582b Bug 1995723 - Remove unused inclusion of mozilla/ArrayUtils.h r=necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,firefox-svg-reviewers,layout-reviewers,gstoll,canaltinova,bytesized,alwu,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D269573
2025-10-23 07:30:37 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
Jon Coppeard 19e5fe9057 Bug 1994023 - Rework nsCycleCollector::FixGrayBits to avoid unnecessary work r=sfink,mccr8
Currently this can fix up the gray bits before doing a GC (which will calculate
them from scratch), as well as fix them up after a GC (which will do nothing).

Differential Revision: https://phabricator.services.mozilla.com/D268433
2025-10-15 07:31:52 +00:00
Florian Quèze 00b68125d6 Bug 1991876 - clear uncaught rejection observers during shutdown, r=smaug.
Differential Revision: https://phabricator.services.mozilla.com/D266980
2025-10-01 13:15:42 +00:00
alexical 43ffb6999d Bug 1974519 - Defer DOM wrapper preservation until necessary r=jonco
The main objective of this patch is to allow us to interact with DOM wrapper
preservation directly from the JIT, which it does by creating a deferred wrapper
preservation buffer which is consumed before any GC. The patch after this
handles writing to this buffer from the JIT where necessary.

Differential Revision: https://phabricator.services.mozilla.com/D255386
2025-08-25 22:02:07 +00:00
agoloman ef09549c24 Revert "Bug 1974519 - Preserve DOM wrappers from the JIT r=jandem" for causing mass failures.
This reverts commit 343da25eba.

Revert "Bug 1974519 - Defer DOM wrapper preservation until necessary r=jonco"

This reverts commit 04e2ad063b.
2025-08-18 17:50:43 +00:00
alexical 04e2ad063b Bug 1974519 - Defer DOM wrapper preservation until necessary r=jonco
The main objective of this patch is to allow us to interact with DOM wrapper
preservation directly from the JIT, which it does by creating a deferred wrapper
preservation buffer which is consumed before any GC. The patch after this
handles writing to this buffer from the JIT where necessary.

Differential Revision: https://phabricator.services.mozilla.com/D255386
2025-08-18 16:59:44 +00:00
Olli Pettay f83bdb220f Bug 1943811, delete snow white objects sooner in case there are lots of them, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D240914
2025-03-12 10:04:04 +00:00
Goloman Adrian 595de0c837 Backed out 4 changesets (bug 1943811) for causing hazard bustages. CLOSED TREE
Backed out changeset d676336db245 (bug 1943811)
Backed out changeset 2f56a6399ae7 (bug 1943811)
Backed out changeset 8146656f4566 (bug 1943811)
Backed out changeset 2eceb546abd2 (bug 1943811)
2025-03-12 01:16:56 +02:00
Olli Pettay 537d7e75dd Bug 1943811, delete snow white objects sooner in case there are lots of them, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D240914
2025-03-11 15:07:25 +00:00
Florian Quèze 15587550e8 Bug 1935420 - Migrate histograms to use Glean APIs in nsCycleCollector.cpp, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D233844
2025-01-24 14:36:18 +00:00
Andrew McCreight b0dbb78d4b Bug 1938613, part 2 - Delay initializing cycle collector logging. r=smaug
The goal of this is to make GetCurrentInnerOrOuterWindowCount()
more accurate. I was seeing regular cases where there was
a live window at the start of the CC but then it would
be freed by the shutdown GC before we actually start
traversing. This means that you need to disable GC logging
with MOZ_CC_DISABLE_GC_LOG=1 for this to fully work.

Differential Revision: https://phabricator.services.mozilla.com/D232740
2025-01-10 17:55:09 +00:00
Andrew McCreight afee1cb970 Bug 1938613, part 1 - Add a way to get a cycle collector log only if a window is alive. r=smaug
This adds the MOZ_CC_LOG_WINDOW_ONLY option. This makes it so that
we never get a CC log on the main thread unless there is a window
that is alive. This will result in less irrelevant logs when you
are investigating a DOM window leak.

I also moved the comments on the non-logging CC options first.

Differential Revision: https://phabricator.services.mozilla.com/D232739
2025-01-10 17:55:09 +00:00
Kagami Sascha Rosylight bde402617d Bug 1939902 - Assign the new path only if the move operation succeeded r=smaug
Unclear why the move operation fails at all (bug 1939902), but this will at least show the filename that actually has contents.

Differential Revision: https://phabricator.services.mozilla.com/D233188
2025-01-03 23:46:40 +00:00
Andrew McCreight 6b3276d70f Bug 1935172 - Remove cycle collector OOM telemetry. r=smaug,chutten
Differential Revision: https://phabricator.services.mozilla.com/D231124
2024-12-04 17:35:11 +00:00
Oliver Old 054846ec0f Bug 1240005 - Users of do_CreateInstance or InitWithNativePath/InitWithPath not checking return value r=necko-reviewers,xpcom-reviewers,media-playback-reviewers,emilio,karlt,valentin
Differential Revision: https://phabricator.services.mozilla.com/D227280
2024-11-25 16:54:11 +00:00
Olli Pettay 02cf9d555f Bug 1932501 - Fix the profiler description for mFreedRefCounted, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D229702
2024-11-20 22:00:36 +00:00
Olli Pettay c34e1b4de2 Bug 1930253 - CleanupPhase should clear the graph first and only after that free snow whites, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D228491
2024-11-08 21:57:55 +00:00
Emilio Cobos Álvarez 4c840d573b Bug 1925866 - NS_NewLocalFile's aFollowSymlinks arg is unused. r=xpcom-reviewers,necko-reviewers,valentin,media-playback-reviewers,win-reviewers,karlt,nika,rkraesig
Remove it and related functions, and update the callers.

Differential Revision: https://phabricator.services.mozilla.com/D226261
2024-10-22 09:38:16 +00:00
Denis Palmeiro 526e8ff001 Bug 1900846: Pass each individual field as parameters instead of the CycleCollectorResults struct when emitting the CCIntervalMarker profiler marker. r=canaltinova
The CCIntervalMarker marker accepts a CycleCollectorResults struct as one of it's parameters and emits each field individually during StreamJSONMarkerData.  This is difficult to translate to a perfetto track event, so instead pass each field directly to profiler_add_marker so that the parameters line up with the PayloadFields descriptions.

Differential Revision: https://phabricator.services.mozilla.com/D217411
2024-07-26 01:46:39 +00:00
Tamas Szentpeteri 740c54ff6b Backed out 4 changesets (bug 1900846) for causing crashes related to MarkerPhase.
Backed out changeset 3020439d8d51 (bug 1900846)
Backed out changeset 3a9a742747b0 (bug 1900846)
Backed out changeset 5c6c1e590b8c (bug 1900846)
Backed out changeset d5ba32edc63c (bug 1900846)
2024-07-25 01:17:17 +03:00