761 Commits

Author SHA1 Message Date
Steve Fink
c446c5e360 Bug 1977130 - Error-check pthread_getattr_np. r=glandium,spidermonkey-reviewers,jandem, a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D258648
2025-08-06 02:03:17 +00:00
Serban Stanca
72ddd15355 Revert "Bug 1928254 - pt 8. Improve the idle purge markers r=jstutte" for causing multiple failures.
This reverts commit 1de23dc2a6.

This reverts commit dc7de1e170.

This reverts commit 0891965b10.

This reverts commit 52c855715a.

This reverts commit fcdc85d6b4.

This reverts commit 1fa61503c2.

This reverts commit df279eb40e.

This reverts commit dd4278a7d5.
2025-05-16 08:52:29 +00:00
Paul Bone
df279eb40e Bug 1928254 - pt 2. Add profiler callbacks for mozjemalloc r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D227441
2025-05-16 07:32:51 +00:00
Atila Butkovits
77ba9a0aeb Revert "Bug 1928254 - pt 8. Improve the idle purge markers r=jstutte"
This reverts commit 990a75a96b.

Revert "Bug 1928254 - pt 7. Add more details to the Purge marker r=jstutte,profiler-reviewers,canaltinova"

This reverts commit c4b8597e6e.

Revert "Bug 1928254 - pt 6. Move PurgeResult to mozjemalloc_types.h r=jstutte"

This reverts commit 3f6a9d0a98.

Revert "Bug 1928254 - pt 5. Rename purge_result_t to avoid confusion with PurgeResult r=jstutte"

This reverts commit 5a56d09f72.

Revert "Bug 1928254 - pt 4. Add profiler markers for mozjemalloc's Purge() r=florian,profiler-reviewers"

This reverts commit e699aa7901.

Revert "Bug 1928254 - pt 3. Time the purge operation in mozjemalloc r=glandium"

This reverts commit 3b891ccfc3.

Revert "Bug 1928254 - pt 2. Add profiler callbacks for mozjemalloc r=glandium"

This reverts commit 362172ca5b.

Revert "Bug 1928254 - pt 1. Label arenas for the profiler r=glandium"

This reverts commit b1f31febeb.
2025-05-15 05:33:53 +00:00
Paul Bone
362172ca5b Bug 1928254 - pt 2. Add profiler callbacks for mozjemalloc r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D227441
2025-05-15 04:46:06 +00:00
Julian Gaibler
3a1fd68604 Bug 1954490 - Improve contrast between active tab and tabstrip. r=desktop-theme-reviewers,reusable-components-reviewers,emilio,mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D243454
2025-04-17 13:07:02 +00:00
Jan Varga
184befbabe Bug 1957326 - Extract NowIncludingSuspendMs() and NowExcludingSuspendMs() into separate .h/.cpp; r=glandium
This patch moves NowIncludingSuspendMs() and NowExcludingSuspendMs() into
dedicated files (Now.h and Now.cpp) to improve discoverability and reusability.

Differential Revision: https://phabricator.services.mozilla.com/D243624
2025-04-01 10:23:18 +00:00
Sandor Molnar
abb94a6ee7 Bug 1944461 - Fix build bustage 2025-01-29 23:28:49 +02:00
Mike Hommey
96fc388d92 Bug 1944461 - Work around glibc issue leading to crash in _Unwind_Backtrace on aarch64 linux with PAC. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D235916
2025-01-29 19:56:58 +00:00
Yannis Juglaret
a8307e0fbc Bug 1699328 - Use a unique session identifier for DbgHelp APIs in StackWalk.cpp. r=glandium,bobowen
This patch adds a helper class for using DbgHelp in StackWalk.cpp. It
also ensures that we use a unique identifier as a HANDLE for DbgHelp
APIs, instead of GetCurrentProcess() which can be used by other code
running within our process.

Differential Revision: https://phabricator.services.mozilla.com/D229134
2025-01-24 13:40:22 +00:00
André Bargull
e078d00aad Bug 1941001 - Part 2: Support uint32_t in SIMD memchr. r=spidermonkey-reviewers,jandem
Used in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D233885
2025-01-15 10:50:02 +00:00
Sandor Molnar
854105657a Backed out 13 changesets (bug 1941001) for causing build bustages. CLOSED TREE
Backed out changeset 4837b488b543 (bug 1941001)
Backed out changeset 5525330aa020 (bug 1941001)
Backed out changeset 8de4edbed18a (bug 1941001)
Backed out changeset 12990bf5b579 (bug 1941001)
Backed out changeset 59af1cd4e354 (bug 1941001)
Backed out changeset 8ee4080340a3 (bug 1941001)
Backed out changeset 11555d3ee9e6 (bug 1941001)
Backed out changeset 1f873198a368 (bug 1941001)
Backed out changeset 9d93f1251e11 (bug 1941001)
Backed out changeset e9a0f6cfb80d (bug 1941001)
Backed out changeset a3816bfd8968 (bug 1941001)
Backed out changeset 36f8e84f8262 (bug 1941001)
Backed out changeset c6ca49e9a2f4 (bug 1941001)
2025-01-14 20:50:44 +02:00
André Bargull
5f3f06b3bd Bug 1941001 - Part 2: Support uint32_t in SIMD memchr. r=spidermonkey-reviewers,jandem
Used in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D233885
2025-01-14 17:56:12 +00:00
Emilio Cobos Álvarez
d402fcd892 Bug 1934040 - Remove WS_SYSMENU when using custom titlebar, so that DWM doesn't draw caption buttons. r=win-reviewers,rkraesig
Unhide our buttons instead, which fixes the caption button sizes when
Mica is enabled.

Crucially (and this is what I had failed to do in my original attempts),
we need to keep WS_MAXIMIZEBOX for Snap Layouts and Aero snap to keep
working. WS_MINIMIZEBOX doesn't hurt either.

This is a bit scary, because we're in undocumented territory, but afaict
(looking with winspy), MS Edge does the same for its custom titlebar, so
I think this is probably safe. It's early in the cycle anyways...

Make the pre-xul skeleton UI flags more consistent while at it.
WS_OVERLAPPED is zero, and WS_SIZEBOX is the same as WS_THICKFRAME (so
there's no change other than removing WS_SYSMENU), but that way it
matches nsWindow::WindowStyle more directly.

In order to not fully lose the system menu functionality, reuse the
functionality we already have to show it on fullscreen windows (which
already lack these styles). Note that this also fixes a bug on which, if
you have a fullscreen window in a non-primary monitor, the system menu
shows up in the primary monitor instead of in your window.

Differential Revision: https://phabricator.services.mozilla.com/D230722
2024-12-03 16:51:28 +00:00
Emilio Cobos Álvarez
768894a512 Bug 1932600 - Use customtitlebar rather than tabsintitlebar in front-end code. r=dao,desktop-theme-reviewers,tabbrowser-reviewers,sidebar-reviewers,nsharpley
This is probably also a better reflection of reality now that we can
have vertical tabs which would by definition not be in the titlebar.

Differential Revision: https://phabricator.services.mozilla.com/D229767
2024-11-28 12:12:51 +00:00
Emilio Cobos Álvarez
feebe3d11d Bug 1930292 - Turn chromemargin into a boolean attribute. r=win-reviewers,desktop-theme-reviewers,pip-reviewers,firefox-desktop-core-reviewers ,dao,mconley,rkraesig
There are probably other simplifications that can be done after this on the
windows side of things, but I tried to keep this minimal.

Differential Revision: https://phabricator.services.mozilla.com/D229765
2024-11-28 12:12:50 +00:00
Emilio Cobos Álvarez
b04cbfd578 Bug 1930292 - Don't extend into the frame border area with chromemargin=0,0,0,0. r=win-reviewers,rkraesig
Windows 10 and 11 don't have fat windows, so this is unnecessary and
breaks other effects like the accent-color border (if you have "Show
accent color on titlebar and window borders" enabled).

We need to make the custom resize margin thing we have for PiP not mess
with our non-client area, but that is trivial.

Differential Revision: https://phabricator.services.mozilla.com/D229270
2024-11-28 12:12:50 +00:00
Emilio Cobos Álvarez
dcf6dc5521 Bug 1930292 - Stop setting non-zero chromemargin values. r=win-reviewers,handyman,firefox-desktop-core-reviewers ,dao
These only do something on Windows, and after windows 7 they are not
useful at all.

If this has no fallout I plan to simplify the code further in a
follow-up (we can basically make this a boolean attribute again or so).

Differential Revision: https://phabricator.services.mozilla.com/D228528
2024-11-28 12:12:49 +00:00
Cristina Horotan
bb08cc9f1d Backed out 5 changesets (bug 1930292, bug 1932600) for causing chrome failures at test_maximized_persist.xhtml on a CLOSED TREE
Backed out changeset 2418bfee53f1 (bug 1932600)
Backed out changeset 3297e990715a (bug 1932600)
Backed out changeset 24a670dea977 (bug 1930292)
Backed out changeset 7dd9f48216dd (bug 1930292)
Backed out changeset 15a85ec739dd (bug 1930292)
2024-11-28 06:57:35 +02:00
Emilio Cobos Álvarez
26de824592 Bug 1932600 - Use customtitlebar rather than tabsintitlebar in front-end code. r=dao,desktop-theme-reviewers,tabbrowser-reviewers,sidebar-reviewers,nsharpley
This is probably also a better reflection of reality now that we can
have vertical tabs which would by definition not be in the titlebar.

Differential Revision: https://phabricator.services.mozilla.com/D229767
2024-11-28 03:26:50 +00:00
Emilio Cobos Álvarez
67678746e6 Bug 1930292 - Turn chromemargin into a boolean attribute. r=win-reviewers,desktop-theme-reviewers,pip-reviewers,firefox-desktop-core-reviewers ,dao,mconley,rkraesig
There are probably other simplifications that can be done after this on the
windows side of things, but I tried to keep this minimal.

Differential Revision: https://phabricator.services.mozilla.com/D229765
2024-11-28 03:26:50 +00:00
Emilio Cobos Álvarez
fbdffd3c4b Bug 1930292 - Don't extend into the frame border area with chromemargin=0,0,0,0. r=win-reviewers,rkraesig
Windows 10 and 11 don't have fat windows, so this is unnecessary and
breaks other effects like the accent-color border (if you have "Show
accent color on titlebar and window borders" enabled).

We need to make the custom resize margin thing we have for PiP not mess
with our non-client area, but that is trivial.

Differential Revision: https://phabricator.services.mozilla.com/D229270
2024-11-28 03:26:49 +00:00
Emilio Cobos Álvarez
e974845dc9 Bug 1930292 - Stop setting non-zero chromemargin values. r=win-reviewers,handyman,firefox-desktop-core-reviewers ,dao
These only do something on Windows, and after windows 7 they are not
useful at all.

If this has no fallout I plan to simplify the code further in a
follow-up (we can basically make this a boolean attribute again or so).

Differential Revision: https://phabricator.services.mozilla.com/D228528
2024-11-28 03:26:49 +00:00
Butkovits Atila
db47532337 Backed out changeset 9d9fe1cd50ec (bug 1930292) for causing Win11 visual regressions. CLOSED TREE 2024-11-21 13:12:06 +02:00
Emilio Cobos Álvarez
2b85aaa22e Bug 1931778 - Remove unnecessary condition in PreXULSkeletonUI. r=win-reviewers,rkraesig
We always have Dwm{Get,Set}WindowAttribute because we fail if we can't
load them.

This in practice means that we release the DC and uncloak the window a
bit later (due to the MakeScopeExits), but I think that's fine.

Differential Revision: https://phabricator.services.mozilla.com/D229267
2024-11-18 16:06:14 +00:00
Emilio Cobos Álvarez
dbf2b28e46 Bug 1930292 - Stop setting non-zero chromemargin values. r=win-reviewers,handyman
These only do something on Windows, and after windows 7 they are not
useful at all.

If this has no fallout I plan to simplify the code further in a
follow-up (we can basically make this a boolean attribute again or so).

Differential Revision: https://phabricator.services.mozilla.com/D228528
2024-11-16 13:54:37 +00:00
Sandor Molnar
12cee70227 Backed out changeset 1893713e1d17 (bug 1930292) for causing bc failures @ browser_findbar_marks.js CLOSED TREE 2024-11-16 07:03:50 +02:00
Emilio Cobos Álvarez
5d9d166821 Bug 1930292 - Stop setting non-zero chromemargin values. r=win-reviewers,handyman
These only do something on Windows, and after windows 7 they are not
useful at all.

If this has no fallout I plan to simplify the code further in a
follow-up (we can basically make this a boolean attribute again or so).

Differential Revision: https://phabricator.services.mozilla.com/D228528
2024-11-16 01:48:48 +00:00
Emilio Cobos Álvarez
9d3a016079 Bug 1930284 - Also clean-up toolbar color variables. r=desktop-theme-reviewers,dao
Unlike the previous patch this does change behavior, but I think it's
fine.

The reason we used the non-lwt toolbar colors for customize mode is to
guarantee full opacity, see bug 1762379 and bug 1765685.

However, we need to do the same on the sidebar, and there we chose a
more theme-friendly way of doing that, which allows this simplification.

So do that instead.

Differential Revision: https://phabricator.services.mozilla.com/D228523
2024-11-11 11:10:42 +00:00
serge-sans-paille
5946338a6a Bug 1920718 - Annotate all global variable with runtime initialization attributes r=glandium,application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh,geckoview-reviewers,win-reviewers,gstoll,m_kato
MOZ_RUNINIT => initialized at runtime
MOZ_CONSTINIT => initialized at compile time
MOZ_GLOBINIT => initialized either at runtime or compile time, depending on template parameter, macro parameter etc
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-30 11:05:24 +00:00
serge-sans-paille
262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Gijs Kruitbosch
c01e216b43 Bug 1925577 - make skeleton UI not draw the tabstrip if it's disabled by vertical tabs, r=dthayer
This doesn't take on the task of also drawing the sidebar, as gathering state for that
is a little more complex to do. Purely removing the flicker from the top of the window
(and potential user confusion about why there is a horizontal tab there) seems a
worthwhile improvement.

Differential Revision: https://phabricator.services.mozilla.com/D226822
2024-10-25 22:51:51 +00:00
Alexandru Marc
a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Vincent Hilla
e68a44cb57 Bug 868874 - Remove Decimal::toString(char*, size_t). r=jwatt,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D216041
2024-10-22 13:21:56 +00:00
Yannis Juglaret
addbb1c6db Bug 1839299 - Use a finer-grained strategy to protect RtlLookupFunctionEntry against deadlocks. r=win-reviewers,rkraesig
On 64-bit Windows (x86_64, aarch64), stack walking relies on
RtlLookupFunctionEntry to navigate from one frame to the next. This
function acquires up to two ntdll internal locks when it is called.

The profiler and the background hang monitor both need to walk the
stacks of suspended threads. This can lead to deadlock situations,
which so far we have avoided with stack walk suppressions. We guard some
critical paths to mark them as suppressing stack walk, and we forbid
stack walking when any thread is currently on such path.

While stack walk suppression has helped remove most deadlock situations,
some can remain because it is hard to detect and manually annotate all
the paths that could lead to a deadlock situation. Another drawback is
that stack walk suppression disables stack walking for much larger
portions of code than required. For example, we disable stack walking
for LdrLoadDll, so we cannot collect stacks while we are loading a DLL.
Yet, the lock that could lead to a deadlock situation is only held
during a very small portion of the whole time spent in LdrLoadDll.

This patch addresses these two issues by implementing a finer-grained
strategy to avoid deadlock situations. We acquire the pointers to the
internel ntdll locks through a single-stepped execution of
RtlLookupFunctionEntry. This allows us to try to acquire the locks
non-blockingly so that we can guarantee safe stack walking with no
deadlock.

If we fail to collect pointers to the locks, we fall back to using stack
walk suppressions like before. This way we get the best of both worlds:
if we are confident that the situation is under control, we will use the
new strategy and get better profiler accuracy and no deadlock; in case
of doubt, we can still use the profiler thanks to stack walk
suppressions.

Differential Revision: https://phabricator.services.mozilla.com/D223498
2024-10-17 13:47:04 +00:00
Adi
49993486c8 Backed out changeset e6475b7e0602 (bug 1839299) for causing instrumented build bustages. 2024-10-17 14:55:27 +03:00
Yannis Juglaret
dee381b688 Bug 1839299 - Use a finer-grained strategy to protect RtlLookupFunctionEntry against deadlocks. r=win-reviewers,rkraesig
On 64-bit Windows (x86_64, aarch64), stack walking relies on
RtlLookupFunctionEntry to navigate from one frame to the next. This
function acquires up to two ntdll internal locks when it is called.

The profiler and the background hang monitor both need to walk the
stacks of suspended threads. This can lead to deadlock situations,
which so far we have avoided with stack walk suppressions. We guard some
critical paths to mark them as suppressing stack walk, and we forbid
stack walking when any thread is currently on such path.

While stack walk suppression has helped remove most deadlock situations,
some can remain because it is hard to detect and manually annotate all
the paths that could lead to a deadlock situation. Another drawback is
that stack walk suppression disables stack walking for much larger
portions of code than required. For example, we disable stack walking
for LdrLoadDll, so we cannot collect stacks while we are loading a DLL.
Yet, the lock that could lead to a deadlock situation is only held
during a very small portion of the whole time spent in LdrLoadDll.

This patch addresses these two issues by implementing a finer-grained
strategy to avoid deadlock situations. We acquire the pointers to the
internel ntdll locks through a single-stepped execution of
RtlLookupFunctionEntry. This allows us to try to acquire the locks
non-blockingly so that we can guarantee safe stack walking with no
deadlock.

If we fail to collect pointers to the locks, we fall back to using stack
walk suppressions like before. This way we get the best of both worlds:
if we are confident that the situation is under control, we will use the
new strategy and get better profiler accuracy and no deadlock; in case
of doubt, we can still use the profiler thanks to stack walk
suppressions.

Differential Revision: https://phabricator.services.mozilla.com/D223498
2024-10-17 09:43:15 +00:00
Emilio Cobos Álvarez
dcabc97050 Bug 1922250 - Align skeleton ui with nsWindow more closely. r=win-reviewers,rkraesig
This maps better to the code we have in nsWindow, and fixes a couple
bugs which caused maximized skeleton UI-consuming windows to be
mispositioned with the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D225100
2024-10-14 10:55:25 +00:00
Noemi Erli
4cd2a59294 Backed out 3 changesets (bug 1922250) for causing failures in browser_1446343-windowsize.js CLOSED TREE
Backed out changeset f4e18a092cba (bug 1922250)
Backed out changeset 9af0852c057c (bug 1922250)
Backed out changeset c7ebee651e07 (bug 1922250)
2024-10-12 07:48:39 +03:00
Emilio Cobos Álvarez
52a6578497 Bug 1922250 - Align skeleton ui with nsWindow more closely. r=win-reviewers,rkraesig
This maps better to the code we have in nsWindow, and fixes a couple
bugs which caused maximized skeleton UI-consuming windows to be
mispositioned with the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D225100
2024-10-11 08:37:23 +00:00
Tamas Szentpeteri
8285dfaab8 Backed out changeset 4b1409597101 (bug 1920718) for causing bp bustages on rapl.cpp. 2024-10-08 23:27:18 +03:00
serge-sans-paille
1966f9a43c Bug 1920718 - Annotate all global variable with runtime initialization as MOZ_RUNINIT r=application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-08 16:49:51 +00:00
Paul Adenot
25aeb02b9b Bug 1921288 - Add a way to get the associated duration type from TimeStamp and AwakeTimeStamp. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D223792
2024-10-03 08:54:11 +00:00
Paul Adenot
3c35cdab87 Bug 1921288 - Add some arithmetic and conversion functions to AwakeTimeStamp. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D223791
2024-10-03 08:54:11 +00:00
Paul Adenot
c7bf50cb98 Bug 1921288 - Teach AwakeTimeStamp to do precise timestamps on Windows, rename methods. r=gsvelto
This uses a function that has been introduced in Windows 10.

Differential Revision: https://phabricator.services.mozilla.com/D223790
2024-10-03 08:54:11 +00:00
Sandor Molnar
378adb8805 Backed out 6 changesets (bug 1921288) for causing build bustages. CLOSED TREE
Backed out changeset c03d69e623b9 (bug 1921288)
Backed out changeset 111bef5016a9 (bug 1921288)
Backed out changeset 17130f51de88 (bug 1921288)
Backed out changeset a4acd335a710 (bug 1921288)
Backed out changeset c5fc8bc8273a (bug 1921288)
Backed out changeset 744f7a82c471 (bug 1921288)
2024-10-02 21:11:06 +03:00
Paul Adenot
d9ae012f14 Bug 1921288 - Fix bustage, QueryUnbiasedInterruptTimePrecise return value is void
Differential Revision: https://phabricator.services.mozilla.com/D224359
2024-10-02 16:45:10 +00:00