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

2325 Коммитов

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