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

2597 Коммитов

Автор SHA1 Сообщение Дата
Paul Adenot 291d65e213 Bug 1882518 - Print the PID when an assertion fails or MOZ_CRASH is reached in debug. r=gsvelto,glandium
Differential Revision: https://phabricator.services.mozilla.com/D202937
2024-03-26 09:42:11 +00:00
Andreas Pehrson 522fd9ad0a Bug 1601251 - Prohibit copies and moves on Maybe<T> where such operations are prohibited on T. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D205077
2024-03-26 08:00:56 +00:00
Stanca Serban 67ed3b15f0 Backed out changeset dda9d04389e1 (bug 1882518) for causing build bustages in Assertions.h. CLOSED TREE 2024-03-22 17:28:29 +02:00
Paul Adenot 30c2d20f64 Bug 1882518 - Print the PID when an assertion fails or MOZ_CRASH is reached in debug. r=gsvelto,glandium
Differential Revision: https://phabricator.services.mozilla.com/D202937
2024-03-22 12:19:50 +00:00
Andreas Pehrson 3deec9db93 Bug 1885840 - Add support for Maybe::orElse. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D204998
2024-03-22 08:17:06 +00:00
Andreas Pehrson 4ceb8a3f25 Bug 1885840 - Add support for Maybe::andThen. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D204997
2024-03-22 08:17:05 +00:00
Andreas Pehrson fdd885886a Bug 1885840 - Remove non-const overloads of apply and map for Maybe<T&>. r=glandium
They don't add any functionality since there is no non-const variant of ref().

Differential Revision: https://phabricator.services.mozilla.com/D204993
2024-03-22 08:17:05 +00:00
Andreas Pehrson 2fdcd7ef76 Bug 1885840 - To Maybe<T>, add rvalue variants of apply and map. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D204992
2024-03-22 08:17:04 +00:00
Andreas Pehrson 3a4d791e34 Bug 1885840 - Clarify comment in TestMaybe on why move operations unexpectedly work with a non-movable type. r=glandium
As Bug 1601251 states, those operations need to be explicitly deleted for the
asserts to hold.

Differential Revision: https://phabricator.services.mozilla.com/D204990
2024-03-22 08:17:04 +00:00
Norisz Fay 7334131da2 Backed out changeset 02d8b0bd7883 (bug 1882518) for causing build bustage on Assertions.h CLOSED TREE 2024-03-15 14:01:53 +02:00
Paul Adenot e2290e469b Bug 1882518 - Print the PID when an assertion fails or MOZ_CRASH is reached in debug. r=gsvelto,glandium
Differential Revision: https://phabricator.services.mozilla.com/D202937
2024-03-15 09:36:51 +00:00
Ray Kraesig 5cf89251a2 Bug 1880192 - [1/5] MozPromise.h: some C++17 modernizations r=xpcom-reviewers,emilio
Remove some type-level indirections from template-metaprogramming
helpers.

Additionally, replace some nearby uses of `typedef` with `using`, as
suggested by clang-tidy.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D201784
2024-03-05 17:22:21 +00:00
Peter Van der Beken 2b747df80a Bug 1640839 - Add some helpers for enums to calculate the size and use it in EnumeratedArray. r=glandium,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201334
2024-03-02 07:50:19 +00:00
Peter Van der Beken 9c8d00b7fb Bug 1640839 - Move size template parameter for EnumeratedArray to the end. r=glandium,jgilbert,media-playback-reviewers,credential-management-reviewers,padenot,dimi
This will allow us to provide a default value for the size when some enum
helper traits are defined.

Differential Revision: https://phabricator.services.mozilla.com/D201333
2024-03-02 07:50:19 +00:00
Natalia Csoregi 8c2521e9d5 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken f295b0c979 Bug 1640839 - Add some helpers for enums to calculate the size and use it in EnumeratedArray. r=glandium,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201334
2024-03-01 14:31:09 +00:00
Peter Van der Beken 8d1c9ad39c Bug 1640839 - Move size template parameter for EnumeratedArray to the end. r=glandium,jgilbert,media-playback-reviewers,credential-management-reviewers,padenot,dimi
This will allow us to provide a default value for the size when some enum
helper traits are defined.

Differential Revision: https://phabricator.services.mozilla.com/D201333
2024-03-01 14:31:09 +00:00
serge-sans-paille f3cfc8bfd7 Bug 1880420 - Move __thread detection to moz.configure r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D201937
2024-02-28 11:11:17 +00:00
Kelsey Gilbert b04996924d Bug 1037100 - Scoped.h removed because no outstanding uses. r=glandium,dom-storage-reviewers,jesup,janv
Differential Revision: https://phabricator.services.mozilla.com/D201763
2024-02-14 06:41:58 +00:00
Chris Peterson 515689e933 Bug 1880008 - Add char8_t string overloads to MFBT string functions when compiling with -std=c++20. r=xpcom-reviewers,emilio
When compiled with -std=c++17, u8"" string literals have type `const char[]`. When compiled with -std=c++20, u8"" string literals have type `const char8_t[]`. This patch adds the minimum char8_t overloads needed to compile Firefox with -std=c++20. If we want to use char8_t in more code or replace `Utf8Unit` with char8_t, that will require an extensive redesign of MFBT's and xpcom's string classes after we update from -std=c++17 to c++20.

Differential Revision: https://phabricator.services.mozilla.com/D201672
2024-02-14 01:33:31 +00:00
Christian Holler (:decoder) 700e5b34bc Bug 1875252 - Add MOZ_ASSERT_DEBUG_OR_FUZZING and use for Range/RangedPtr. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D198940
2024-02-06 21:31:19 +00:00
Emilio Cobos Álvarez 4c3cd32102 Bug 1878108 - Annotate FunctionRef constructor with MOZ_LIFETIME_BOUND. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D200433
2024-02-06 13:00:40 +00:00
Emilio Cobos Álvarez e445a2bc43 Bug 1878108 - Replace custom MOZ_LIFETIME_BOUND with built-in. r=nika,glandium
The built-in version is better as it also allows annotating particular
parameters (it not only applies to method declarations).

Differential Revision: https://phabricator.services.mozilla.com/D200432
2024-02-06 13:00:39 +00:00
pstanciu 1200f7991d Backed out 2 changesets (bug 1878108) for causing sm bustages in Attributes.h. CLOSED TREE
Backed out changeset 05e2d2bc1260 (bug 1878108)
Backed out changeset bb356c39c0e2 (bug 1878108)
2024-02-06 13:11:26 +02:00
Emilio Cobos Álvarez b5234811b5 Bug 1878108 - Annotate FunctionRef constructor with MOZ_LIFETIME_BOUND. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D200433
2024-02-06 08:51:51 +00:00
Emilio Cobos Álvarez 02f7ec8f63 Bug 1878108 - Replace custom MOZ_LIFETIME_BOUND with built-in. r=nika,glandium
The built-in version is better as it also allows annotating particular
parameters (it not only applies to method declarations).

Differential Revision: https://phabricator.services.mozilla.com/D200432
2024-02-06 08:51:50 +00:00
Emilio Cobos Álvarez f67e589a85 Bug 1877672 - Make FunctionRef a MOZ_TEMPORARY_CLASS. r=nika
This prevents it from being used in the foot-gunny way described in
comment 0.

This in turn allows us to add a constructor for temporary callables.

Turns out we only had test usages of non-temporary FunctionRefs, so this
is much simpler than the initial approach I considered.

Fix the tests to keep compiling, and add a test for the new constructor.

Differential Revision: https://phabricator.services.mozilla.com/D200157
2024-02-02 19:21:20 +00:00
Jan Varga 9cb0b76439 Bug 1873140 - Avoid using invalid enum values during EnumSet iteration; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D197824
2024-02-02 09:43:10 +00:00
Jan Varga ee30d0fa58 Bug 1873140 - Align internal methods to use UpperCamelCase in EnumSet implementation; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D197781
2024-02-02 09:43:10 +00:00
Jan Varga 8518e80c4a Bug 1873140 - Align index data types in EnumSet implementation; r=glandium
size_t is already correctly used in many places, only ConstIterator uses
uint32_t for position tracking. It would be better to align these data types
and use size_t everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D197774
2024-02-02 09:43:10 +00:00
maazis e59c20c0ea Bug 1860247 - Poison.cpp: do not use 'else' after 'return'. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D198695
2024-01-31 12:19:32 +00:00
Kelsey Gilbert 2bc302ee20 Bug 1873769 - Add TempPtrToSetter(UniquePtr<T>*) -> T**-ish for safe out-ptr RAII. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D198087
2024-01-26 21:05:30 +00:00
Mathew Hodson 1a67b423e3 Bug 1874533 - Fix build warning for noreturn function on Windows r=glandium
warning: function declared 'noreturn' should not return
[-Winvalid-noreturn]

Differential Revision: https://phabricator.services.mozilla.com/D198485
2024-01-18 11:48:49 +00:00
Mike Hommey 6e1293b5f7 Bug 1718516 - Fix AddToHash of 64-bits numbers on 32-bits platforms. r=nika,anba
Differential Revision: https://phabricator.services.mozilla.com/D197302
2024-01-09 01:48:31 +00:00
Jed Davis 7cb8ed130b Bug 1873131 - Add some assertions to UniqueFileHandle. r=nika,tsmith
Differential Revision: https://phabricator.services.mozilla.com/D197748
2024-01-06 02:54:20 +00:00
Tom Marble 4742739586 Bug 1859908 - convert .ini manifests to .toml: batch 20 marionette.ini r=jmaher,webdriver-reviewers,necko-reviewers,application-update-reviewers,search-reviewers,sessionstore-reviewers,places-reviewers,dom-storage-reviewers,bytesized,kershaw,whimboo,dao,jesup,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D197206
2024-01-02 15:31:51 +00:00
Benjamin Peterson fbd03780ee Bug 1866606 - Remove MozTaggedMemoryIsSupported. r=jld
MozTaggedMemoryIsSupported doesn't work under ASAN because it tries to prctl the
nullptr page. It should be harmless to simply call prctl and ignore the error.

Depends on D195064

Differential Revision: https://phabricator.services.mozilla.com/D195065
2023-12-23 03:36:53 +00:00
Benjamin Peterson 54b88de235 Bug 1866606 - Support TaggedAnonymousMemory on all Linux r=jld
Change ANDROID ifdefs to XP_LINUX and allow PR_SET_VMA in the sandbox.

Differential Revision: https://phabricator.services.mozilla.com/D195064
2023-12-23 03:36:52 +00:00
Ray Kraesig 149e60c039 Bug 1869053 - [2/5] eliminate all implicit conversions between RefPtr and AgileReference r=handyman,win-reviewers
Remove all of the code in `RefPtr` and `AgileReference` that allowed
for implicitly converting between the two in via constructors or the
assignment operator.

Replace these with a slightly-less-convenient-but-substantially-more-
explicit `Resolve` function family.

(This also eliminates the dependency that `class RefPtr` had on
`class AgileReference`.)

Differential Revision: https://phabricator.services.mozilla.com/D196365
2023-12-21 19:46:54 +00:00
Sandor Molnar a1bf4a20be Backed out 5 changesets (bug 1869053) for causing build bustages. CLOSED TREE
Backed out changeset 0a1ec143adbc (bug 1869053)
Backed out changeset 687e7683752c (bug 1869053)
Backed out changeset 59d9b136a3f2 (bug 1869053)
Backed out changeset 6ab85972356d (bug 1869053)
Backed out changeset 6addaa9e88be (bug 1869053)
2023-12-20 19:42:52 +02:00
Ray Kraesig 3665ce2e0b Bug 1869053 - [2/5] eliminate all implicit conversions between RefPtr and AgileReference r=handyman,win-reviewers
Remove all of the code in `RefPtr` and `AgileReference` that allowed
for implicitly converting between the two in via constructors or the
assignment operator.

Replace these with a slightly-less-convenient-but-substantially-more-
explicit `Resolve` function family.

(This also eliminates the dependency that `class RefPtr` had on
`class AgileReference`.)

Differential Revision: https://phabricator.services.mozilla.com/D196365
2023-12-20 17:06:21 +00:00
serge-sans-paille 870a5f2055 Bug 1869497 - Introduce MOZ_NAKED to centralize all attributes we expect from naked r=glandium,win-reviewers,mhowell
In the fx codebase, we tend to use __attribute__((naked)) for plain
assembly functions with a C interface. Instrumenting these functions can
mess up this assembly, so we conservatively also want to prevent
instrumentation.

Differential Revision: https://phabricator.services.mozilla.com/D196154
2023-12-15 09:26:48 +00:00
Jon Coppeard b9ade095dd Bug 1869256 - Add move assignment operator for SegmentedVector r=mccr8
The patch implements the move assigment operator in terms of the move
constructor. This fulfills the requirements for std::swap to compile.

Differential Revision: https://phabricator.services.mozilla.com/D196035
2023-12-11 17:06:08 +00:00
Norisz Fay af9c87c3e9 Backed out changeset d404928e57cf (bug 1869256) for causing SM bustages on TestSegmentedVector.cpp CLOSED TREE 2023-12-11 18:39:48 +02:00
Jon Coppeard 4f208d4ee5 Bug 1869256 - Add move assignment operator for SegmentedVector r=mccr8
The patch implements the move assigment operator in terms of the move
constructor. This fulfills the requirements for std::swap to compile.

Differential Revision: https://phabricator.services.mozilla.com/D196035
2023-12-11 16:01:35 +00:00
Yannis Juglaret 865f64bb14 Bug 1866562 - Make MSVC-style architecture constants consistent in mingwclang builds. r=tjr
This patch makes mingwclang builds compile with -include _mingw.h. This
makes MSVC-style constants defined from the start of C++ files rather
than at the point where they start including files that depend on
_mingw.h. Thus, mingwclang builds will behave more closely to regular
builds, potentially avoiding future backouts for mingwclang build
failures and/or successful but incorrect mingwclang builds.

Differential Revision: https://phabricator.services.mozilla.com/D195662
2023-12-11 11:01:34 +00:00
Paul Bone 4f15ab146d Bug 1864828 - pt 1. Move operators to create literals with units into mfbt/ r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D194950
2023-12-11 11:01:33 +00:00
Sylvestre Ledru ef35fa7374 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,media-playback-reviewers,padenot
clang-format version 17.0.6 (taskcluster-QueHFUviQeyM8Y7r_d7MQQ)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D195397
2023-12-04 10:09:36 +00:00
Iulian Moraru d6a3f6a6bd Backed out 2 changesets (bug 1864828) for causing build bustages on TestJemalloc.cpp. CLOSED TREE
Backed out changeset c1b4a8307702 (bug 1864828)
Backed out changeset ba88f119b1fc (bug 1864828)
2023-11-30 07:19:04 +02:00
Paul Bone e1f95a2d2b Bug 1864828 - pt 1. Move operators to create literals with units into mfbt/ r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D194950
2023-11-30 01:17:55 +00:00
Gabriele Svelto bf06bd8102 Bug 1866716 - Fixup for WasiAtomic.h CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D194875
2023-11-28 14:00:34 +00:00
Gabriele Svelto 2b83d1392f Bug 1866716 - Remove unneeded headers from Atomics.h r=glandium,profiler-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D194722
2023-11-28 13:14:49 +00:00
Paul Adenot 643afe2840 Bug 1814600 - Annotate abort calls as __attribute__((nomerge)) to get clearer line number when crashing on assertion failure. r=gsvelto,yjuglaret
Differential Revision: https://phabricator.services.mozilla.com/D168960
2023-11-10 13:54:54 +00:00
Tooru Fujisawa 3cea1dc675 Bug 1850723 - Make mozilla::Result constructor take another result with convertible value. r=emilio,glandium
Differential Revision: https://phabricator.services.mozilla.com/D191538
2023-11-03 08:13:19 +00:00
Tooru Fujisawa 42681ab6e5 Bug 1850710 - Add PackingStrategy::ZeroIsEmptyError for mozilla::Result. r=emilio,glandium
In order to use mozilla::Result with integral, pointer, or enum, without
consuming extra space or introducing extra instruction, reserve 0 as error value
in the underlying representation.

Differential Revision: https://phabricator.services.mozilla.com/D191537
2023-11-03 08:13:18 +00:00
Sandor Molnar e8f8acdf36 Backed out 4 changesets (bug 1850710, bug 1850723, bug 1489008) for causing failures on mfbt/tests/TestResult.cpp
Backed out changeset 7398cacb1ad3 (bug 1850723)
Backed out changeset 3ecdc29f9faf (bug 1850710)
Backed out changeset 0be8a44ae0b0 (bug 1489008)
Backed out changeset e1545a8ce2d8 (bug 1489008)
2023-11-03 06:00:46 +02:00
Tooru Fujisawa 6eecb51843 Bug 1850723 - Make mozilla::Result constructor take another result with convertible value. r=emilio,glandium
Differential Revision: https://phabricator.services.mozilla.com/D191538
2023-11-03 02:14:16 +00:00
Tooru Fujisawa b2945c75bf Bug 1850710 - Add PackingStrategy::ZeroIsEmptyError for mozilla::Result. r=emilio,glandium
In order to use mozilla::Result with integral, pointer, or enum, without
consuming extra space or introducing extra instruction, reserve 0 as error value
in the underlying representation.

Differential Revision: https://phabricator.services.mozilla.com/D191537
2023-11-03 02:14:16 +00:00
Jed Davis 850869a8df Bug 1595453 - Allow serializing zero-length `ByteBuf`s. r=nika
If someone tried to serialize a zero-size ByteBuf, it could add a
zero-length segment to the `BufferList` and cause an assertion failure
later when trying to send the message.  This patch makes it a no-op (and
frees the supplied buffer, because the BufferList becomes its owner).

We previously asserted against adding zero-*capacity* segments (likely
also zero size, but possibly not) with WriteBytesZeroCopy, but only on
debug builds, and it was likely happening on release builds despite
that.  That case is now allowed.

Also, error handling for `BufferList::WriteBytesZeroCopy` has been
improved.  (This doesn't affect `Pickle` because it's using infallible
allocation, and no other instances of `BufferList` seem to use
`WriteBytesZeroCopy` at this time.)

Differential Revision: https://phabricator.services.mozilla.com/D192531
2023-11-02 18:05:31 +00:00
Tooru Fujisawa 93738a7432 Bug 1860451 - Add documentation for the hash inequality in HashPolicy::match. r=mgaudet DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D191591
2023-10-31 20:41:17 +00:00
Andreas Pehrson 76a7426f90 Bug 1844181 - Add memory synchronization to SPSCQueue's thread id reset methods. r=decoder,padenot,handyman
Without this, the necessary synchronization must be provided externally.

This fixes the memory order in the following case of changing producer thread:
- Thread A does SPSCQueue::Enqueue
  - non-atomic write into the ring buffer, at memory location X
  - mWriteIndex.load(relaxed)
  - mWriteIndex.store(release)
- Producer thread is switched to B, no external memory order synchronization is
  provided, but thread B is guaranteed to run after thread A has finished its
  Enqueue task.
- Thread B does SPSCQueue::Enqueue
  - mWriteIndex.load(relaxed)
  - mWriteIndex.store(release)
- Thread C does SPSCQueue::Dequeue
  - mWriteIndex.load(acquire)
  - non-atomic read from the ring buffer, at memory location X

In this scenario, there is no memory synchronization between threads A and B,
and therefore the non-atomic read on C is a data race, and flagged as such by
TSAN.

A similar scenario can be applied to changing the consumer thread, if first A
enqueues, then B dequeues, then C dequeues. However, since Dequeue doesn't
necessarily (MoveOrCopy) do non-atomic writes to the ring buffer, and more
importantly, since Enqueue doesn't do non-atomic reads from the ring buffer,
this is less of a problem.

Differential Revision: https://phabricator.services.mozilla.com/D190084
2023-10-09 13:02:58 +00:00
Daniel Holbert aab09ae7db Bug 1856746: Extend already_AddRefed documentation to mention a case where it makes sense as a function parameter. r=nika
DONTBUILD because comment-only

Differential Revision: https://phabricator.services.mozilla.com/D189987
2023-10-04 18:49:03 +00:00
Yannis Juglaret b24022bb02 Bug 1777960 - Patch msctf.dll to prevent a crash with ZoneAlarm Anti-Keylogger. r=gstoll,win-reviewers
Starting with Windows 11 22H2, Microsoft has made internal changes in
msctf.dll. The TF_Notify function, also known as CtfImmNotify from
imm32.dll, uses a new convention for its third argument. These changes
are incompatible with current versions of ZoneAlarm Anti-Keylogger,
resulting in crashes in our main process.

This patch converts messages forwarded by ZoneAlarm Anti-Keylogger to
the new convention. If we detect the product and an incompatible version
of msctf.dll, then we hook TF_Notify and detect any message using the
old convention, and convert it to the new convention.

Differential Revision: https://phabricator.services.mozilla.com/D189518
2023-10-03 15:24:47 +00:00
Jan Varga c458754592 Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189226
2023-09-28 20:46:07 +00:00
Nika Layzell 9411a9ed15 Bug 1851045 - Part 4: Add a NeverDestroyed helper type to MFBT for static local members, r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189248
2023-09-27 19:14:16 +00:00
Mike Hommey 194571f479 Bug 1854305 - Don't enable thread safety annotations before clang 11. r=nika
Arbitrary capability names weren't allowed until clang 11, and while we
could probably make things somehow work with earlier versions of clang,
it's not that interesting, as long as we keep the thread safety analysis
running with newer versions of clang on our CI (which we obviously do).

Differential Revision: https://phabricator.services.mozilla.com/D188791
2023-09-21 20:42:33 +00:00
Masatoshi Kimura 84f3eeec16 Bug 1844908 - Remove unused Windows version check functions. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D184309
2023-08-22 19:11:41 +00:00
Emilio Cobos Álvarez 9b5ea61bed Bug 1849386 - Use consistent pointer hashing. r=nika,xpcom-reviewers
* DefaultHasher<T*> used HashGeneric<size_t>
 * nsPtrHashKey<T> used HashGeneric<T*>
 * nsRefPtrHashKey<T> used NS_PTR_TO_UINT32 >> 2

Make sure to always use HashGeneric<T*> for these.

Remove unused / redundant hash keys.

Differential Revision: https://phabricator.services.mozilla.com/D186553
2023-08-18 22:35:40 +00:00
Steve Fink 35da906445 Bug 1838827 - HashTable::reserve() should always report an error on failure r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D185191
2023-08-03 19:16:02 +00:00
Mike Hommey 4a05ff7242 Bug 1844484 - Override the symbol used by compilers in vtables for pure virtual methods. r=firefox-build-system-reviewers,ahochheiden
In bug 1839743, we made the build system prefer packed relative
relocations to elfhack when both the system libc and linker support
them. Unfortunately, while that covers most of the benefits from
elfhack, it doesn't cover bug 651892.

To cover it, we make every C++ executable contain its own copy of
the symbol, so that all relocations related to it become relative.

And because this is actually (slightly) beneficial on macos, and because
it's also an advantage to have our own abort called rather than the
system's, we apply the same to all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D184068
2023-08-02 06:12:51 +00:00
Noemi Erli 72a3108e1e Backed out changeset a2017655dd34 (bug 1844484) for causing failures in test_crash_purevirtual.js 2023-08-01 15:09:51 +03:00
Mike Hommey cf3f361146 Bug 1844484 - Override the symbol used by compilers in vtables for pure virtual methods. r=firefox-build-system-reviewers,ahochheiden
In bug 1839743, we made the build system prefer packed relative
relocations to elfhack when both the system libc and linker support
them. Unfortunately, while that covers most of the benefits from
elfhack, it doesn't cover bug 651892.

To cover it, we make every C++ executable contain its own copy of
the symbol, so that all relocations related to it become relative.

And because this is actually (slightly) beneficial on macos, and because
it's also an advantage to have our own abort called rather than the
system's, we apply the same to all platforms.

Differential Revision: https://phabricator.services.mozilla.com/D184068
2023-08-01 05:32:00 +00:00
Ryan VanderMeulen ded3dfb71d Bug 1845018 - Update xxHash to version 0.8.2. r=dthayer
Differential Revision: https://phabricator.services.mozilla.com/D184325
2023-07-26 16:21:11 +00:00
serge-sans-paille 4cb35b98e0 Bug 1844554 - Vendor double-conversion using `mach vendor` r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D184091
2023-07-21 08:12:09 +00:00
Nika Layzell effc2ca999 Bug 1843568 - Part 3: Annotate `nsIEventTarget` as rust_sync, r=xpcom-reviewers,barret
All event targets should be threadsafe and implemented in C++, and so should be
able to be used in `Sync` types in Rust code.

This also required annotating all interfaces deriving from `nsIEventTarget`, as
well as adding some associated constants to specific types to indicate to the
static assertion that they have threadsafe reference counts.

Differential Revision: https://phabricator.services.mozilla.com/D183592
2023-07-20 17:39:03 +00:00
Noemi Erli ec441901f7 Backed out 5 changesets (bug 1843568) for causing xpc failures in test_extension_permissions_migration.js CLOSED TREE
Backed out changeset a4cb1e2b9e3d (bug 1843568)
Backed out changeset 26047645c009 (bug 1843568)
Backed out changeset 50d6b858ee6e (bug 1843568)
Backed out changeset 3597df96ba38 (bug 1843568)
Backed out changeset 8faeb75f1161 (bug 1843568)
2023-07-19 22:54:13 +03:00
Nika Layzell 46c26f2961 Bug 1843568 - Part 3: Annotate `nsIEventTarget` as rust_sync, r=xpcom-reviewers,barret
All event targets should be threadsafe and implemented in C++, and so should be
able to be used in `Sync` types in Rust code.

This also required annotating all interfaces deriving from `nsIEventTarget`, as
well as adding some associated constants to specific types to indicate to the
static assertion that they have threadsafe reference counts.

Differential Revision: https://phabricator.services.mozilla.com/D183592
2023-07-19 18:03:45 +00:00
Markus Stange d65e61e97a Bug 1843181 - Make EqualRange return a std::pair. r=sergesanspaille
mozilla::CompactPair doesn't seem appropriate because its base class optimization doesn't apply.

Differential Revision: https://phabricator.services.mozilla.com/D178843
2023-07-14 21:51:27 +00:00
Tyson Smith afac244b61 Bug 1824768 - Add TSan suppressions for external libs. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D173791
2023-07-07 10:12:54 +00:00
Paul Adenot 348493c16c Bug 1838828 - Fix obsolete comment in Assertions.h: MOZ_RELEASE_ASSERT is no-op only in late beta and release. r=chunmin
This is controlled by this:
https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/moz.configure#125-134

Differential Revision: https://phabricator.services.mozilla.com/D182916
2023-07-07 00:51:27 +00:00
André Bargull 50d9348a9e Bug 1841314 - Part 3: Prefer JS::NewArrayBufferWithContents with UniquePtr. r=sfink,saschanaz
Replace the existing callers of `JS::NewArrayBufferWithContents` with the new
`UniquePtr` alternative.

Three callers to the old `JS::NewArrayBufferWithContents` function were left
unchanged:
- `mozilla::dom::FileReader::OnLoadEndArrayBuffer()` and
  `mozilla::dom::ArrayBufferBuilder::TakeArrayBuffer()` both store the data
  buffer as members and therefore have a more complicated lifetime.
- `JSStructuredCloneReader::readTransferMap()` because it's not clear if the
  data can be free'ed when `ArrayBuffectObject` allocation fails.

Differential Revision: https://phabricator.services.mozilla.com/D182588
2023-07-06 20:50:59 +00:00
Sandor Molnar a6c121377b Backed out 7 changesets (bug 1841314) for causing hazard failures. CLOSED TREE
Backed out changeset 82a53d6ea95a (bug 1841314)
Backed out changeset 524607b471a2 (bug 1841314)
Backed out changeset ce128e10bddb (bug 1841314)
Backed out changeset cdae4fbbdaff (bug 1841314)
Backed out changeset f1035b6c08fe (bug 1841314)
Backed out changeset 5897ad8ef181 (bug 1841314)
Backed out changeset 09618a767080 (bug 1841314)
2023-07-06 16:59:47 +03:00
André Bargull 412b9d7c45 Bug 1841314 - Part 3: Prefer JS::NewArrayBufferWithContents with UniquePtr. r=sfink,saschanaz
Replace the existing callers of `JS::NewArrayBufferWithContents` with the new
`UniquePtr` alternative.

Three callers to the old `JS::NewArrayBufferWithContents` function were left
unchanged:
- `mozilla::dom::FileReader::OnLoadEndArrayBuffer()` and
  `mozilla::dom::ArrayBufferBuilder::TakeArrayBuffer()` both store the data
  buffer as members and therefore have a more complicated lifetime.
- `JSStructuredCloneReader::readTransferMap()` because it's not clear if the
  data can be free'ed when `ArrayBuffectObject` allocation fails.

Differential Revision: https://phabricator.services.mozilla.com/D182588
2023-07-06 12:26:53 +00:00
Cristina Horotan f77c6f3e48 Backed out 7 changesets (bug 1841314) for causing hazard failures at js.cpp CLOSED TREE
Backed out changeset becc2fa2c186 (bug 1841314)
Backed out changeset e5b723317177 (bug 1841314)
Backed out changeset 61ae850b25e5 (bug 1841314)
Backed out changeset 9ff320c779b8 (bug 1841314)
Backed out changeset debf1172f794 (bug 1841314)
Backed out changeset 8ac4fa317006 (bug 1841314)
Backed out changeset eccacbb3b620 (bug 1841314)
2023-07-06 15:11:47 +03:00
André Bargull 0c386d5c4b Bug 1841314 - Part 3: Prefer JS::NewArrayBufferWithContents with UniquePtr. r=sfink,saschanaz
Replace the existing callers of `JS::NewArrayBufferWithContents` with the new
`UniquePtr` alternative.

Three callers to the old `JS::NewArrayBufferWithContents` function were left
unchanged:
- `mozilla::dom::FileReader::OnLoadEndArrayBuffer()` and
  `mozilla::dom::ArrayBufferBuilder::TakeArrayBuffer()` both store the data
  buffer as members and therefore have a more complicated lifetime.
- `JSStructuredCloneReader::readTransferMap()` because it's not clear if the
  data can be free'ed when `ArrayBuffectObject` allocation fails.

Differential Revision: https://phabricator.services.mozilla.com/D182588
2023-07-06 11:41:17 +00:00
Jesse Schwartzentruber 51d7504cd1 Bug 1766058 - Avoid mixing log output. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D179725
2023-06-19 20:44:29 +00:00
Kelsey Gilbert 0fb34553d5 Bug 1812353 - Update GPUSupportedLimits in webgpu.webidl. r=webgpu-reviewers,webidl,saschanaz,jimb,emilio,smaug
* Add validation for requested features and devices for
adapter.requestDevice().
* Promote webgl's AutoAssertCast to mfbt/Casting.h/LazyAssertedCast.

Differential Revision: https://phabricator.services.mozilla.com/D177110
2023-06-12 21:10:11 +00:00
Stanca Serban 7f8803cf62 Backed out changeset 8352bc23343d (bug 1812353) for causing build bustages in Adapter.cpp. CLOSED TREE 2023-06-09 23:42:09 +03:00
Kelsey Gilbert 2e186b9e3a Bug 1812353 - Update GPUSupportedLimits in webgpu.webidl. r=webgpu-reviewers,webidl,saschanaz,jimb,emilio,smaug
* Add validation for requested features and devices for
adapter.requestDevice().
* Promote webgl's AutoAssertCast to mfbt/Casting.h/LazyAssertedCast.

Differential Revision: https://phabricator.services.mozilla.com/D177110
2023-06-09 19:52:39 +00:00
Nicolas B. Pierron 7843dc698e Bug 1836964 - Add mozilla::MakeCompilerAssumeUnreachableFakeValue to abort if ever used. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D180089
2023-06-06 15:44:59 +00:00
Gabriele Svelto 0a57af7f2a Bug 1681846 - Ensure MOZ_CRASH() stores the reason in crash reports on 32-bit ARM/Android builds r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D179196
2023-05-31 06:58:36 +00:00
Chris Peterson 32b7b4e8da Bug 1791961 - mfbt: constify some operators to fix C++20 -Wambiguous-reversed-operator warnings. r=glandium
clang is warning that C++20 expects comparison operators to be commutative: `a == b` and `b == a` should resolve to the same comparison operator function. Warnings about the comparison of const and non-const objects can be fixed by making the comparison operator function const.

mfbt/tests/TestDoublyLinkedList.cpp:158:36 [-Wambiguous-reversed-operator] ISO C++20 considers use of overloaded operator '==' (with operand types 'SomeClass' and 'SomeClass') to be ambiguous despite there being a unique best viable function
mfbt/tests/TestDoublyLinkedList.cpp:159:38 [-Wambiguous-reversed-operator] ISO C++20 considers use of overloaded operator '==' (with operand types 'SomeClass' and 'SomeClass') to be ambiguous despite there being a unique best viable function

Depends on D179022

Differential Revision: https://phabricator.services.mozilla.com/D179023
2023-05-26 04:51:44 +00:00
Mike Hommey 38a3d1fae3 Bug 1834912 - Add iOS-related defines/ifdefs for IPC. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D178999
2023-05-25 02:48:33 +00:00
Paul Adenot 23ce79a819 Bug 1821362 - Replace EuclidGCD by a binary gcd algorithm using intrinsics. r=media-playback-reviewers,alwu
Perf notes:
https://lemire.me/blog/2013/12/26/fastest-way-to-compute-the-greatest-common-divisor/

Differential Revision: https://phabricator.services.mozilla.com/D173315
2023-05-24 13:18:41 +00:00
Paul Adenot 31157559f1 Bug 1821362 - Add a generic CountTrailingZeroes function that lowers to the right intrinsic based the type its called with. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173314
2023-05-24 13:18:41 +00:00
Paul Adenot b29794e7cc Bug 1830206 - Fix an overly restrictive assertion in the SPSC ringbuffer. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D177770
2023-05-24 13:11:46 +00:00
Ryan VanderMeulen 6af5555c16 Bug 1833859 - Update double-conversion to version 3.3.0. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D178437
2023-05-23 04:01:10 +00:00
Cosmin Sabou 5fd965f028 Backed out 80 changesets (bug 1821362, bug 1703812, bug 1817997) for causing media crashes as in Bug 1833890. a=backout
Backed out changeset f2113c9b661f (bug 1817997)
Backed out changeset f1ecfbba7ed2 (bug 1703812)
Backed out changeset 011cece33b0d (bug 1817997)
Backed out changeset 4b42659090f3 (bug 1817997)
Backed out changeset 2d92f903dd66 (bug 1817997)
Backed out changeset 0ef13d357ee3 (bug 1817997)
Backed out changeset 7353f869efd2 (bug 1703812)
Backed out changeset 14b061d0f595 (bug 1817997)
Backed out changeset d29bc29397c8 (bug 1703812)
Backed out changeset 54c3294f0839 (bug 1817997)
Backed out changeset b9f2e1155bd7 (bug 1817997)
Backed out changeset d5d5d390dcbf (bug 1817997)
Backed out changeset 8fca27bd0f6b (bug 1817997)
Backed out changeset 670c599a3b99 (bug 1817997)
Backed out changeset deea3077f762 (bug 1817997)
Backed out changeset 25ecea0f3d49 (bug 1817997)
Backed out changeset 35ab3ed5e3fc (bug 1817997)
Backed out changeset f516a428ba32 (bug 1817997)
Backed out changeset e589b4d30995 (bug 1817997)
Backed out changeset d096b9cc905d (bug 1817997)
Backed out changeset 2952a6fa06e5 (bug 1817997)
Backed out changeset c1ac4c31ad9a (bug 1817997)
Backed out changeset 04c60cd83c5f (bug 1821362)
Backed out changeset 6dd80575e551 (bug 1821362)
Backed out changeset b86b569ecd46 (bug 1817997)
Backed out changeset 412e0a9ec4e8 (bug 1817997)
Backed out changeset 8e0dcf163138 (bug 1817997)
Backed out changeset 7af506896930 (bug 1817997)
Backed out changeset 29f7cd2b341c (bug 1817997)
Backed out changeset 7f64e65d9497 (bug 1817997)
Backed out changeset 89c241451a32 (bug 1817997)
Backed out changeset 66e4a26e1ebe (bug 1817997)
Backed out changeset ea1aebd4e245 (bug 1817997)
Backed out changeset 2d88a5915db9 (bug 1817997)
Backed out changeset 697ec1928f9c (bug 1817997)
Backed out changeset 41c0bd1133c5 (bug 1817997)
Backed out changeset b20cc750c020 (bug 1817997)
Backed out changeset dc5fd84a3a4c (bug 1703812)
Backed out changeset efa6d130d4eb (bug 1703812)
Backed out changeset 20d9b7cf0ddc (bug 1703812)
Backed out changeset e77c61e8fad2 (bug 1703812)
Backed out changeset 582d5c680e5a (bug 1703812)
Backed out changeset 96c9aacc6811 (bug 1703812)
Backed out changeset 56ec4a57a6a6 (bug 1703812)
Backed out changeset 8f96c8811675 (bug 1703812)
Backed out changeset a79a2f1b2b51 (bug 1703812)
Backed out changeset 07eb8b2c5b9f (bug 1703812)
Backed out changeset bae2b2fb9759 (bug 1703812)
Backed out changeset 38b0416538f3 (bug 1703812)
Backed out changeset b27b54c95cf2 (bug 1703812)
Backed out changeset cab00065d83d (bug 1703812)
Backed out changeset ab44727b2e1a (bug 1703812)
Backed out changeset b7fdcb494670 (bug 1703812)
Backed out changeset 73db43d49c6d (bug 1703812)
Backed out changeset ce754dbfb862 (bug 1703812)
Backed out changeset d694726a3ee6 (bug 1703812)
Backed out changeset 6acede55acbb (bug 1703812)
Backed out changeset 86e7d4784a20 (bug 1703812)
Backed out changeset 6b2e055d9314 (bug 1703812)
Backed out changeset b08695e5728a (bug 1703812)
Backed out changeset 3b8a0081fd10 (bug 1703812)
Backed out changeset 3a163596f982 (bug 1703812)
Backed out changeset 5be1d4b282ab (bug 1703812)
Backed out changeset 1ce012d7509e (bug 1703812)
Backed out changeset ee2fab5881c7 (bug 1703812)
Backed out changeset 62941a522893 (bug 1703812)
Backed out changeset d4f11dc33eed (bug 1703812)
Backed out changeset 781bb4c3cc02 (bug 1703812)
Backed out changeset f070e0de0566 (bug 1703812)
Backed out changeset 9f65c67ba2a6 (bug 1703812)
Backed out changeset 1e76eecb85e2 (bug 1703812)
Backed out changeset 953432408a83 (bug 1703812)
Backed out changeset fd1dc92d3911 (bug 1703812)
Backed out changeset 34d56948c6b6 (bug 1703812)
Backed out changeset 2ba7ca61ecc3 (bug 1703812)
Backed out changeset 545253c469e6 (bug 1703812)
Backed out changeset fb4a61ab1300 (bug 1703812)
Backed out changeset bf07b3cfd3d5 (bug 1703812)
Backed out changeset eaff51e7754b (bug 1703812)
Backed out changeset f5c485c41d13 (bug 1703812)
2023-05-19 14:49:57 +03:00
Paul Adenot 281091bd3d Bug 1821362 - Replace EuclidGCD by a binary gcd algorithm using intrinsics. r=media-playback-reviewers,alwu
Perf notes:
https://lemire.me/blog/2013/12/26/fastest-way-to-compute-the-greatest-common-divisor/

Differential Revision: https://phabricator.services.mozilla.com/D173315
2023-05-17 15:47:05 +00:00
Paul Adenot 63452a9038 Bug 1821362 - Add a generic CountTrailingZeroes function that lowers to the right intrinsic based the type its called with. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173314
2023-05-17 15:47:05 +00:00