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

2535 Коммитов

Автор SHA1 Сообщение Дата
Kelsey Gilbert a1c5ea24c5 Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D163664
2023-02-06 19:58:53 +00:00
Paul Adenot fa1c952e5c Bug 1814526 - Don't check if an unsigned value is less than 0 in Casting.h. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D168786
2023-02-06 09:23:23 +00:00
Paul Adenot e6efd6d076 Bug 646323 - Rewrite mfbt/Casting.h assertion in modern style, and teach it to deal with floating point values. r=kinetik
This now uses `if constexpr (...)` which is a lot more readable, and still
compiles to almost no assembly instructions, as expected.

Floating point casting assert when casting an integer that's too large to be
represented exactly as a floating point (e.g. UINT64_MAX to double, since double
have less than 64 bytes of mantissa), or when casting a double that's too large
to be represented in a float.

Differential Revision: https://phabricator.services.mozilla.com/D167955
2023-02-01 14:38:44 +00:00
Stanca Serban 0758dd9825 Backed out changeset 39cfeb7cffda (bug 646323) for causing bustages in Casting.h. CLOSED TREE 2023-02-01 16:22:27 +02:00
Paul Adenot 65406dde19 Bug 646323 - Rewrite mfbt/Casting.h assertion in modern style, and teach it to deal with floating point values. r=kinetik
This now uses `if constexpr (...)` which is a lot more readable, and still
compiles to almost no assembly instructions, as expected.

Floating point casting assert when casting an integer that's too large to be
represented exactly as a floating point (e.g. UINT64_MAX to double, since double
have less than 64 bytes of mantissa), or when casting a double that's too large
to be represented in a float.

Differential Revision: https://phabricator.services.mozilla.com/D167955
2023-02-01 14:05:14 +00:00
Olli Pettay b10f170599 Bug 1812753 - Move xpcom/ds/MruCache.h to mfbt/, r=glandium
The gtest lives still in xpcom/tests/gtest/TestMruCache.cpp since it relies on nsString.

Differential Revision: https://phabricator.services.mozilla.com/D168007
2023-01-31 17:59:25 +00:00
Csoregi Natalia f822f99642 Backed out 6 changesets (bug 1799258) for failures on gfx.color_management.display_profile. CLOSED TREE
Backed out changeset 22351f36b74b (bug 1799258)
Backed out changeset 9bbbe3ed2794 (bug 1799258)
Backed out changeset e05c809f58d0 (bug 1799258)
Backed out changeset 791eeb52f034 (bug 1799258)
Backed out changeset 353ef4721bba (bug 1799258)
Backed out changeset b5157d950aa7 (bug 1799258)
2023-01-24 02:08:51 +02:00
Kelsey Gilbert c0f7411fb5 Bug 1799258 - span_iterator::difference_type s/index_type/ptrdiff/. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167473
2023-01-23 22:13:18 +00:00
Kelsey Gilbert 70f8fd53cc Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D163664
2023-01-23 22:13:16 +00:00
Chris Peterson 975ea3bc1e Bug 1806779 - Fix C++20 -Wdeprecated-volatile warnings in mfbt/SHA1.cpp. r=glandium
C++20 deprecated decrement/increment of object of volatile-qualified types, e.g. v++.

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r3.html

mfbt/SHA1.cpp:400:9 [-Wdeprecated-volatile] compound assignment to object of volatile-qualified type 'volatile unsigned int' is deprecated
mfbt/SHA1.cpp:401:9 [-Wdeprecated-volatile] compound assignment to object of volatile-qualified type 'volatile unsigned int' is deprecated
mfbt/SHA1.cpp:402:9 [-Wdeprecated-volatile] compound assignment to object of volatile-qualified type 'volatile unsigned int' is deprecated
mfbt/SHA1.cpp:403:9 [-Wdeprecated-volatile] compound assignment to object of volatile-qualified type 'volatile unsigned int' is deprecated
mfbt/SHA1.cpp:404:9 [-Wdeprecated-volatile] compound assignment to object of volatile-qualified type 'volatile unsigned int' is deprecated

shaCompress() has a comment emphasizing the importance of the X array being volatile. I verified that changing `XH(0) += A` to `XH(0) = XH(0) + A` generates the same -S assembly code (for clang -O2 on Apple Silicon).

Whether this comment about the volatile code generated by gcc 3.4.3 -O3 in 2012 is still relevant for clang 15 -O2 in 2023 is a different question.

Differential Revision: https://phabricator.services.mozilla.com/D165268
2022-12-22 02:58:24 +00:00
Marian-Vasile Laza 74bda87ddf Backed out 3 changesets (bug 1799258) for causing GTest-1proc failures on Span. CLOSED TREE
Backed out changeset 0facab7b9a1d (bug 1799258)
Backed out changeset 4f9ee3537468 (bug 1799258)
Backed out changeset 12e98a3054d0 (bug 1799258)
2022-12-21 01:41:43 +02:00
Kelsey Gilbert 2bda23086f Bug 1799258 - Add prereq Colorspaces stuff, including generic gamma->linear LUT inversion approximation. r=gfx-reviewers,bradwerth
No-op all-equal tfs rather than inverting.

Differential Revision: https://phabricator.services.mozilla.com/D163664
2022-12-20 22:47:52 +00:00
Ryan VanderMeulen 0d7440e1da Bug 1806483 - Enable TSAN cppunittests by default. r=jmaher
Depends on D164960

Differential Revision: https://phabricator.services.mozilla.com/D165059
2022-12-20 14:25:35 +00:00
Nika Layzell 97bb85687e Bug 840706 - Part 1: Add MFBT_API annotations to other methods in StringToDoubleConverter, r=glandium
The annotations added in bug 1770158 only covered `StringToDouble`,
however as noted in the comments in that file, that isn't sufficient for
accurately parsing floating point numbers. This patch extends the
annotations to the single-precision floating point numbers as well and
will be used in the next part to clean up the implementation of
`nsTString::ToDouble`.

Differential Revision: https://phabricator.services.mozilla.com/D148304
2022-12-06 20:27:49 +00:00
Emilio Cobos Álvarez 41d2485a4e Bug 1802320 - Green up and re-enable style system layout tests. r=boris
It's unclear to me when they were disabled, but we do want to enable
these as otherwise there's no way to catch bindgen issues that can end
up in subtle bugs at best, or memory corruption at worst.

Differential Revision: https://phabricator.services.mozilla.com/D162997
2022-11-25 10:52:26 +00:00
Chris Peterson 9e50a89085 Bug 1800293 - mfbt: Don't use std::is_literal_type when compiling as C++20. r=glandium
`std::is_literal_type` was deprecated in C++17 and removed in C++20. Continue using it when compiling as C++17 to retain what benefits it does provide for generic code.

> The `is_literal` type trait offers negligible value to generic code, as what is really needed is the ability to know that a specific construction would produce constant initialization. The core term of a literal type having at least one constexpr constructor is too weak to be used meaningfully.

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0174r2.html

https://en.cppreference.com/w/cpp/types/is_literal_type

Differential Revision: https://phabricator.services.mozilla.com/D161952
2022-11-16 00:54:27 +00:00
Nika Layzell f8e46f7fb5 Bug 1797354 - Allow specifying capability type in thread-safety macros, r=jesup,media-playback-reviewers,alwu
It is possible to specify full names for capabilities when using the clang
thread-safety analysis which will be used in error messages. We should use that
form of the attribute rather than the legacy lockable attribute.

Differential Revision: https://phabricator.services.mozilla.com/D160531
2022-10-28 19:55:30 +00:00
James Teh 307f9e48aa Bug 1774285 - On Windows 11 22H2, flush the Windows clipboard immediately after setting it. r=neildeakin
This works around a windows 11 suggested actions bug, see comment.

Differential Revision: https://phabricator.services.mozilla.com/D160646
2022-10-28 14:17:54 +00:00
Julian Seward 518297a7d8 Bug 1795644 - A bit of tuning of inlining in the JS parser. r=arai.
Some profiling of tcampbell's React benchmark [1] shows 6.1 million calls to
js::frontend::GeneralTokenStreamChars<..>::getFullAsciiCodePoint, using 110.57
million instructions (x86_64).  That comes out to only 18 insns per call,
which suggests the method is a good candidate for inlining, but it isn't
inlined.

Merely parking an inline annotation on it doesn't help much, because it gets
inlined into js::frontend::TokenStreamSpecific<..>::getCodePoint, but that
isn't inlined into *its* caller(s), so the 6.1 million calls move to
::getCodePoint instead.

This patch requests inlining for both ::getFullAsciiCodePoint and
::getCodePoint and adds some MOZ_NEVER_INLINE annotations to ensure that cold
paths *don't* get inlined into these two, to reduce code bloat and avoid
excessive register pressure.

IsAscii functions in mfbt/TextUtils.h have been marked inline as a precaution;
this probably isn't necessary.

Run time with config [2] is reduced from 0.390 seconds to 0.379 seconds
(2.8% speedup, best of 50 runs), and from 0.402 to 0.396 seconds
(median of 50 runs).

Instruction count falls from 3511.8 million to 3395.8 million, and the number
of data accesses from 1563.7 million to 1487.4 million -- a 4.8% reduction
that is probably caused by avoidance of save/restore sequences in the inlined
fns.

[1] https://github.com/mozilla-spidermonkey/matrix-react-bench

[2] Fedora 35, x86_64, Intel Core i5 1135G7 at 4 ish GHz
    configure: --disable-debug --enable-optimize="-g -O2"
    run:       --no-threads

Differential Revision: https://phabricator.services.mozilla.com/D159500
2022-10-18 05:22:03 +00:00
Nika Layzell 7210a4bca7 Bug 1783242 - Part 3: Remove BufferList::Extract, r=glandium,ipc-reviewers,mccr8
The only uses of this method were removed in Part 1, meaning that it can
now be removed. Support for this method adds a significant amount of
complexity to `BufferList` and IPC serialization.

Differential Revision: https://phabricator.services.mozilla.com/D154439
2022-09-28 19:25:14 +00:00
Peter Van der Beken bd1c6c4d03 Bug 1788969 - Correct ForEach Tuple helper functions. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D156322
2022-09-22 18:28:15 +00:00
Sandor Molnar 141cdeeed6 Backed out 11 changesets (bug 1788969, bug 1782400, bug 1777145) for causing bp-hybri bustages. CLOSED TREE
Backed out changeset 8acabb924ef7 (bug 1782400)
Backed out changeset e3d452e99f77 (bug 1782400)
Backed out changeset 5727bc4895d2 (bug 1777145)
Backed out changeset cf375034e2b8 (bug 1777145)
Backed out changeset a50fd5608d8d (bug 1777145)
Backed out changeset f24853cacd7a (bug 1777145)
Backed out changeset c714f3a35b11 (bug 1777145)
Backed out changeset 56682c253427 (bug 1788969)
Backed out changeset edaf37ffc49d (bug 1788969)
Backed out changeset d19caa9f062b (bug 1788969)
Backed out changeset 18b26912dc03 (bug 1788969)
2022-09-22 19:13:01 +03:00
Peter Van der Beken 7650d454e8 Bug 1788969 - Correct ForEach Tuple helper functions. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D156322
2022-09-22 15:02:22 +00:00
Jan-Niklas Jaeschke 4265f72859 Bug 1777925: Replaced MutationObserver array container type with linked list. r=smaug
Deletion of mutation observers from a list resulted in O(n^2) behavior and could lead to massive freezes.
This is resolved by using a LinkedList instead, reducing complexity to O(n).

A safely iterable doubly linked list was implemented based on `mozilla::DoublyLinkedList`,
allowing to insert and remove elements while iterating the list.

Due to the nature of `mozilla::DoublyLinkedList`, every Mutation Observer now inherits `mozilla::DoublyLinkedListElement<T>`.
This implies that a Mutation Observer can only be part of one DoublyLinkedList.
This conflicts with some Mutation Observers, which are being added to multiple `nsINode`s.
To continue supporting this, new MutationObserver base classes `nsMultiMutationObserver` and `nsStubMultiMutationObserver` are introduced,
which create `MutationObserverWrapper` objects each time they are added to a `nsINode`.
The wrapper objects forward every call to the actual observer.

Differential Revision: https://phabricator.services.mozilla.com/D157031
2022-09-21 11:31:44 +00:00
Ryan VanderMeulen 9dc15db244 Bug 1784990 - Update lz4 to 1.9.4. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D154770
2022-08-31 16:10:45 +00:00
Nicolas B. Pierron 4d9b0fe251 Bug 1779940 part 2 - Add HashMap::put which relies on lookup. r=arai
The next patch is creating a cache which is capable of looking up different kind
of string types. However, each string type need some contextual information to
be able to compare them against each others, which adds complexity to the lookup
type. In addition, the keys are of only one string type, and therefore we try to
avoid storing this context as part of each key, but instead provide it with the
contextual information coming with the Lookup type.

Therefore, when we want to insert a key, which might already be present, using
`put`. We have to provide a `aLookup` argument which knows how to compare keys.

This also make the interface similar to `putNew` which already has the
distinctions between the `Lookup` argument and the `KeyInput` argument.

Differential Revision: https://phabricator.services.mozilla.com/D154512
2022-08-25 15:03:29 +00:00
Nick Alexander ba86996b7a Bug 1783051 - Turn default browser agent's `EventLog` into a Windows-only header utility. r=rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D153658
2022-08-17 20:01:58 +00:00
Gerald Squelart 42904cee2c Bug 1784812 - Make all JSONWriteFunc-derived classes and their overriden methods final - r=canaltinova
All JSONWriteFuncs are effectively final, this patch enforces that, hopefully
helping the compiler to de-virtualize some calls.

Differential Revision: https://phabricator.services.mozilla.com/D154619
2022-08-17 07:07:54 +00:00
Gerald Squelart eb90b3b175 Bug 1784812 - JSONWriter may optionally not own its writer - r=canaltinova
mWriter is now a reference, and the ownership is optional through a separate
member variable that could stay null.
User can now choose to keep the JSONWriteFunc on their stack, which saves a
heap allocation, and makes it easier to access the concrete JSONWriteFunc
implementation directly (instead of through WriteFunc()).

Differential Revision: https://phabricator.services.mozilla.com/D154617
2022-08-17 07:07:53 +00:00
Gerald Squelart 24798f281f Bug 1784812 - JSONWriter::WriteFunc() returns a reference - r=canaltinova
mWriter is never null (and lots of calls just dereference it without checking),
so we may as well enforce it:
- The constructor MOZ_RELEASE_ASSERTs that it's not null.
- The accessor WriteFunc() returns a reference instead of a scary raw pointer.

(Note that we can't make mWriter a NotNull<...>, because the next patch will
give the option to keep that owning pointer null.)

Differential Revision: https://phabricator.services.mozilla.com/D154616
2022-08-17 07:07:53 +00:00
André Bargull e9319e5454 Bug 1768632: Make EnumSet compile for MSVC. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D154338
2022-08-17 06:39:12 +00:00
Iulian Moraru 859487ba6b Backed out 4 changesets (bug 1784812) for causing build bustages on DDMediaLogs. CLOSED TREE
Backed out changeset c9998c927079 (bug 1784812)
Backed out changeset d2568bc2f8a6 (bug 1784812)
Backed out changeset 9f01bf89c583 (bug 1784812)
Backed out changeset d8506496d8f2 (bug 1784812)
2022-08-17 05:48:36 +03:00
Gerald Squelart d7c05cb55e Bug 1784812 - Make all JSONWriteFunc-derived classes and their overriden methods final - r=canaltinova
All JSONWriteFuncs are effectively final, this patch enforces that, hopefully
helping the compiler to de-virtualize some calls.

Depends on D154618

Differential Revision: https://phabricator.services.mozilla.com/D154619
2022-08-16 22:57:50 +00:00
Gerald Squelart 722fbce3cc Bug 1784812 - JSONWriter may optionally not own its writer - r=canaltinova
mWriter is now a reference, and the ownership is optional through a separate
member variable that could stay null.
User can now choose to keep the JSONWriteFunc on their stack, which saves a
heap allocation, and makes it easier to access the concrete JSONWriteFunc
implementation directly (instead of through WriteFunc()).

Depends on D154616

Differential Revision: https://phabricator.services.mozilla.com/D154617
2022-08-16 22:57:49 +00:00
Gerald Squelart 68a8dee9cc Bug 1784812 - JSONWriter::WriteFunc() returns a reference - r=canaltinova
mWriter is never null (and lots of calls just dereference it without checking),
so we may as well enforce it:
- The constructor MOZ_RELEASE_ASSERTs that it's not null.
- The accessor WriteFunc() returns a reference instead of a scary raw pointer.

(Note that we can't make mWriter a NotNull<...>, because the next patch will
give the option to keep that owning pointer null.)

Differential Revision: https://phabricator.services.mozilla.com/D154616
2022-08-16 22:57:48 +00:00
Ryan VanderMeulen 0a7a824985 Bug 1749348 - Update double-conversion to version 3.2.1. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D153810
2022-08-09 13:47:44 +00:00
Steve Fink bd14b2f73a Bug 1782562 - be more conservative in max Vector size r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D153682
2022-08-08 22:59:15 +00:00
Cristian Tuns d5fa74099d Backed out changeset 939dbca534a5 (bug 1782562) for causing SM bustages CLOSED TREE 2022-08-08 18:55:29 -04:00
Steve Fink f444f5dc7c Bug 1782562 - be more conservative in max Vector size r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D153682
2022-08-08 21:41:06 +00:00
Cristian Tuns 9b82462b70 Backed out changeset 7519215902c9 (bug 1782562) for causing spidermonkey bustages on bug1782468-ptrdiff-veclen.js CLOSED TREE 2022-08-08 13:05:40 -04:00
Steve Fink 002a3bad41 Bug 1782562 - be more conservative in max Vector size r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D153682
2022-08-08 16:38:52 +00:00
Emily McDonough 4bf16448f0 Bug 1782604 - Make UniquePtr(nullptr) constexpr r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D153405
2022-08-03 21:21:09 +00:00
Fabrice Desré c50cb528fc Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 16:39:41 +00:00
Andreea Pavel 3ccd75af8d Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD 2022-08-03 18:55:00 +03:00
Andreea Pavel fdb7cb2ecd Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 15:27:43 +00:00
Andreea Pavel 89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré 0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +00:00
Doug Thayer a104274600 Bug 1782141 - Move SIMD/SSE files to mozglue r=iain
Differential Revision: https://phabricator.services.mozilla.com/D153264
2022-08-01 16:40:57 +00:00
Cristian Tuns c555cec677 Backed out 2 changesets (bug 1782141) for causing spidermonkey bustages on dependent.js CLOSED TREE
Backed out changeset 81b72f893608 (bug 1782141)
Backed out changeset bd07c6d3d9fe (bug 1782141)
2022-07-29 23:52:46 -04:00
Doug Thayer 2f04b79528 Bug 1782141 - Move SIMD/SSE files to mozglue r=iain
Differential Revision: https://phabricator.services.mozilla.com/D153264
2022-07-30 03:26:44 +00:00
Nika Layzell 997047e2a4 Bug 1772006 - Part 4: Simplify and move the string comparison APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,dragana,barret
This patch moves EqualsIgnoreCase to ns[T]StringObsolete, and removes
the aCount argument, instead migrating callers to use `StringBeginsWith`
with a case-insensitive comparator.

In addition, nsTStringRepr::Compare was removed and replaced with either
calls to methods like `StringBeginsWith` or the global `Compare` method.

These changes required some modifications at call-sites but should make
the behaviour less surprising and more consistent.

Differential Revision: https://phabricator.services.mozilla.com/D148299
2022-07-30 00:12:48 +00:00
Doug Thayer 7768043bd0 Bug 1779807 - Split AVX2 code into its own compilation unit r=iain
I split this out into its own commit because it's a bit awkward to go back and
shuffle the old code around. If you'd like me to apply it to the history
though, just let me know.

This patch just moves all of the AVX2 code out from SIMD.cpp into SIMD_avx2.cpp
and removes the -mavx2 flag when compiling SIMD.cpp. On try this removes the
failure on M1 hardware when running the x64 binary.

Differential Revision: https://phabricator.services.mozilla.com/D152920
2022-07-29 03:26:07 +00:00
Doug Thayer c2cde6897f Bug 1779807 - Implement memchr64 in AVX2 r=iain
This only makes sense for AVX2, because widening it from a 64-bit comparison
to a 128-bit comparison is hardly worth it, and there are gaps in the SSE2
instruction set (missing _mm_cmpeq_epi64, which is introduced in SSE4.1) that
would require us to compensate and probably take a sizeable perf hit.

Differential Revision: https://phabricator.services.mozilla.com/D152297
2022-07-29 03:26:06 +00:00
Doug Thayer 1f10d44d74 Bug 1779807 - Support AVX2 for SIMD memchr r=iain
This showed a modest improvement in the geomean of my benchmarking, but
importantly it showed a consistent and relatively strong improvement across
all of the cases which I would guess are more realistic. Notably this change
makes it perform better at iteratively searching for the next occurrence of X
in the HTML of a large web page.

Differential Revision: https://phabricator.services.mozilla.com/D152296
2022-07-29 03:26:06 +00:00
Gerald Squelart d4726a9eca Bug 1774329 - If SingleLineStyle is set at construction, also remove spaces after colons and commas - r=florian
These were the last remaining JSON whitespace characters, so we can now our
regression tests can check that there are non of these left.

Differential Revision: https://phabricator.services.mozilla.com/D152607
2022-07-28 12:41:56 +00:00
Gerald Squelart a05b4ea2c2 Bug 1774329 - JSONWriter() can be single-line from the top, removing the final newline - r=florian
Differential Revision: https://phabricator.services.mozilla.com/D152602
2022-07-28 12:41:54 +00:00
Steve Fink 07e0016fe5 Bug 1774733 - Allow AllocPolicy to determine Vector growth policy, and be aggressive about StringBuilder allocation strategy to reduce memcpy'ing. r=jandem
Condition computeGrowth behavior on existence of AP::computeGrowth<S> method

Differential Revision: https://phabricator.services.mozilla.com/D151674
2022-07-27 22:59:51 +00:00
smolnar af5711925c Backed out 3 changesets (bug 1779807) for causing SM build failures. CLOSED TREE
Backed out changeset 68e92976dc0f (bug 1779807)
Backed out changeset f11ef6602f59 (bug 1779807)
Backed out changeset faa38e8360b1 (bug 1779807)
2022-07-26 00:44:58 +03:00
Doug Thayer 92a5c81749 Bug 1779807 - Implement memchr64 in AVX2 r=iain
This only makes sense for AVX2, because widening it from a 64-bit comparison
to a 128-bit comparison is hardly worth it, and there are gaps in the SSE2
instruction set (missing _mm_cmpeq_epi64, which is introduced in SSE4.1) that
would require us to compensate and probably take a sizeable perf hit.

Differential Revision: https://phabricator.services.mozilla.com/D152297
2022-07-25 21:21:37 +00:00
Doug Thayer 2a9b76d986 Bug 1779807 - Support AVX2 for SIMD memchr r=iain
This showed a modest improvement in the geomean of my benchmarking, but
importantly it showed a consistent and relatively strong improvement across
all of the cases which I would guess are more realistic. Notably this change
makes it perform better at iteratively searching for the next occurrence of X
in the HTML of a large web page.

Differential Revision: https://phabricator.services.mozilla.com/D152296
2022-07-25 21:21:37 +00:00
jake a61c54713b Bug 1780215 - Use arc4random_buf within GenerateRandomBytesFromOS when compiling to wasi r=jandem
wasi-libc provides arc4random methods - 7a21011e98/libc-top-half/musl/include/stdlib.h (L205-L213)

Without this change, js::GenerateRandomSeed will fallback to using a timestamp for the random seed (https://searchfox.org/mozilla-central/rev/3e1a721bce1da3ae04675539b39a4e95b25a046d/js/src/jsmath.cpp#491-494) which is used as both seed values within the PRNG(https://searchfox.org/mozilla-central/rev/3e1a721bce1da3ae04675539b39a4e95b25a046d/js/src/jsmath.cpp#501-502) - having the same value for both seeds seems to cause the first two PRNG calls to produce the same first 4 decimal places.

This change stops the timestamp fallback from being used when compiling to wasm/wasi which avoids this issue.

Differential Revision: https://phabricator.services.mozilla.com/D152180
2022-07-20 13:17:54 +00:00
Doug Thayer 67331b011d Bug 1776013 - Add SIMD memchr-like implementations to MFBT r=iain
Differential Revision: https://phabricator.services.mozilla.com/D150067
2022-07-14 18:30:27 +00:00
Norisz Fay 9112cf321e Backed out 2 changesets (bug 1776013) for causing spidermonkey bustages on SIMD.cpp CLOSED TREE
Backed out changeset bb467568da37 (bug 1776013)
Backed out changeset 9669cd465518 (bug 1776013)
2022-07-14 03:53:22 +03:00
Doug Thayer 2778034398 Bug 1776013 - Add SIMD memchr-like implementations to MFBT r=iain
Differential Revision: https://phabricator.services.mozilla.com/D150067
2022-07-14 00:39:22 +00:00
serge-sans-paille a909699ad6 Bug 1774863 - Cleanup mfbt includes r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D149669
2022-06-22 09:47:14 +00:00
Sylvestre Ledru 42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Nika Layzell 0e6bc87c63 Bug 1743020 - Part 3: Export mozilla::MoveOnlyFunction based on function2, r=glandium
A custom defintion wrapping fu2::function_base is used to customize the
inline buffer's size and alignment to make it compatible with nsTArray.
Without the custom wrapper, `alignof(max_align_t)` is used, which is
larger than nsTArray's max alignment on some platforms.

Differential Revision: https://phabricator.services.mozilla.com/D145691
2022-06-02 13:24:10 +00:00
Jan de Mooij 69dd9e0ace Bug 1770158 part 1 - Add MFBT_API to StringToDouble. r=glandium
The update script successfully applies this diff to the upstream code.

Differential Revision: https://phabricator.services.mozilla.com/D146878
2022-05-31 07:48:15 +00:00
Steve Fink 952b6a3854 Bug 1769518 - Support Rooted<Result<V,E>> as long as V and E have GCPolicy<> defined for them. (Use IgnoreGCPolicy for whichever of them does not need tracing.) r=emilio,nbp,jonco
Differential Revision: https://phabricator.services.mozilla.com/D146468
2022-05-26 17:22:35 +00:00
Chris Peterson af64df99e7 Bug 1769778 - Replace deprecated std::result_of_t with std::invoke_result_t. r=janv
std::result_of_t was deprecated in C++17 and removed in C++20.

https://en.cppreference.com/w/cpp/types/result_of

The pattern to replace std::result_of_t with std::invoke_result_t is:

-std::result_of_t<Func(ArgTypes)>
+std::invoke_result_t<Func, ArgTypes>

Differential Revision: https://phabricator.services.mozilla.com/D146593
2022-05-25 06:07:32 +00:00
Chris Peterson cc0d5b9c63 Bug 1769484 - Replace std::memory_order::memory_order_XYZ with std::memory_order_XYZ. r=padenot
C++20 renamed the `std::memory_order` enum's enumerators from `std::memory_order::memory_order_XYZ` to `std::memory_order::XYZ`. To maintain source compatibility with both C++17 and C++20, use `std::memory_order_XYZ`.

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0439r0.html

https://en.cppreference.com/w/cpp/atomic/memory_order

Differential Revision: https://phabricator.services.mozilla.com/D146395
2022-05-17 03:24:09 +00:00
Nika Layzell ae118208e9 Bug 1767517 - Part 1: Fix incorrect annotation for GUARDED_VAR and PT_GUARDED_VAR, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D145393
2022-05-16 20:40:49 +00:00
Molnar Sandor 74e42d0f2f Backed out 5 changesets (bug 1743020) for causing linux build bustages in function2.hpp CLOSED TREE
Backed out changeset cf237471cf75 (bug 1743020)
Backed out changeset 78eb51447ce5 (bug 1743020)
Backed out changeset c486f95d55ec (bug 1743020)
Backed out changeset c0abfda55404 (bug 1743020)
Backed out changeset 16be18ca73fb (bug 1743020)
2022-05-14 10:31:12 +03:00
Nika Layzell 85884b7fca Bug 1743020 - Part 3: Export mozilla::MoveOnlyFunction based on function2, r=glandium
A custom defintion wrapping fu2::function_base is used to customize the
inline buffer's size and alignment to make it compatible with nsTArray.
Without the custom wrapper, `alignof(max_align_t)` is used, which is
larger than nsTArray's max alignment on some platforms.

Differential Revision: https://phabricator.services.mozilla.com/D145691
2022-05-13 23:43:52 +00:00
Paul Adenot 4815882f91 Bug 1768616 - TSAN suppression list update for Ubuntu 22.04 LTS. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D145953
2022-05-10 11:54:55 +00:00
Jesse Schwartzentruber 57e1160210 Bug 1765543 - Add snapshot fuzzing build using Nyx r=decoder,taskgraph-reviewers,ahal
Depends on D144208

Differential Revision: https://phabricator.services.mozilla.com/D144209
2022-05-04 19:24:58 +00:00
Mike Hommey d067ffd623 Bug 1766561 - Enable MOZ_FORMAT_PRINTF on all clang builds. r=nika
clang-cl doesn't define __GNUC__. Also for some reason, clang-cl doesn't
like the use of MOZ_FORMAT_PRINTF on a function definition (while clang
is apparently happy with it).

Differential Revision: https://phabricator.services.mozilla.com/D144922
2022-05-03 20:49:10 +00:00
Nika Layzell 18f7866fc2 Bug 1738106 - Part 2: Allow XPCOM classes to use SupportsThreadSafeWeakPtr, r=glandium,xpcom-reviewers
Due to how this type of threadsafe refcounting is implemented, it needs to be
implemented using a MFBT-style refcounting base class, somewhat similar to
`SupportsWeakPtr`.

This patch makes NS_IMPL_{ADDREF,RELEASE}_INHERITED intelligently not add
refcount logging for types inheriting from SupportsThreadSafeWeakPtr, as the
default behaviour would break due to weak pointer upgrades not calling through
`AddRef` or `Release`.

In MFBT, the return value of `AddRef` and `Release` on
SupportsThreadSafeWeakPtr is changed to be compatible with nsISupports, so that
this type can be used to implement nsISupports refcounting.

Differential Revision: https://phabricator.services.mozilla.com/D142603
2022-05-02 20:37:34 +00:00
Mike Hommey c5fea3fa51 Bug 1766549 - Remove some char16ptr_t operators that allow implicit const-casting. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D144777
2022-04-27 22:28:24 +00:00
Lee Salzman ca716f7083 Bug 1765911 - Support cloning Patterns with internal weak references. r=aosmond
Currently calling Pattern::Clone() produces a heap-allocated Pattern with RefPtrs
to any internal resources such as SourceSurfaces or GradientStops. While this is
okay if the Pattern is transient, this causes problems if the clone is long-lived
and causes via the RefPtr the stored resource to stay alive, even when there are
no other external references to the resource.

In the case of DrawTargetWebgl's PathCache, we need to be able to create Pattern
clones that have internal weak references, while also still supporting the original
use-case of strong references. To this end we template-ize some of the Pattern
derivatives so that we can make either strong or weak versions according to use-case.
This case way we store a weak clone of a Pattern in the PathCache key, the reference
will automatically invalidate itself when all other external strong references to it
go away, without having to do external crawling of the PathCache to constantly prune
the last reference manually.

Differential Revision: https://phabricator.services.mozilla.com/D144381
2022-04-27 18:48:59 +00:00
Jon Coppeard 1aeb55dd59 Bug 1766276 - Give MaybeOneOf a map method r=jandem
There are a few places where we call one of two overloads of a fuction based on
the contents of a MaybeOneOf. We can simplify this code by giving the class a
map method.

Differential Revision: https://phabricator.services.mozilla.com/D144595
2022-04-26 12:29:24 +00:00
Steve Fink 4531b772d7 Bug 1440727 - Disallow extra data at the end of serialized data buffer r=decoder,jonco
Differential Revision: https://phabricator.services.mozilla.com/D141391
2022-04-22 03:08:47 +00:00
Chun-Min Chang 61d788c585 Bug 1238038 - Create an input-only audio source r=padenot
This patch creates an class managing an input-only audio stream within a
task thread. This class will be used as a source generating the audio
data to a NonNativeInputTrack in the following patch.

Depends on D116535

Differential Revision: https://phabricator.services.mozilla.com/D137911
2022-04-18 18:45:35 +00:00
Steve Fink e4b6669027 Bug 1762537 - Omit some annotations when compiling under sixgill to avoid incompatibilities between what clang and gcc allow for lambda annotations r=firefox-static-analysis-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D142714
2022-04-15 15:43:10 +00:00
Christian Holler 8e5b003502 Bug 1764259 - [Fuzzing] Nyx replay mode. r=truber
Differential Revision: https://phabricator.services.mozilla.com/D143458
2022-04-14 12:10:14 +00:00
Christian Holler cde0054620 Bug 1764258 - [Fuzzing] Nyx API enhancements. r=truber
Differential Revision: https://phabricator.services.mozilla.com/D143457
2022-04-14 12:10:13 +00:00
Mike Hommey c8251f91f4 Bug 1758780 - Fallthrough to <atomic> for wasi when using clang >= 14. r=nika
Clang 14 added a dummy backoff policy for atomic polling that doesn't
know about threads, which presumably WASI can use.
See https://reviews.llvm.org/D114109.

Differential Revision: https://phabricator.services.mozilla.com/D143173
2022-04-13 03:02:24 +00:00
Emilio Cobos Álvarez a9a85f3eca Bug 1763741 - Make gfx types take the right amount of space in MSVC. r=jrmuizel,glandium
This is an attribute that could be useful elsewhere so seems worth
putting in mfbt.

Differential Revision: https://phabricator.services.mozilla.com/D143249
2022-04-08 13:27:28 +00:00
Nika Layzell 7743d4fd62 Bug 1761536 - Part 2: Replace nsTArray::elem_type with value_type, r=mccr8
There weren't that many uses of the existing typedef, so it seemed like
it might be worthwhile to just replace all uses of the previous typedef
with the stl-like one.

Differential Revision: https://phabricator.services.mozilla.com/D142705
2022-04-01 17:00:25 +00:00
Randell Jesup da67253143 Bug 1207753 - minor cleanup of a comment r=nika
Differential Revision: https://phabricator.services.mozilla.com/D142084
2022-03-25 19:44:26 +00:00
Nika Layzell c5e36e29ae Bug 1760357 - Part 6: Don't generate thread safety annotations on clang < 8.0, r=jesup
Depends on D141536

Differential Revision: https://phabricator.services.mozilla.com/D141701
2022-03-22 14:59:42 +00:00
Emilio Cobos Álvarez b055f536ea Bug 1758702 - Allow ThreadSafeWeakPtr<IncompleteType> to work. r=glandium
This will be used to avoid problematic includes from WorkerPrivate.h,
and it matches the behavior of RefPtr<> and WeakPtr<>.

Differential Revision: https://phabricator.services.mozilla.com/D140658
2022-03-17 15:24:40 +00:00
criss 9302fa739c Backed out 2 changesets (bug 1758702) for causing build bustages. CLOSED TREE
Backed out changeset 3e00d9203851 (bug 1758702)
Backed out changeset 66625baf0875 (bug 1758702)
2022-03-17 15:21:31 +02:00
Emilio Cobos Álvarez 370bce32dc Bug 1758702 - Allow ThreadSafeWeakPtr<IncompleteType> to work. r=glandium
This will be used to avoid problematic includes from WorkerPrivate.h,
and it matches the behavior of RefPtr<> and WeakPtr<>.

Differential Revision: https://phabricator.services.mozilla.com/D140658
2022-03-17 12:15:20 +00:00
Randell Jesup addf814b52 Bug 1207753 - Base thread-safety attribution support r=nika
Differential Revision: https://phabricator.services.mozilla.com/D130606
2022-03-16 23:01:41 +00:00
Cristian Tuns 43db1804cf Backed out changeset 3b8c7fa73e82 (bug 1207753) for causing build bustages on Monitor.h CLOSED TREE 2022-03-16 16:45:54 -04:00
Randell Jesup e72ce3cd6c Bug 1207753 - Base thread-safety attribution support r=nika
With additions of MOZ_UNANNOTATED for *Mutex/*Monitor/RWLock classes

Differential Revision: https://phabricator.services.mozilla.com/D130606
2022-03-16 20:10:04 +00:00
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Zhao Jiazhong 62341514c5 Bug 1756570 - [loong64] Add basic build support for LoongArch64 port. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D139567
2022-02-25 03:42:34 +00:00
Toshihito Kikuchi 076c992786 Bug 1750791 - Part 1: Add LinkedList::mergeBack and LinkedList::splice. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D137244
2022-02-24 15:00:27 +00:00
Kelsey Gilbert aeeb1e199d Bug 1750310 - Centralize and reuse pixelstorei pack/unpack handling. r=lsalzman
* Accept that finding an explicit unpack for a given stride might fail.
* Directly use the logic from the GLES spec for unpacking stride calculations.
* Use structuredSrcSize member.
* Calc explicit unpack based on dstStride, not srcStride.

Differential Revision: https://phabricator.services.mozilla.com/D136052
2022-02-12 02:20:42 +00:00
Nika Layzell fa19de50d5 Bug 1754305 - Make assertions in Maybe MOZ_RELEASE_ASSERT, r=glandium
These assertions are already diagnostic asserts, and this will make
failures to check Maybe into safe crashes rather than security bugs on
all branches.

A failure to check Maybe is more dangerous than a null pointer
dereference, as the generated code will produce a valid reference to
uninitialized data rather than a null reference which should safely
segfault.

Differential Revision: https://phabricator.services.mozilla.com/D138208
2022-02-11 16:28:01 +00:00
Paul Adenot f0f4d715ec Bug 1752345 - Allow calling AvailableWrite or AvailableRead on any thread. r=alwu
This is safe in fact safe. The data might be a bit late, but it's going to be
correct.

Differential Revision: https://phabricator.services.mozilla.com/D137302
2022-02-03 15:18:13 +00:00
Kagami Sascha Rosylight 901a35ec10 Bug 1748874 - Part 5: Require CAN_RUN_SCRIPT to be at the first declaration r=andi
Depends on D135404

Differential Revision: https://phabricator.services.mozilla.com/D135405
2022-01-11 11:52:27 +00:00
Mike Hommey b89cb6ae18 Bug 1748969 - Move definition of MOZ_DIAGNOSTIC_ASSERT_ENABLED to configure. r=emilio
Original patch by emilio.

Differential Revision: https://phabricator.services.mozilla.com/D135321
2022-01-07 21:24:44 +00:00
Mike Hommey fa1a339437 Bug 1748969 - Enable diagnostic asserts on early beta instead of dev edition. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D135320
2022-01-07 21:24:44 +00:00
Chris Peterson f0c33cdf01 Bug 1745118 - double-conversion: add MOZ_CRASH reasons to use-mozilla-assertions.patch. r=glandium
Adding MOZ_CRASH reasons will help disambiguate any of these crashes in crash ping telemetry (which doesn't have symbolicated crash signatures or stack traces like crash reports).

Differential Revision: https://phabricator.services.mozilla.com/D133582
2021-12-22 04:34:13 +00:00
Chris Peterson e1a50b756e Bug 1745118 - double-conversion: update double-conversion to version 3.1.6 (upstream revision 60e08d0). r=glandium
* Fix update.sh to use macOS-compatible mktemp -d flag.
* Rebase use-mozilla-assertions.patch to fix merge conflict.
* Rebase debug-only-functions.patch to fix merge conflict.
* Rebase to-fixed-dbl-max.patch to fix merge conflict.
* Remove to-fixed-digits-after-point.patch because upstream has this fix now.

https://github.com/google/double-conversion/releases/tag/v3.1.6

Cleanups and new architectures:

* Features some code cleanups.
* Adds the following new architectures: loongarch, xtensa, nios2, e2k.

Differential Revision: https://phabricator.services.mozilla.com/D133581
2021-12-22 04:34:12 +00:00
Mike Hommey b6a4e7c184 Bug 1746540 - Move --enable-logrefcnt to python configure. r=nika,firefox-build-system-reviewers,mhentges
And simplify the defines it sets.

Differential Revision: https://phabricator.services.mozilla.com/D134099
2021-12-18 00:32:35 +00:00
Sandor Molnar eac95b4a93 Backed out 6 changesets (bug 1746539, bug 1746541, bug 1746544, bug 1746540, bug 1746542, bug 1746299) for causing android build bustages in cutils/properties. CLOSED TREE
Backed out changeset 9352292fa327 (bug 1746544)
Backed out changeset 3cc761d90071 (bug 1746542)
Backed out changeset 8d8fc11e8012 (bug 1746541)
Backed out changeset 5f53612aad1b (bug 1746540)
Backed out changeset afb601202b24 (bug 1746539)
Backed out changeset 90027c44c9af (bug 1746299)
2021-12-18 01:28:06 +02:00
Mike Hommey 86100100a6 Bug 1746540 - Move --enable-logrefcnt to python configure. r=nika,firefox-build-system-reviewers,mhentges
And simplify the defines it sets.

Differential Revision: https://phabricator.services.mozilla.com/D134099
2021-12-17 22:52:09 +00:00
Randell Jesup c075d29d20 Bug 1625161: Move ASSERT_UNLESS_FUZZING() to mfbt and hook into FUZZING r=glandium,decoder
Differential Revision: https://phabricator.services.mozilla.com/D133166
2021-12-16 04:13:48 +00:00
Ryan VanderMeulen 658f7ee013 Bug 1743896 - Update xxHash to version 0.8.1. r=dthayer
Differential Revision: https://phabricator.services.mozilla.com/D132631
2021-12-02 01:53:56 +00:00
Chris Peterson f6fdbf028a Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.

There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.

Differential Revision: https://phabricator.services.mozilla.com/D132289
2021-12-01 06:40:04 +00:00
Jan Varga ead7da2d9c Bug 1732642 - Handle complex types in MOZ_TO_RESULT_INVOKE_MEMBER_TYPED; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D126785
2021-11-30 05:05:53 +00:00
Jan Varga a7f7389681 Bug 1731969 - Rename ToResultInvoke member function overloads to ToResultInvokeMember; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D126328
2021-11-30 05:05:53 +00:00
Jan Varga 0115137758 Bug 1731969 - Rename ToResultInvokeMemberFunction to ToResultInvokeMemberInternal; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D126327
2021-11-30 05:05:52 +00:00
Nika Layzell b2dc7057a5 Bug 1743012 - Add missing `constexpr` qualifiers in `CheckedInt`, r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D132173
2021-11-26 19:18:49 +00:00
Christian Holler 6110156f18 Bug 1738278 - Add fuzzing snapshot API. r=truber,firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D129823
2021-11-25 11:20:43 +00:00
Nika Layzell 972727feaa Bug 1734735 - Part 2: Support getter_Transfers with non-pointer UniquePtr types, r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D128211
2021-11-23 16:15:21 +00:00
Nika Layzell 47ec9bbc3e Bug 1734735 - Part 1: Add UniqueMach{Send,Recv}Right types, r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D128210
2021-11-23 16:15:20 +00:00
Jonathan Kew 1690055f4e Bug 1742115 - Fix UnsafeConvertValidUtf8toUtf16 to wrap the correct Rust implementation. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D131645
2021-11-19 18:57:44 +00:00
Jan Varga 17ccc040dd Bug 1731806 - Allow ToResultInvoke to return other nsresult like error types; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D126273
2021-11-12 11:56:02 +00:00
Andreas Farre 4cf077692f Bug 1733963 - Part 2: Add BitSet tests. r=glandium
Depends on D127447

Differential Revision: https://phabricator.services.mozilla.com/D127448
2021-11-09 12:34:51 +00:00
Andreas Farre f31ef6faa9 Bug 1733963 - Part 1: Make BitSet work as storage for EnumSet. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D127447
2021-11-09 12:34:51 +00:00
Marian-Vasile Laza 7241c1f9e9 Backed out 3 changesets (bug 1733963) for causing build bustages on TestEnumSet.cpp. CLOSED TREE
Backed out changeset 83b804a449c2 (bug 1733963)
Backed out changeset 434e10a0c39a (bug 1733963)
Backed out changeset d7d88b948f71 (bug 1733963)
2021-11-08 19:42:46 +02:00
Andreas Farre e7ee97fb29 Bug 1733963 - Part 2: Add BitSet tests. r=glandium
Depends on D127447

Differential Revision: https://phabricator.services.mozilla.com/D127448
2021-11-08 16:01:26 +00:00
Andreas Farre 5de97dac8c Bug 1733963 - Part 1: Make BitSet work as storage for EnumSet. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D127447
2021-11-08 16:01:25 +00:00
Marian-Vasile Laza fca6bc6241 Backed out 3 changesets (bug 1733963) for causing build bustages on SyncedContext.h. CLOSED TREE
Backed out changeset de5c7a16378c (bug 1733963)
Backed out changeset f5f3a27abf60 (bug 1733963)
Backed out changeset cc3a0603f88a (bug 1733963)
2021-11-05 20:54:33 +02:00
Andreas Farre 694649bec3 Bug 1733963 - Part 2: Add BitSet tests. r=glandium
Depends on D127447

Differential Revision: https://phabricator.services.mozilla.com/D127448
2021-11-05 17:23:02 +00:00
Andreas Farre 2dbbc3ad0e Bug 1733963 - Part 1: Make BitSet work as storage for EnumSet. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D127447
2021-11-05 17:23:01 +00:00
Gabriele Svelto b49d7a0b90 Bug 1722208 - Fix automatically displaying the on-screen keyboard on Windows 11 when running on convertible slates r=cmartin
This fix simply ignores tablet mode when running on Windows 11. The
reasoning behind this is that per Microsoft documentation tablet mode
is specific to Windows 10 and not supported anymore on Windows 11. This
seems consistent in the behavior of the APIs we use to detect the
presence of a keyboard: Windows 10-specific APIs return unexpected
results while APIs that predate them return values that seem consistent
and reliable.

Differential Revision: https://phabricator.services.mozilla.com/D128229
2021-10-28 21:08:12 +00:00
Paul Bone 1b721fc414 Bug 1735715 - Handle gMaxSubPageClass == 0 properly r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D128448
2021-10-21 06:03:45 +00:00
Alexandru Michis fea1e1a0c7 Backed out changeset 539230e86e11 (bug 1722208) for causing windows to get stuck in tablet mode on Windows 11 - no minimize and maximize buttons (bug 1735961)
CLOSED TREE
2021-10-15 18:32:49 +03:00
Gabriele Svelto ced1ed1d25 Bug 1722208 - Workaround to make the Windows on-screen keyboard work properly on convertible slates running Windows 11 r=cmartin
Differential Revision: https://phabricator.services.mozilla.com/D128229
2021-10-14 08:30:32 +00:00
Chris Peterson 3846a747b0 Bug 1723674 - mfbt: Add new GenerateRandomBytes() function. r=cmartin
Generalize RandomUint64() into a new GenerateRandomBytes() function, which will be used in the next changeset to replace nsUUIDGenerator's various platform-specific implementations with one simple implementation.

Differential Revision: https://phabricator.services.mozilla.com/D124311
2021-10-14 03:28:48 +00:00
Jan Varga ae30add3b8 Bug 1731801 - Allow ToResult to return other nsresult like error types; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D126270
2021-10-11 08:34:01 +00:00
Jon Coppeard 4055d681e6 Bug 1730534 - Part 1: Assert state of SegmentedVector iterator is valid r=mccr8
The next patches remove elements from a segmented vector that is being
iterated. This patch adds assertions to ensure that we don't attempt to use an
iterator that points to a removed element.

The assertions are added to Done() because all the other methods call that.

Differential Revision: https://phabricator.services.mozilla.com/D125426
2021-09-27 16:41:51 +00:00
Nika Layzell a67a90d1c3 Bug 1725572 - Part 1: Support move-only closures in ScopeExit, r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D125895
2021-09-23 18:54:31 +00:00
Marian-Vasile Laza 248c0cd8b6 Backed out 4 changesets (bug 1730534) for conflicts with backout of bug 1536061. a=backout
Backed out changeset fc881c57d119 (bug 1730534)
Backed out changeset 0f72a8c5f8c5 (bug 1730534)
Backed out changeset 007cbeea4325 (bug 1730534)
Backed out changeset 83d53ed76e0f (bug 1730534)
2021-09-20 13:21:23 +03:00
Jon Coppeard 7ad0c5ec32 Bug 1730534 - Part 1: Assert state of SegmentedVector iterator is valid r=mccr8
The next patches remove elements from a segmented vector that is being
iterated. This patch adds assertions to ensure that we don't attempt to use an
iterator that points to a removed element.

The assertions are added to Done() because all the other methods call that.

Differential Revision: https://phabricator.services.mozilla.com/D125426
2021-09-17 06:33:08 +00:00
Tyson Smith d8f7c11471 Bug 1725008 - Implement FuzzingFunctions.crash() r=glandium,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D125000
2021-09-15 18:24:04 +00:00
Chris Peterson 339c7d8961 Bug 1729598 - Remove now-unused MustUseChecker and MOZ_MUST_USE_TYPE attribute. r=static-analysis-reviewers,andi
Depends on D125504

Differential Revision: https://phabricator.services.mozilla.com/D125505
2021-09-15 05:10:51 +00:00
Chris Peterson c9530ebe28 Bug 1729598 - Replace MOZ_MUST_USE_TYPE with [[nodiscard]]. r=static-analysis-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D125504
2021-09-15 05:10:51 +00:00
Daniel Holbert 8761eb8cee Bug 1730774 part 1: Give EnumeratedRange.h an include for Assertions.h, since it includes MOZ_ASSERT statements. r=TYLin
Without this patch, these MOZ_ASSERT statements cause build errors, if I build
the layout/generic directory in non-unified mode.

(Instead of this patch, we could also hypothetically sprinkle individual
#includes for Assertions.h around to all the downstream files; but it's simpler
and more direct to just put it here in the file that contains the MOZ_ASSERT
statements in question. Note that many other MFBT headers also have includes
for Assertions.h, so it seems reasonable to include it here as well.)

Differential Revision: https://phabricator.services.mozilla.com/D125610
2021-09-14 22:06:22 +00:00
Jesse Schwartzentruber 512463417e Bug 1624717 - Copy release mode bounds checking from nsTArray to Array r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D124833
2021-09-09 13:29:18 +00:00
Andi-Bogdan Postelnicu 2fc4f70e9b Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.

This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.

Differential Revision: https://phabricator.services.mozilla.com/D122345
2021-08-25 10:46:17 +00:00
André Bargull dca8370c53 Bug 1341265 - Part 11: Optimise Set.prototype.has for objects in CacheIR. r=iain
Inline `Set.prototype.has` in CacheIR when called with objects.

Implementing `MacroAssembler::hashObject()` on 32-bit platforms is difficult,
because it uses 64-bit operations, so we either have to allocate twice as much
registers for `Register64` or alternatively spill the values on the stack. For
now just punt and only support this optimisation on 64-bit platforms.

Differential Revision: https://phabricator.services.mozilla.com/D118977
2021-08-10 09:55:22 +00:00
André Bargull fc13c8d5c1 Bug 1341265 - Part 1: Remove stale fixme comment. r=iain
Bug 775896 has been fixed, so we can remove the fixme comment.

Differential Revision: https://phabricator.services.mozilla.com/D118967
2021-08-10 09:55:18 +00:00
Narcis Beleuzu ca6769529e Backed out 22 changesets (bug 1341265) for bustages on VMFunctions.cpp . CLOSED TREE
Backed out changeset d21b307ccfaf (bug 1341265)
Backed out changeset 182be3b078d9 (bug 1341265)
Backed out changeset 684915d2fc1c (bug 1341265)
Backed out changeset 7b187e896bef (bug 1341265)
Backed out changeset 1f7646c44496 (bug 1341265)
Backed out changeset ed9ca5806dbc (bug 1341265)
Backed out changeset b1db78c1508a (bug 1341265)
Backed out changeset 63d0d4dc2972 (bug 1341265)
Backed out changeset 77d1207af1c0 (bug 1341265)
Backed out changeset d24cb3906dda (bug 1341265)
Backed out changeset 6f1d162738b4 (bug 1341265)
Backed out changeset 186a7d8db816 (bug 1341265)
Backed out changeset e5f6eb92c12c (bug 1341265)
Backed out changeset 46f05b533e75 (bug 1341265)
Backed out changeset 77735582aefb (bug 1341265)
Backed out changeset 3c94f61e57ca (bug 1341265)
Backed out changeset cab9608e9d98 (bug 1341265)
Backed out changeset 08768e69a817 (bug 1341265)
Backed out changeset df7c4fac5dc8 (bug 1341265)
Backed out changeset f1c40722a50e (bug 1341265)
Backed out changeset 2b174465dea5 (bug 1341265)
Backed out changeset 602b65bfb721 (bug 1341265)
2021-08-10 11:27:51 +03:00
André Bargull 867b1e4662 Bug 1341265 - Part 11: Optimise Set.prototype.has for objects in CacheIR. r=iain
Inline `Set.prototype.has` in CacheIR when called with objects.

Implementing `MacroAssembler::hashObject()` on 32-bit platforms is difficult,
because it uses 64-bit operations, so we either have to allocate twice as much
registers for `Register64` or alternatively spill the values on the stack. For
now just punt and only support this optimisation on 64-bit platforms.

Differential Revision: https://phabricator.services.mozilla.com/D118977
2021-08-10 07:45:34 +00:00
André Bargull f506795ec1 Bug 1341265 - Part 1: Remove stale fixme comment. r=iain
Bug 775896 has been fixed, so we can remove the fixme comment.

Differential Revision: https://phabricator.services.mozilla.com/D118967
2021-08-10 07:45:30 +00:00
Butkovits Atila c5ea1e4659 Backed out 21 changesets (bug 1341265) for causing Bug 1724298. CLOSED TREE
Backed out changeset ad0987b840c1 (bug 1341265)
Backed out changeset c3094bf07295 (bug 1341265)
Backed out changeset 199d9708682d (bug 1341265)
Backed out changeset 991572f50cf9 (bug 1341265)
Backed out changeset bf631916de9b (bug 1341265)
Backed out changeset 5d9d8af2f4ac (bug 1341265)
Backed out changeset 720032f06c94 (bug 1341265)
Backed out changeset 85f8b1c24e9d (bug 1341265)
Backed out changeset 13da03ae88a8 (bug 1341265)
Backed out changeset 6716962a06ed (bug 1341265)
Backed out changeset 26787054e0db (bug 1341265)
Backed out changeset 21199bd4965d (bug 1341265)
Backed out changeset bd5e0950f9d9 (bug 1341265)
Backed out changeset 3fa14377770a (bug 1341265)
Backed out changeset 56ec3626f0ba (bug 1341265)
Backed out changeset 09f04c26176c (bug 1341265)
Backed out changeset b861bb6771c7 (bug 1341265)
Backed out changeset 820e01c32bcd (bug 1341265)
Backed out changeset 88e497d213fe (bug 1341265)
Backed out changeset e9272f7d1823 (bug 1341265)
Backed out changeset 33a140c71ff0 (bug 1341265)
2021-08-07 19:07:28 +03:00
André Bargull 58f4af8485 Bug 1341265 - Part 11: Optimise Set.prototype.has for objects in CacheIR. r=iain
Inline `Set.prototype.has` in CacheIR when called with objects.

Implementing `MacroAssembler::hashObject()` on 32-bit platforms is difficult,
because it uses 64-bit operations, so we either have to allocate twice as much
registers for `Register64` or alternatively spill the values on the stack. For
now just punt and only support this optimisation on 64-bit platforms.

Differential Revision: https://phabricator.services.mozilla.com/D118977
2021-08-02 16:38:04 +00:00
André Bargull 93463e429d Bug 1341265 - Part 1: Remove stale fixme comment. r=iain
Bug 775896 has been fixed, so we can remove the fixme comment.

Differential Revision: https://phabricator.services.mozilla.com/D118967
2021-08-02 16:38:00 +00:00
Iain Ireland 094d5b88a8 Bug 1719396: Don't hash sizeof(size_t) in HashBytes r=glandium
The loop in HashBytes currently hashes both a word of data (as intended) and the length of that word of data (a constant).

This was [acknowledged as a bug](https://bugzilla.mozilla.org/show_bug.cgi?id=729940#c49) when first written, but slipped through the cracks and was never fixed.

Differential Revision: https://phabricator.services.mozilla.com/D119466
2021-07-19 21:35:40 +00:00
Gerald Squelart 81d28b5530 Bug 1719959 - Better Tag type choice, fixed corresponding test - r=emilio
On some systems, uint_fast8_t may be as big as size_t! So the `static_assert(sizeof(aIndex) < sizeof(size_t))` could fail there. The better test here is to check for the expected type (uint_fast8_t).

Now, since uint_fast8_t can be bigger than 8 bits, we may as well choose it for variant sizes greater than 255, up to UINT_FAST8_MAX.
(The added parentheses help clang-format distinguish '<' for tests vs for templates.)

Differential Revision: https://phabricator.services.mozilla.com/D119574
2021-07-11 09:43:50 +00:00
Nika Layzell 0e22f3df51 Bug 1717808 - aIter must be valid after extracting last segment of a BufferList, r=glandium
When advancing to Beta, we stop adding sentinels after serialized data
in IPC::Message objects. These sentinels would cause all Extract calls
to not reach the end of the message buffer on Nightly. This patch fixes
an assertion failure which can occur when extract calls fully empty the
buffer, and the finished iterator is advanced by 0 bytes.

Differential Revision: https://phabricator.services.mozilla.com/D118838
2021-07-07 18:03:03 +00:00
Nika Layzell 82ee49b019 Bug 1717778 - Upgrade some LinkedList asserts to RELEASE_ASSERT, r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D118719
2021-06-25 16:53:39 +00:00
Nika Layzell 5731c1747c Bug 1717526 - String's implicit conversion operator causes COW relocations, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D118430
2021-06-23 01:57:00 +00:00
Alexandru Michis e3d24b013a Backed out changeset 3beb01f5d643 (bug 1717526) for causing gtest failures in SpanTest.from_xpcom_collections
CLOSED TREE
2021-06-23 01:58:49 +03:00
Nika Layzell c14de7eabc Bug 1717526 - String's implicit conversion operator causes COW relocations, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D118430
2021-06-22 21:18:03 +00:00
Nika Layzell 10e86924f0 Bug 1706374 - Part 14: Track the absolute offset on iterators, r=glandium
This should improve the performance of large calls to AdvanceAcrossSegments
when using a very large BufferList, as we no longer need to iterate over each
element to find the destination when the call is closer to the end.

This will be used most frequently with the new footer code to seek to the end
of an IPC message to read out the footer.

Differential Revision: https://phabricator.services.mozilla.com/D116667
2021-06-22 18:17:23 +00:00
Nika Layzell 599b58f458 Bug 1706374 - Part 13: Remove the event footer from an IPC::Message when deserializing, r=handyman,glandium
This unfortunately requires a new method to be added to BufferList to
support truncating the buffer to a particular iterator.

Differential Revision: https://phabricator.services.mozilla.com/D116666
2021-06-22 18:17:23 +00:00
Butkovits Atila 83f57b5c69 Backed out 22 changesets (bug 1714226, bug 1706374, bug 1713148) for causing build bustages on MessageChannel.cpp. CLOSED TREE
Backed out changeset ea469eaa54ca (bug 1713148)
Backed out changeset fd8523d5126e (bug 1713148)
Backed out changeset f2e5309c914c (bug 1713148)
Backed out changeset 2da57973ed55 (bug 1713148)
Backed out changeset 677e1ee99bb2 (bug 1713148)
Backed out changeset b4c0619e79bf (bug 1706374)
Backed out changeset c02fa459e77d (bug 1706374)
Backed out changeset 72dc6537cf0b (bug 1706374)
Backed out changeset 48088463c656 (bug 1706374)
Backed out changeset b09ae4c3a94b (bug 1706374)
Backed out changeset 04422175004b (bug 1706374)
Backed out changeset 110b2384e7d1 (bug 1706374)
Backed out changeset ab2b086abbd4 (bug 1706374)
Backed out changeset ffde07f73249 (bug 1706374)
Backed out changeset c6303af17ff4 (bug 1706374)
Backed out changeset 02249671c2f9 (bug 1706374)
Backed out changeset a6a5d05b5636 (bug 1706374)
Backed out changeset e21b6defb805 (bug 1706374)
Backed out changeset c72c5be9ddb1 (bug 1706374)
Backed out changeset 23cd961575a6 (bug 1706374)
Backed out changeset b412d6e9e145 (bug 1706374)
Backed out changeset a8ec285d6472 (bug 1714226)
2021-06-22 04:03:56 +03:00
Nika Layzell 96dd5437ae Bug 1706374 - Part 14: Track the absolute offset on iterators, r=glandium
This should improve the performance of large calls to AdvanceAcrossSegments
when using a very large BufferList, as we no longer need to iterate over each
element to find the destination when the call is closer to the end.

This will be used most frequently with the new footer code to seek to the end
of an IPC message to read out the footer.

Differential Revision: https://phabricator.services.mozilla.com/D116667
2021-06-21 21:53:12 +00:00
Nika Layzell 344d8d6622 Bug 1706374 - Part 13: Remove the event footer from an IPC::Message when deserializing, r=handyman,glandium
This unfortunately requires a new method to be added to BufferList to
support truncating the buffer to a particular iterator.

Differential Revision: https://phabricator.services.mozilla.com/D116666
2021-06-21 21:53:11 +00:00
Toshihito Kikuchi deeb00a274 Bug 1695817 - Part 5: Add std::equal_range equivalent in MFBT. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D114598
2021-05-28 22:35:58 +00:00
Alexandru Michis 8fbcd44dc4 Backed out 9 changesets (bug 1695817) for causing bc failures in content/aboutThirdParty.js
CLOSED TREE

Backed out changeset 6b7f451e911e (bug 1695817)
Backed out changeset ad3ea67b3d70 (bug 1695817)
Backed out changeset b4f971059f3f (bug 1695817)
Backed out changeset 9c9a928d4a70 (bug 1695817)
Backed out changeset 4a9bcb38fddf (bug 1695817)
Backed out changeset 48c0eed38628 (bug 1695817)
Backed out changeset 7583675dccb1 (bug 1695817)
Backed out changeset e3f2bed63c33 (bug 1695817)
Backed out changeset 1c45ba4fba61 (bug 1695817)
2021-05-28 21:53:41 +03:00
Toshihito Kikuchi 0441dec54b Bug 1695817 - Part 5: Add std::equal_range equivalent in MFBT. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D114598
2021-05-28 15:32:31 +00:00
Butkovits Atila 3735a33d14 Backed out 9 changesets (bug 1695817) for causing build bustages. CLOSED TREE
Backed out changeset 49be1caf6501 (bug 1695817)
Backed out changeset 30f1382d6058 (bug 1695817)
Backed out changeset ab9fa7f3b633 (bug 1695817)
Backed out changeset b03b122438cc (bug 1695817)
Backed out changeset 812a6bbfbe0e (bug 1695817)
Backed out changeset 3551230a7522 (bug 1695817)
Backed out changeset c7354b48fbee (bug 1695817)
Backed out changeset 4860450c2e23 (bug 1695817)
Backed out changeset 29dee289f866 (bug 1695817)
2021-05-28 07:52:30 +03:00
Toshihito Kikuchi f86792fbca Bug 1695817 - Part 5: Add std::equal_range equivalent in MFBT. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D114598
2021-05-28 04:19:07 +00:00
Butkovits Atila 711401ea39 Backed out 9 changesets (bug 1695817) for causing failures at browser_all_files_referenced.js. CLOSED TREE
Backed out changeset df4086427aaf (bug 1695817)
Backed out changeset 119a24f8be08 (bug 1695817)
Backed out changeset fd277ae2a7b8 (bug 1695817)
Backed out changeset a2c86a645fa8 (bug 1695817)
Backed out changeset c73705233fc4 (bug 1695817)
Backed out changeset 0a80eea3c0fa (bug 1695817)
Backed out changeset 9af42c7a3ca7 (bug 1695817)
Backed out changeset a2d11a0849d5 (bug 1695817)
Backed out changeset ba3ddcc28cbf (bug 1695817)
2021-05-28 03:05:09 +03:00
Toshihito Kikuchi 1a79ad5407 Bug 1695817 - Part 5: Add std::equal_range equivalent in MFBT. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D114598
2021-05-27 21:14:14 +00:00
Jan Varga c06f56c861 Bug 1709352 - Allow QMResult errors to use existing stack id and to increase the frame id during error propagation; r=dom-storage-reviewers,asuth,glandium
Differential Revision: https://phabricator.services.mozilla.com/D114243
2021-05-25 07:28:20 +00:00
Gerald Squelart 5cbf88670f Bug 1710145 - Deduction guide RefPtr(already_AddRefed<T>) -> RefPtr<T> - r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D114809
2021-05-11 21:55:21 +00:00
Andi-Bogdan Postelnicu eab549fd19 Bug 1519636 - Initial reformat of C/C++ code with clang-format version 12.0.0. r=sylvestre
clang-format version 12.0.0 (taskcluster-KEgO7qdgQ8uaewA6NkRnRA)

Differential Revision: https://phabricator.services.mozilla.com/D114211
2021-05-10 07:15:07 +00:00
Chris Fallin 2e5115af2e Bug 1704775 part 10 - Disable unsupported c++ tests. r=glandium
WASI doesn't support some c++ tests for threads, so
in this patch we just stubbed them out.

Differential Revision: https://phabricator.services.mozilla.com/D111815
2021-04-27 06:09:27 +00:00
Jan de Mooij dca62ba9ee Bug 1706900 part 6 - Replace ShapeTable's custom hash table with a HashSet. r=jonco
This is much simpler and lets us tidy up the addProperty code more. It also makes
it easier to change ShapeTable for property maps in the future.

Lookup performance and memory usage appear to be similar for the two versions,
probably because ShapeTable used the same double-hashing algorithm and because
we can purge most ShapeTables on GC.

Differential Revision: https://phabricator.services.mozilla.com/D113089
2021-04-26 11:00:06 +00:00
Chris Fallin c0d9956b61 Bug 1701885 part 6 - Fix signals for WASI. r=jandem,wingo
WASI lacks of the signals support yet, so this patch stubs out
uses of signals for WASI.

Differential Revision: https://phabricator.services.mozilla.com/D110216
2021-04-20 05:15:28 +00:00
Dmitry Bezhetskov 3cc53df2c0 Bug 1701879 part 5 - Add stub atomics implementation for WASI. r=wingo,glandium
WASI lacks of the <atomic> support yet, so this patch is adding stub
implementation of atomics for WASI.

Differential Revision: https://phabricator.services.mozilla.com/D110215
2021-04-20 05:15:28 +00:00
Mike Hommey 6a41d8d7ad Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld
Differential Revision: https://phabricator.services.mozilla.com/D110899
2021-04-16 04:06:02 +00:00
Butkovits Atila 8255e3083f Backed out changeset 5c6b15fcea71 (bug 1515229) for causing GTest failures. CLOSED TREE 2021-04-15 13:37:29 +03:00
Mike Hommey 2eacd46d46 Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld
Differential Revision: https://phabricator.services.mozilla.com/D110899
2021-04-14 22:31:36 +00:00
Emilio Cobos Álvarez 80439edf68 Bug 1699844 - Add an escape hatch for the refcounted inside lambda checker. r=andi
Allow using the MOZ_KnownLive function to get around it.

Use case is the following: I have an std::function member variable, and I want
that member to be able to capture `this`.

Using a strong reference creates a cycle and thus would leak. I know `this` to
always outlive the member, so it is fine to use a weak capture there.

Differential Revision: https://phabricator.services.mozilla.com/D111850
2021-04-14 19:12:02 +00:00
smolnar 22c6eb14ba Backed out changeset f7b0cdc3aeb0 (bug 1515229) for causing xpc failures in test_feature_stackwalking. CLOSED TREE 2021-04-14 12:25:37 +03:00
Mike Hommey 133396cb94 Bug 1515229 - Make MozStackWalk/MozWalkTheStack frame skipping more reliable. r=gerald,nika,bobowen,jld
Differential Revision: https://phabricator.services.mozilla.com/D110899
2021-04-14 04:47:09 +00:00
Chris Fallin 605271bd29 Bug 1701620 part 4 - Fix memory support for WASI. r=jandem,sfink
WASI lacks of support many memory stuff like mmap, memory protections and etc, but
it has malloc so we can use it instead. Also, here we are stubbing out all
uses of the missing WASI memory functionality.

Differential Revision: https://phabricator.services.mozilla.com/D110075
2021-04-13 08:25:10 +00:00
Csoregi Natalia 91bd333c25 Backed out changeset f48cb748519b (bug 1701620) for bustage on Memory.cpp. CLOSED TREE 2021-04-13 10:09:41 +03:00
Chris Fallin 4e5ae46c03 Bug 1701620 part 4 - Fix memory support for WASI. r=jandem,sfink
WASI lacks of support many memory stuff like mmap, memory protections and etc, but
it has malloc so we can use it instead. Also, here we are stubbing out all
uses of the missing WASI memory functionality.

Differential Revision: https://phabricator.services.mozilla.com/D110075
2021-04-13 06:50:13 +00:00
Chris Fallin f062cdc9ba Bug 1701613 part 3 - Add stub thread implementation for WASI. r=jandem,wingo
WASI lacks thread support so the stub implementation for threads has been added.

Differential Revision: https://phabricator.services.mozilla.com/D110073
2021-04-08 08:02:16 +00:00
Emilio Cobos Álvarez 0b9fa22976 Bug 1701942 - Use bitwise equality for font variation value comparisons. r=jfkthame
Just like we do for font sizes / size-adjust in gfxFontStyle.

Differential Revision: https://phabricator.services.mozilla.com/D110519
2021-04-02 12:37:23 +00:00
Simon Giesecke f1f098cdaa Bug 1700336 - Use MaybeStorageBase in Maybe. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D109487
2021-03-24 13:21:31 +00:00
Simon Giesecke ae75c3faa8 Bug 1601556 - Make Result<V, E> a literal type if V and E are literal types and PackingStrategy is not Variant. r=emilio
Also make CompactPair<A, B> a literal type if A and B are literal types,
and add MaybeStorageBase that ought to be used as a basis of MaybeStorage
in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D55930
2021-03-23 12:35:19 +00:00
Mike Hommey 4d8e18962b Bug 1699375 - Move WalkTheStack to mozglue. r=nika
A long standing issue is that MOZ_ASSERT and related don't print stack
traces in debug builds when they're directly or indirectly emitted from
non-libxul code. Moving WalkTheStack to mozglue alleviates the problem.

It's also not printing stack traces when emitted from C code (and for
some C third party libraries, we do redirect assert to MOZ_ASSERT),
which we solve by making the corresponding API available without C++
(which WalkTheStack being a static method of the nsTraceRefCnt class
didn't allow, or the use of a closure on Android).

This requires some adjustements to headers that indirectly assume that
Assertions.h includes ErrorList.h through nsError.h through nscore.h
through nsTraceRefcnt.h.

We also remove TestStackCrawl.cpp because it hasn't been built since
bug 158528, 19 years ago.

Differential Revision: https://phabricator.services.mozilla.com/D108913
2021-03-22 21:25:30 +00:00
Chris Peterson 7cba58e66d Bug 1571631 - Remove MOZ_MUST_USE definition. r=sg
Depends on D108345

Differential Revision: https://phabricator.services.mozilla.com/D108346
2021-03-17 03:01:21 +00:00