Commit Graph

676 Commits

Author SHA1 Message Date
Andi-Bogdan Postelnicu
3d035ca8b1 Bug 1679492 - Remove parts that are unused from mfbt/TemplateLib. r=sergesanspaille
Some implementations from TemplateLib are easily changeable with std functionality.
mozilla::tl::And has been removed and replaced with std::conjuction

Differential Revision: https://phabricator.services.mozilla.com/D175762
2023-04-18 12:42:13 +00:00
serge-sans-paille
84f403224a Bug 1826756 - Make mfbt/tests/gtest buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D174881
2023-04-18 09:42:14 +00:00
Andi-Bogdan Postelnicu
79e171fd9f Bug 1277372 - Remove unused "mozilla/TypeTraits.h" r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D174129
2023-04-17 13:50:11 +00:00
Andi-Bogdan Postelnicu
bf2bb59367 Bug 1277372 - Move away from "mozilla/TypeTraits.h". r=geckoview-reviewers,sergesanspaille,m_kato
std::is_pod has been deprecated in C++20, see https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0767r1.html.
This is equivalent with std::is_trivial_v && std::is_standard_layout.

Differential Revision: https://phabricator.services.mozilla.com/D174128
2023-04-17 13:50:11 +00:00
Stanca Serban
cefd926755 Backed out 9 changesets (bug 1826760, bug 1826758, bug 1826752, bug 1826756, bug 1826759, bug 1826761, bug 1826757, bug 1826753, bug 1826754) for causing bp-hybrid bustages in ClearKeyDecryptionManager.cpp.
CLOSED TREE

Backed out changeset 210012222277 (bug 1826761)
Backed out changeset e364bb149efa (bug 1826760)
Backed out changeset e456e2f9966c (bug 1826759)
Backed out changeset 2b6ff545f4a3 (bug 1826758)
Backed out changeset 95fe1de8ba00 (bug 1826757)
Backed out changeset f8af52d7f2a1 (bug 1826756)
Backed out changeset 2646e773f098 (bug 1826754)
Backed out changeset 58d5d74b1835 (bug 1826753)
Backed out changeset 8567e6595acc (bug 1826752)
2023-04-17 13:52:39 +03:00
serge-sans-paille
26061f891d Bug 1826756 - Make mfbt/tests/gtest buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D174881
2023-04-17 10:11:56 +00:00
Sylvestre Ledru
fd7fdbccad no bug - mfbt: use the C++ usual declaration r=andi DONTBUILD
Depends on D174439

Differential Revision: https://phabricator.services.mozilla.com/D174440
2023-04-12 09:55:04 +00:00
Andi-Bogdan Postelnicu
02db5a8d8f Bug 1276351 - remove unused mozilla::tuple. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173299
2023-03-27 07:20:29 +00:00
Sandor Molnar
9db345d4c1 Backed out 2 changesets (bug 1276351) for causing build bustage in image/ClippedImage.cp CLOSED TREE
Backed out changeset e84598eb82c1 (bug 1276351)
Backed out changeset e940b0554484 (bug 1276351)
2023-03-25 14:16:43 +02:00
Andi-Bogdan Postelnicu
770e8dca42 Bug 1276351 - remove unused mozilla::tuple. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173299
2023-03-25 06:58:52 +00:00
Iulian Moraru
6d40eee997 Backed out 2 changesets (bug 1276351) for causing multiple failures.
Backed out changeset eeaf4f1e06af (bug 1276351)
Backed out changeset d44cb5704342 (bug 1276351)
2023-03-25 00:08:24 +02:00
Andi-Bogdan Postelnicu
90401e3fba Bug 1276351 - remove unused mozilla::tuple. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173299
2023-03-24 18:55:40 +00:00
Andi-Bogdan Postelnicu
e6c033fea4 Bug 1660405 - remove unused mozilla::IsFinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173050
2023-03-22 11:35:35 +00:00
Andi-Bogdan Postelnicu
c4666f21f3 Bug 1660405 - remove unused mozilla::IsInfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173049
2023-03-22 11:35:35 +00:00
Andi-Bogdan Postelnicu
847a0f9d04 Bug 1660405 - remove unused mozilla::IsNaN. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173048
2023-03-22 11:35:34 +00:00
Stanca Serban
e31a178029 Backed out 7 changesets (bug 1660405) for causing bustages on Linux x64 opt. CLOSED TREE
Backed out changeset ad1a5f59214f (bug 1660405)
Backed out changeset a39e95f0aafe (bug 1660405)
Backed out changeset 48629ee0d70d (bug 1660405)
Backed out changeset 8419b99aab60 (bug 1660405)
Backed out changeset 535cc12c8bed (bug 1660405)
Backed out changeset e27052da4927 (bug 1660405)
Backed out changeset 11b0f9cf8091 (bug 1660405)
2023-03-22 13:05:53 +02:00
Andi-Bogdan Postelnicu
76fde7399f Bug 1660405 - remove unused mozilla::IsFinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173050
2023-03-22 09:27:59 +00:00
Andi-Bogdan Postelnicu
ffa4c72717 Bug 1660405 - remove unused mozilla::IsInfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173049
2023-03-22 09:27:58 +00:00
Andi-Bogdan Postelnicu
c2d0ffbaf3 Bug 1660405 - remove unused mozilla::IsNaN. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173048
2023-03-22 09:27:58 +00:00
Kelsey Gilbert
19eabfaf4b Bug 1799258 - span_iterator::difference_type s/index_type/ptrdiff/. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167473
2023-03-13 21:04:11 +00:00
Stanca Serban
aaea911dc4 Backed out 9 changesets (bug 1799258) for causing multiple failures. CLOSED TREE
Backed out changeset 40351b5987a5 (bug 1799258)
Backed out changeset 87f3532bfbcd (bug 1799258)
Backed out changeset 9c1d9405e8bf (bug 1799258)
Backed out changeset 60a0351d9092 (bug 1799258)
Backed out changeset 5f911de66ec0 (bug 1799258)
Backed out changeset 294a00d1c7b7 (bug 1799258)
Backed out changeset 228200dcaf93 (bug 1799258)
Backed out changeset b25110652394 (bug 1799258)
Backed out changeset 3c3c7366cc40 (bug 1799258)
2023-02-15 12:18:44 +02:00
Kelsey Gilbert
0c259e6b9b Bug 1799258 - span_iterator::difference_type s/index_type/ptrdiff/. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167473
2023-02-15 08:29:43 +00:00
Andi-Bogdan Postelnicu
d7e8a09c21 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 15.0.5 (taskcluster-MKK8dHUpQkGfPLA793lizg)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D168658
2023-02-13 15:02:07 +00:00
Norisz Fay
ed1015daf1 Backed out 9 changesets (bug 1799258) for causing build bustages CLOSED TREE
Backed out changeset a48db1421c6d (bug 1799258)
Backed out changeset 7707637480e7 (bug 1799258)
Backed out changeset 0141b29bf5df (bug 1799258)
Backed out changeset cd9af26bb314 (bug 1799258)
Backed out changeset 4e68a54c6410 (bug 1799258)
Backed out changeset 52afd24d2338 (bug 1799258)
Backed out changeset b4b4977857c7 (bug 1799258)
Backed out changeset 2c23929f52f2 (bug 1799258)
Backed out changeset 83744e1e372b (bug 1799258)
2023-02-07 00:36:41 +02:00
Kelsey Gilbert
847d649fd8 Bug 1799258 - span_iterator::difference_type s/index_type/ptrdiff/. r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D167473
2023-02-06 19:58:55 +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
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
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
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
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
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
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
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