Commit Graph

2630 Commits

Author SHA1 Message Date
Andrew McCreight
221b1aac47 Bug 1931877, part 3 - Add a "nothing" comment for all empty do loops in Assertions.h. r=glandium
My initial version of my patch for part 1 didn't have a "nothing" comment
because I copied the empty loop from somewhere that didn't have it. If
the comment is appropriate, let's make things consistent while I'm
touching this file anyways.

Differential Revision: https://phabricator.services.mozilla.com/D229500
2024-11-20 16:37:50 +00:00
Andrew McCreight
e239bce2c0 Bug 1931877, part 1 - Define MOZ_DIAGNOSTIC_CRASH. r=glandium
Also use it in MOZ_ALWAYS_TRUE and fix up the comment.

Differential Revision: https://phabricator.services.mozilla.com/D229360
2024-11-20 16:37:49 +00:00
Andreas Pehrson
7ca1c4d5c0 Bug 1920972 - Allow CC traversal of const RefPtr. r=glandium,jgilbert
For traversing an object that wraps a RefPtr and allows setting a new (copied)
value, but only has a const getter, like Canonical<RefPtr<T>> from
StateMirroring.h and Watchable<RefPtr<T>> from StateWatching.h.

Differential Revision: https://phabricator.services.mozilla.com/D224714
2024-11-15 23:19:05 +00:00
Jon Coppeard
aeab420bef Bug 1927417 - Part 1: Add mozilla::BitSet methods to efficiently find the next and previous bits set r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D227039
2024-11-06 08:21:48 +00:00
serge-sans-paille
8a0a0f7524 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
Botond Ballo
079f11645d Bug 1927901 - Have MOZ_CRASH print a stack trace on Android as well. r=nika
Also remove extra newlines between the frames of MOZ_ASSERT's stack trace.
__android_log_print already prints a newline.

Differential Revision: https://phabricator.services.mozilla.com/D227282
2024-10-30 00:25:10 +00:00
serge-sans-paille
e54774d573 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
Alexandru Marc
191ccbe7fe Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
53068cdf31 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
83543f20f2 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
c7a369b29a 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
Paul Adenot
6a1d862d72 Bug 1717448 - Print the diagnostic message in AssertedCast with {fmt}. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D216967
2024-10-21 12:54:55 +00:00
Tamas Szentpeteri
6e1a798714 Backed out 13 changesets (bug 1717448) for causing gtest failures on iofwrite.c
Backed out changeset 4254666ea8a7 (bug 1717448)
Backed out changeset 41c8a260d55b (bug 1717448)
Backed out changeset 670256c85479 (bug 1717448)
Backed out changeset 37ab78b00a4f (bug 1717448)
Backed out changeset 5e5b42a7cde1 (bug 1717448)
Backed out changeset 8295836348fb (bug 1717448)
Backed out changeset aebf794911ca (bug 1717448)
Backed out changeset 4381f24f8495 (bug 1717448)
Backed out changeset f0ca736c051b (bug 1717448)
Backed out changeset 993a64fd729a (bug 1717448)
Backed out changeset 2e17fb168eaf (bug 1717448)
Backed out changeset 47ed151719a4 (bug 1717448)
Backed out changeset adef9b3b6231 (bug 1717448)
2024-10-18 20:03:47 +03:00
Paul Adenot
903b1edfe3 Bug 1717448 - Print the diagnostic message in AssertedCast with {fmt}. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D216967
2024-10-18 11:35:38 +00:00
Emilio Cobos Álvarez
a79a09ba6d Bug 1923505 - Simplify LinkedList -> nsTArray conversion. r=xpcom-reviewers,hiro,nika
Add a ToTArray version that works with LinkedList.

This is much like what we do for other containers, but without walking the list
twice.

Differential Revision: https://phabricator.services.mozilla.com/D225001
2024-10-16 10:32:01 +00:00
Mike Hommey
8aedb008df Bug 1924278 - Remove whitespace in literal operator declarations. r=nika
That form has been deprecated, and clang trunk now complains about it.
See https://cplusplus.github.io/CWG/issues/2521.html

Differential Revision: https://phabricator.services.mozilla.com/D225560
2024-10-15 19:51:42 +00:00
Tamas Szentpeteri
8be45dd280 Backed out changeset 4b1409597101 (bug 1920718) for causing bp bustages on rapl.cpp. 2024-10-08 23:27:18 +03:00
serge-sans-paille
069a97307f 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
Nika Layzell
bb85d44899 Bug 1440207 - Part 5: Disable UniqueFileHandle for RUST_BINDGEN, r=emilio,glandium
Apparently rust bindgen uses a hack which assumes all specializations of
`UniquePtr` have the basic layout and use a pointer member with an empty
deleter.

This incorrect assumption unfortunately comes up for UniqueFileHandle,
which replaces the pointer type using the deleter with a file handle
helper type.

As this fails to build with RUST_BINDGEN, this patch takes the same
approach as bug 1802320, and just disables building these types when
building headers for bindgen.

This does not fix the general issue of bindgen making incorrect
assumptions about the layout of UniquePtr with non-default deleters.
Ideally, all non-default deleters should be made opaque.

Differential Revision: https://phabricator.services.mozilla.com/D223628
2024-10-01 22:21:52 +00:00
Nika Layzell
6027e4657c Bug 1440207 - Part 2: Add a cross-platform DuplicateFileHandle method to MFBT, r=glandium
This is convenient in cross-platform code which needs to work with
`UniqueFileHandle` objects. `dup` is not supported by wasi, so the method isn't
available there.

Differential Revision: https://phabricator.services.mozilla.com/D221370
2024-10-01 22:21:47 +00:00
serge-sans-paille
02f6aabd04 Bug 1920003 - Make OptimizationLevelInfo constexpr compatible r=jandem
That way IonOptimizations can be flagged as constexpr, removing a global
constructor.

Differential Revision: https://phabricator.services.mozilla.com/D223081
2024-09-30 09:56:01 +00:00
serge-sans-paille
9fe7340352 Bug 1919778 - Flag EnumeratedArray variable from dom/media/ipc/RemoteDecoderManagerChild.cpp as MOZ_CONSTINIT r=media-playback-reviewers,padenot
This makes sure we don't have associated global constructor.

It requires flagging some default constructor as constexpr, including
one from a union which we circumvent by adding a default field for the
uninitialized state of the union.

Differential Revision: https://phabricator.services.mozilla.com/D222799
2024-09-29 11:38:07 +00:00
serge-sans-paille
4e78eee820 Bug 1919777 - Introduce MOZ_CONSTINIT as a C++17 - compatible alternative to C++20 constinit r=glandium
This attribute can be used to guarantee that some global initialization take
place at compile-time, avoiding library loading overhead and static
initialization order fiasco.

Differential Revision: https://phabricator.services.mozilla.com/D222798
2024-09-27 06:25:22 +00:00
Cristian Tuns
44fb28a14e Backed out 13 changesets (bug 1440207) for causing multiple failures. CLOSED TREE
Backed out changeset c9f33dfc1cc5 (bug 1440207)
Backed out changeset 76d823a34925 (bug 1440207)
Backed out changeset 75a99142ee1c (bug 1440207)
Backed out changeset b4d283d3e8da (bug 1440207)
Backed out changeset ea81a08ce181 (bug 1440207)
Backed out changeset c581a4e8cd15 (bug 1440207)
Backed out changeset d13799a1dc26 (bug 1440207)
Backed out changeset 6d715586c911 (bug 1440207)
Backed out changeset 30ff6a4db1d0 (bug 1440207)
Backed out changeset 2da0bbfdfee5 (bug 1440207)
Backed out changeset f3445c3fdd5e (bug 1440207)
Backed out changeset 07fbed499fe4 (bug 1440207)
Backed out changeset 1c2ac609c466 (bug 1440207)
2024-09-24 19:10:35 -04:00
Nika Layzell
89cab9e217 Bug 1440207 - Part 2: Add a cross-platform DuplicateFileHandle method to MFBT, r=glandium
This is convenient in cross-platform code which needs to work with
`UniqueFileHandle` objects. `dup` is not supported by wasi, so the method isn't
available there.

Differential Revision: https://phabricator.services.mozilla.com/D221370
2024-09-24 19:28:09 +00:00
Butkovits Atila
17be8516f2 Backed out 3 changesets (bug 1919774, bug 1919777, bug 1919778) for causing Hazard bustages at RegExpAPI.cpp. CLOSED TREE
Backed out changeset 7db42ac7850b (bug 1919778)
Backed out changeset bbee56d7b39e (bug 1919777)
Backed out changeset 73f28606793b (bug 1919774)
2024-09-24 16:04:10 +03:00
serge-sans-paille
5f458346bd Bug 1919778 - Flag EnumeratedArray variable from dom/media/ipc/RemoteDecoderManagerChild.cpp as MOZ_CONSTINIT r=media-playback-reviewers,padenot
This makes sure we don't have associated global constructor.

It requires flagging some default constructor as constexpr, including
one from a union which we circumvent by adding a default field for the
uninitialized state of the union.

Differential Revision: https://phabricator.services.mozilla.com/D222799
2024-09-24 11:28:48 +00:00
serge-sans-paille
19462258c8 Bug 1919777 - Introduce MOZ_CONSTINIT as a C++17 - compatible alternative to C++20 constinit r=glandium
This attribute can be used to guarantee that some global initialization take
place at compile-time, avoiding library loading overhead and static
initialization order fiasco.

Differential Revision: https://phabricator.services.mozilla.com/D222798
2024-09-24 11:28:47 +00:00
serge-sans-paille
875628fc84 Bug 1919767 - Flag various EnumSet<...> globals as constexpr in js/src/gc/GC.cpp r=sfink
This requires to flag some method from Enumset as constexpr but make it
clear that those don't require a global constructor.

Differential Revision: https://phabricator.services.mozilla.com/D222792
2024-09-20 05:54:01 +00:00
serge-sans-paille
f759d0da74 Bug 1918688 - Use standard headers for infinity, and float's max/min r=nbp,media-playback-reviewers,glandium,karlt
Still rely on mozilla aliases though, for readability and to avoid
confusion in the case of NegativeInfinity.

As a bonus, provide MaxNumberValue that mirrors MinNumberValue.

Differential Revision: https://phabricator.services.mozilla.com/D222119
2024-09-19 12:22:43 +00:00
Kagami Sascha Rosylight
5257401911 Bug 1879444 - Add test r=smaug,dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D201599
2024-09-18 15:25:24 +00:00
Norisz Fay
ffcbe31f46 Backed out changeset 8264a4d4762f (bug 1879444) for causing SM bustages on TestRefPtr.cpp CLOSED TREE 2024-09-14 00:22:25 +03:00
Kagami Sascha Rosylight
a3432833b0 Bug 1879444 - Add test r=smaug,dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D201599
2024-09-13 20:51:35 +00:00
Mike Hommey
d46c6229a7 Bug 1917739 - Move Lz4 and mfbt/Compression* to mozglue/static. r=nika,frontend-codestyle-reviewers
As per mozglue/static/README:

> mozglue/static contains parts of the mozglue library that can/should be
> statically linked to e.g. js/Gecko.

The compression part of MFBT is a good candidate for this.

Differential Revision: https://phabricator.services.mozilla.com/D221565
2024-09-10 20:35:56 +00:00
Emilio Cobos Álvarez
1b8d105218 Bug 1916311 - [css-view-transitions] Initial pass at DOM API internals. r=boris,webidl,smaug
This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
https://github.com/w3c/csswg-drafts/issues/10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
2024-09-04 20:24:55 +00:00
Butkovits Atila
c96c1efe67 Backed out 4 changesets (bug 1916311) for causing wpt failures at no-crash-set-exception.html. CLOSED TREE
Backed out changeset 7a2f34195c02 (bug 1916311)
Backed out changeset 09b974edc310 (bug 1916311)
Backed out changeset 91431bf2cb69 (bug 1916311)
Backed out changeset cadf4f0266df (bug 1916311)
2024-09-04 20:58:46 +03:00
Emilio Cobos Álvarez
eb57419108 Bug 1916311 - [css-view-transitions] Initial pass at DOM API internals. r=boris,webidl,smaug
This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
https://github.com/w3c/csswg-drafts/issues/10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
2024-09-04 11:12:47 +00:00
Jan de Mooij
e5aa13a668 Bug 1915328 - Update mallocedBufferBytes for string buffers used by nursery strings. r=jonco
This lets us trigger a minor GC if we're allocating many long strings. This avoids
a memory spike on the test case reported in the bug.

Differential Revision: https://phabricator.services.mozilla.com/D220388
2024-09-04 10:49:51 +00:00
Jan de Mooij
72e9c67c58 Bug 1914378 part 3 - Use a StringBuffer for long flattened ropes. r=sfink
This seems to improve the TodoMVC-jQuery subtest on Speedometer 3 by a few percent.

Differential Revision: https://phabricator.services.mozilla.com/D219882
2024-08-27 07:23:47 +00:00
Tamas Szentpeteri
01124ea9cc Backed out 3 changesets (bug 1914378) for causing mochitest failures on MemoryMetrics.cpp. CLOSED TREE
Backed out changeset 3bbc90177641 (bug 1914378)
Backed out changeset 1ca488534853 (bug 1914378)
Backed out changeset b24f14e9449f (bug 1914378)
2024-08-26 16:10:11 +03:00
Jan de Mooij
3a03cc8a2d Bug 1914378 part 3 - Use a StringBuffer for long flattened ropes. r=sfink
This seems to improve the TodoMVC-jQuery subtest on Speedometer 3 by a few percent.

Differential Revision: https://phabricator.services.mozilla.com/D219882
2024-08-26 11:27:07 +00:00
André Bargull
c672727397 Bug 1910421: Support float16 in mozilla::FloatingPoint. r=jandem
Fixes the conversion in `mozilla::FloatingPoint` so we can add the specialisation
`mozilla::detail::FloatingPointTrait<js::float16>`.

And then update "TypedArrayObject.cpp" to directly use `mozilla::FloatingPoint`.

Differential Revision: https://phabricator.services.mozilla.com/D217981
2024-08-01 06:02:40 +00:00
Chun-Min Chang
8667329725 Bug 1865896 - Add ToString function to DefineEnum r=padenot
This patch addes some macros to implement to-string helpers for enums.

Differential Revision: https://phabricator.services.mozilla.com/D194260
2024-07-31 00:09:52 +00:00
fanc999
29c55a7924 Bug 1907001 - Add MOZ_HAS_CLANG_ATTRIBUTE r=glandium
Note this patch was provided by a contributor to fix MSVC builds of a SpiderMonkey embedding.

Differential Revision: https://phabricator.services.mozilla.com/D216843
2024-07-25 15:17:24 +00:00
jake
fd84534138 Bug 1909472 - Support unsigned long in T2S for wasm builds. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D217444
2024-07-24 12:46:12 +00:00
Jan de Mooij
fd85857bb1 Bug 1907891 part 2 - Create shared string buffer for long strings allocated by js::StringBuffer. r=sfink,emilio
In `JSStringBuilder` (derives from `js::StringBuffer`) we now reserve space for the
`mozilla::StringBuffer` header in the internal vector. When creating a long string, we can
then directly initialize this header without having to move all characters in memory.

Differential Revision: https://phabricator.services.mozilla.com/D216694
2024-07-24 12:21:07 +00:00
Ryan VanderMeulen
4e29f940e0 Bug 1909352 - Update LZ4 to v1.10.0. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D217344
2024-07-23 16:49:31 +00:00
Sylvestre Ledru
45030f6970 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato
This new version of clang 17 also slightly changed the formatting.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D215914
2024-07-17 11:15:31 +00:00
Paul Adenot
394c76bcc7 Bug 1907386 - Use T2S utility macro for both Darwin and Windows and both unsigned long and long. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D216779
2024-07-17 07:02:15 +00:00
Paul Adenot
0e5d229536 Bug 1907386 - Fix the build on iOS and Windows 32-bits. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D216564
2024-07-16 09:14:55 +00:00