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

2388 Коммитов

Автор SHA1 Сообщение Дата
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
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