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

2479 Коммитов

Автор SHA1 Сообщение Дата
Andi-Bogdan Postelnicu 4efa1bd0ba Bug 1276351 - Move away from mozilla::tuple to std::tuple. r=necko-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173256
2023-03-27 07:20:25 +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
Andi-Bogdan Postelnicu 447f1e3358 Bug 1276351 - Move away from mozilla::tuple to std::tuple. r=necko-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173256
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 a1b827b503 Bug 1276351 - Move away from mozilla::tuple to std::tuple. r=necko-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173256
2023-03-24 18:55:39 +00:00
Andi-Bogdan Postelnicu 3fd4d5f938 Bug 1660405 - Transform mozilla::IsNegative to use std implementation. r=glandium
Since we cannot move away from mozilla::IsNegative to std::signbit because the
first one doesn't accept a NaN we should transform our function to use std implementation.

Differential Revision: https://phabricator.services.mozilla.com/D173111
2023-03-22 11:35:36 +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
Andi-Bogdan Postelnicu fa5d4cca1f Bug 1660405 - Move away from mozilla::IsFinite in favor of std::isfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173036
2023-03-22 11:35:33 +00:00
Andi-Bogdan Postelnicu 10f49d4180 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 11:35:33 +00:00
Jon Coppeard f3c4ef32b2 Bug 1821659 - Part 2: Return hash code from ensureHash too r=sfink
Similarly |ensureHash| should return the hash code it creates so we don't have
to look it up immediately.

Differential Revision: https://phabricator.services.mozilla.com/D173123
2023-03-22 09:53:17 +00:00
Jon Coppeard 3c7221a13c Bug 1821659 - Part 1: Allow fallible hashing to return the hash code with maybeGetHash r=sfink
This is used where the hash table operation can fail early if we know there's
never been a hash code created for a lookup. If there has been a hash code
created, it's more efficient to return it though as otherwise we will always
query it straight away.

Therefore this renames |hasHash| to |maybeGetHash| and adds an output
parameter.

Differential Revision: https://phabricator.services.mozilla.com/D173122
2023-03-22 09:53:16 +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 8fed9936fb Bug 1660405 - Transform mozilla::IsNegative to use std implementation. r=glandium
Since we cannot move away from mozilla::IsNegative to std::signbit because the
first one doesn't accept a NaN we should transform our function to use std implementation.

Differential Revision: https://phabricator.services.mozilla.com/D173111
2023-03-22 09:27:59 +00: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
Andi-Bogdan Postelnicu 0b692b5a96 Bug 1660405 - Move away from mozilla::IsFinite in favor of std::isfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173036
2023-03-22 09:27:57 +00:00
Andi-Bogdan Postelnicu a5d28acdd6 Bug 1660405 - Move away from mozilla::IsNaN in favor of std::isnan. r=nbp,media-playback-reviewers,sergesanspaille,padenot
Differential Revision: https://phabricator.services.mozilla.com/D173035
2023-03-22 09:27:56 +00:00
Nika Layzell 10582b6528 Bug 1607634 - Part 1: Improve the ergonomics of using NotNull with RefPtr and nsCOMPtr, r=glandium
This does a few minor improvements:
1. Adds implicit conversions from NotNull to a raw pointer type if supported by
   the underlying type, to make it so NotNull<RefPtr<T>> acts more like
   RefPtr<T> in some situations.
2. Adds explicit conversion constructors and assignment operators for RefPtr
   and nsCOMPtr from NotNull, avoiding conversion ambiguity added by the first
   change.
3. Disable conversion constructors on NotNull with SFINAE if they should not be
   available, meaning that type traits like std::is_convertible_v interact with
   it properly.

Differential Revision: https://phabricator.services.mozilla.com/D168883
2023-03-20 15:40:35 +00:00
Jason Kratzer ab6d98f4db Bug 1822605: Add ThreadSanitizer suppression for race in libvulkan_lvp.so r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D172819
2023-03-16 20:12:03 +00:00
Iulian Moraru 801dae8f2c Backed out 14 changesets (bug 1607634, bug 1814683, bug 1815177, bug 1814686) for causing build bustages on MaybeStorageBase. CLOSED TREE
Backed out changeset ae1c0551cea5 (bug 1815177)
Backed out changeset a11cafaa1884 (bug 1814686)
Backed out changeset 621507521762 (bug 1814686)
Backed out changeset ad692c73e381 (bug 1814686)
Backed out changeset 3be031e503dc (bug 1607634)
Backed out changeset aebbaa145d2d (bug 1607634)
Backed out changeset 9aa1f346fe14 (bug 1607634)
Backed out changeset e3eb77ad55ca (bug 1607634)
Backed out changeset e60591e5d5cf (bug 1607634)
Backed out changeset 6e43042d204a (bug 1814683)
Backed out changeset 1706e88652d6 (bug 1814683)
Backed out changeset 6878a1590e91 (bug 1814683)
Backed out changeset b1c980c834d8 (bug 1814683)
Backed out changeset 94480b82d102 (bug 1814683)
2023-03-15 01:58:36 +02:00
Nika Layzell c821668d34 Bug 1607634 - Part 1: Improve the ergonomics of using NotNull with RefPtr and nsCOMPtr, r=glandium
This does a few minor improvements:
1. Adds implicit conversions from NotNull to a raw pointer type if supported by
   the underlying type, to make it so NotNull<RefPtr<T>> acts more like
   RefPtr<T> in some situations.
2. Adds explicit conversion constructors and assignment operators for RefPtr
   and nsCOMPtr from NotNull, avoiding conversion ambiguity added by the first
   change.
3. Disable conversion constructors on NotNull with SFINAE if they should not be
   available, meaning that type traits like std::is_convertible_v interact with
   it properly.

Differential Revision: https://phabricator.services.mozilla.com/D168883
2023-03-14 19:31:38 +00:00
Christian Holler (:decoder) 3b82ba8433 Bug 1821008 - Add nyx abort macro and more debug messages. r=truber,glandium
Differential Revision: https://phabricator.services.mozilla.com/D171979
2023-03-14 07:50:36 +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
Kelsey Gilbert 000ff9b4e5 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-03-13 21:04:10 +00:00
Paul Bone 9cf01cdc21 Bug 1820685 - Improve the comment for reserve() in HashSet/HashTable r=glandium DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D171815
2023-03-08 08:09:02 +00:00
Emilio Cobos Álvarez 58dfff38db Bug 1815396 - Fix documentation of MruCache. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D171653
2023-03-06 10:43:27 +00:00
Marian-Vasile Laza 235833c608 Backed out 2 changesets (bug 1815396) for wpt failures on 2d.gradient.object.current.html. CLOSED TREE
Backed out changeset 68e805821a98 (bug 1815396)
Backed out changeset 0fb8dd16d01c (bug 1815396)
2023-03-05 22:01:05 +02:00
Emilio Cobos Álvarez 0985c30fb7 Bug 1815396 - Fix documentation of MruCache. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D171653
2023-03-05 18:40:14 +00:00
Yannis Juglaret 16873187c2 Bug 1819064 - Add a MOZ_NO_STACK_PROTECTOR modifier attribute. r=gstoll
We define a new MOZ_HAVE_NO_STACK_PROTECTOR modifier attribute. It is
mapped to __attribute__((no_stack_protector)) and specifies that a given
function should *NOT* be instrumented to detect stack buffer overflows
at runtime.

Differential Revision: https://phabricator.services.mozilla.com/D171361
2023-03-03 15:07:49 +00:00
Jason Kratzer b728f506fc Bug 1816713 - Add libvulkan to thread sanitizer suppression list r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D171136
2023-02-28 16:18:19 +00:00
Yannis Juglaret c998f74ae3 Bug 1788004 - Implement a hook-based fallback for BCryptGenRandom to mitigate Rust panics. r=cmartin
BCryptGenRandom can be broken, but the Rust stdlib and the getrandom
crate rely on it, and this is a source of crashes which are Rust
panics. This happens the most on Windows 7 after bcryptprimitives.dll
fails to load (see bug 1788004).

To mitigate these crashes, we hook BCryptGenRandom if we detect that it
is broken, and install a fallback based on RtlGenRandom. We only protect
calls that use BCRYPT_USE_SYSTEM_PREFERRED_RNG; so code that relies on
using BCryptOpenAlgorithmProvider and doesn't have its own fallback can
still fail.

We will hopefully remove this hook when the Rust stdlib and the
getrandom crate both have their own RtlGenRandom-based fallback.

Differential Revision: https://phabricator.services.mozilla.com/D170662
2023-02-27 15:00:57 +00:00
Cosmin Sabou d8ac128a8d Backed out changeset 78e7281703a2 (bug 1788004) for causing SM failures. CLOSED TREE 2023-02-24 19:13:47 +02:00
Yannis Juglaret 45cce5b7c0 Bug 1788004 - Implement a hook-based fallback for BCryptGenRandom to mitigate Rust panics. r=cmartin
BCryptGenRandom can be broken, but the Rust stdlib and the getrandom
crate rely on it, and this is a source of crashes which are Rust
panics. This happens the most on Windows 7 after bcryptprimitives.dll
fails to load (see bug 1788004).

To mitigate these crashes, we hook BCryptGenRandom if we detect that it
is broken, and install a fallback based on RtlGenRandom. We only protect
calls that use BCRYPT_USE_SYSTEM_PREFERRED_RNG; so code that relies on
using BCryptOpenAlgorithmProvider and doesn't have its own fallback can
still fail.

We will hopefully remove this hook when the Rust stdlib and the
getrandom crate both have their own RtlGenRandom-based fallback.

Differential Revision: https://phabricator.services.mozilla.com/D170662
2023-02-24 15:47:14 +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
Kelsey Gilbert c68b5dd286 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-15 08:29:41 +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
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