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

2597 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey d46c6229a7 Bug 1917739 - Move Lz4 and mfbt/Compression* to mozglue/static. r=nika,frontend-codestyle-reviewers
As per mozglue/static/README:

> mozglue/static contains parts of the mozglue library that can/should be
> statically linked to e.g. js/Gecko.

The compression part of MFBT is a good candidate for this.

Differential Revision: https://phabricator.services.mozilla.com/D221565
2024-09-10 20:35:56 +00:00
Emilio Cobos Álvarez 1b8d105218 Bug 1916311 - [css-view-transitions] Initial pass at DOM API internals. r=boris,webidl,smaug
This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
https://github.com/w3c/csswg-drafts/issues/10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
2024-09-04 20:24:55 +00:00
Butkovits Atila c96c1efe67 Backed out 4 changesets (bug 1916311) for causing wpt failures at no-crash-set-exception.html. CLOSED TREE
Backed out changeset 7a2f34195c02 (bug 1916311)
Backed out changeset 09b974edc310 (bug 1916311)
Backed out changeset 91431bf2cb69 (bug 1916311)
Backed out changeset cadf4f0266df (bug 1916311)
2024-09-04 20:58:46 +03:00
Emilio Cobos Álvarez eb57419108 Bug 1916311 - [css-view-transitions] Initial pass at DOM API internals. r=boris,webidl,smaug
This is still fairly incomplete (i.e. no capturing, etc), but it allows
a transition to "start", and then finish (on the next frame always, for
now) or timeout, appropriately.

I think it's in a reviewable shape, given that. There's one known
divergence from the spec, which is described in
https://github.com/w3c/csswg-drafts/issues/10822

Differential Revision: https://phabricator.services.mozilla.com/D220843
2024-09-04 11:12:47 +00:00
Jan de Mooij e5aa13a668 Bug 1915328 - Update mallocedBufferBytes for string buffers used by nursery strings. r=jonco
This lets us trigger a minor GC if we're allocating many long strings. This avoids
a memory spike on the test case reported in the bug.

Differential Revision: https://phabricator.services.mozilla.com/D220388
2024-09-04 10:49:51 +00:00
Jan de Mooij 72e9c67c58 Bug 1914378 part 3 - Use a StringBuffer for long flattened ropes. r=sfink
This seems to improve the TodoMVC-jQuery subtest on Speedometer 3 by a few percent.

Differential Revision: https://phabricator.services.mozilla.com/D219882
2024-08-27 07:23:47 +00:00
Tamas Szentpeteri 01124ea9cc Backed out 3 changesets (bug 1914378) for causing mochitest failures on MemoryMetrics.cpp. CLOSED TREE
Backed out changeset 3bbc90177641 (bug 1914378)
Backed out changeset 1ca488534853 (bug 1914378)
Backed out changeset b24f14e9449f (bug 1914378)
2024-08-26 16:10:11 +03:00
Jan de Mooij 3a03cc8a2d Bug 1914378 part 3 - Use a StringBuffer for long flattened ropes. r=sfink
This seems to improve the TodoMVC-jQuery subtest on Speedometer 3 by a few percent.

Differential Revision: https://phabricator.services.mozilla.com/D219882
2024-08-26 11:27:07 +00:00
André Bargull c672727397 Bug 1910421: Support float16 in mozilla::FloatingPoint. r=jandem
Fixes the conversion in `mozilla::FloatingPoint` so we can add the specialisation
`mozilla::detail::FloatingPointTrait<js::float16>`.

And then update "TypedArrayObject.cpp" to directly use `mozilla::FloatingPoint`.

Differential Revision: https://phabricator.services.mozilla.com/D217981
2024-08-01 06:02:40 +00:00
Chun-Min Chang 8667329725 Bug 1865896 - Add ToString function to DefineEnum r=padenot
This patch addes some macros to implement to-string helpers for enums.

Differential Revision: https://phabricator.services.mozilla.com/D194260
2024-07-31 00:09:52 +00:00
fanc999 29c55a7924 Bug 1907001 - Add MOZ_HAS_CLANG_ATTRIBUTE r=glandium
Note this patch was provided by a contributor to fix MSVC builds of a SpiderMonkey embedding.

Differential Revision: https://phabricator.services.mozilla.com/D216843
2024-07-25 15:17:24 +00:00
jake fd84534138 Bug 1909472 - Support unsigned long in T2S for wasm builds. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D217444
2024-07-24 12:46:12 +00:00
Jan de Mooij fd85857bb1 Bug 1907891 part 2 - Create shared string buffer for long strings allocated by js::StringBuffer. r=sfink,emilio
In `JSStringBuilder` (derives from `js::StringBuffer`) we now reserve space for the
`mozilla::StringBuffer` header in the internal vector. When creating a long string, we can
then directly initialize this header without having to move all characters in memory.

Differential Revision: https://phabricator.services.mozilla.com/D216694
2024-07-24 12:21:07 +00:00
Ryan VanderMeulen 4e29f940e0 Bug 1909352 - Update LZ4 to v1.10.0. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D217344
2024-07-23 16:49:31 +00:00
Sylvestre Ledru 45030f6970 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato
This new version of clang 17 also slightly changed the formatting.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D215914
2024-07-17 11:15:31 +00:00
Paul Adenot 394c76bcc7 Bug 1907386 - Use T2S utility macro for both Darwin and Windows and both unsigned long and long. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D216779
2024-07-17 07:02:15 +00:00
Paul Adenot 0e5d229536 Bug 1907386 - Fix the build on iOS and Windows 32-bits. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D216564
2024-07-16 09:14:55 +00:00
Paul Adenot 95993b8775 Bug 1905399 - Hand hold GCC into understanding the types are of the same signedness statically. CLOSED TREE 2024-07-12 10:52:56 +02:00
Paul Adenot dd05f47242 Bug 1905399 - Introduce SaturatedCast<>. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D215779
2024-07-12 07:58:26 +00:00
Paul Adenot f25f7cec8a Bug 1906648 - Print why an AssertedCast failed when in debug. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D216048
2024-07-11 15:52:31 +00:00
Stanca Serban b6e99ec404 Backed out changeset c5a03d45831a (bug 1906648) for causing multiple build bustages. CLOSED TREE 2024-07-10 15:31:15 +03:00
Paul Adenot 1a12070dbc Bug 1906648 - Print why an AssertedCast failed when in debug. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D216048
2024-07-10 11:44:29 +00:00
Jan de Mooij 431960e0a8 Bug 1905117 part 5 - Use JS string arena for StringBuffers allocated in SpiderMonkey. r=sfink,emilio
This avoids some regressions on a few Speedometer 3 (async) sub tests.

The problem is likely more jemalloc lock contention during GC when using the
main malloc heap. Using SpiderMonkey's string buffer arena avoids that and
matches previous behavior better.

Differential Revision: https://phabricator.services.mozilla.com/D215522
2024-07-09 12:15:50 +00:00
Jan de Mooij cc94f1f305 Bug 1905117 part 4 - Allocate a StringBuffer in AllocChars for longer strings. r=sfink
If there are more than 500 bytes of string data, use a `StringBuffer` instead of raw malloc.
This helps avoid memory usage regressions because for shorter strings `StringBuffer` has
relatively more overhead.

Differential Revision: https://phabricator.services.mozilla.com/D215211
2024-07-09 12:15:49 +00:00
Jan de Mooij d50f648d3e Bug 1903037 part 1 - Support leak checking in MFBT code when included in SpiderMonkey. r=mccr8,glandium
`mozilla::StringBuffer` uses `RefCountLogger`, but this was a no-op when included in
SpiderMonkey code (`MOZILLA_INTERNAL_API` is not defined in that case). This resulted
in leakcheck failures when string buffers are used directly in SpiderMonkey.

This patch changes the calls to `NS_LogAddRef` and `NS_LogRelease` to go through a
function pointer. This also makes it possible to use a different implementation in
SpiderMonkey shell builds if we ever want to.

Differential Revision: https://phabricator.services.mozilla.com/D213968
2024-06-26 11:03:16 +00:00
Paul Bone 9374059263 Bug 1874022 - pt 9. Reduce the cost of updating sAllocDelay r=glandium
This change optimises the PHC hot path by reducing updates to sAllocDelay
and sNow:
 * tlsAllocDelay has been created to create thread-local allocation delays,
   when they expire then the shared sAllocDelay is checked.
 * sNow is updated only when not executing the fast path.

This change also:
 * Previously the thread that saw sAllocDelay == 0 would be the one to make
   the allocation, the ReleaseAquire semantics ensured that exactly one
   thread would see this.  Now all threads that see sAllocDelay <= 0 will
   attempt a PHC allocation, this is later checked by atomically resetting
   sAllocDelay.
 * Removes the logic that checks if the delay has wrapped
   while PHC was disabled on the current thread.  This isn't needed anymore
   because we now make PHC allocations for all sAllocDelay < 0, assuming
   that threads are disabled for less than UINT32_MAX/2 allocations.
 * Moves ShouldMakeNewAllocations out of the hot-path.

Differential Revision: https://phabricator.services.mozilla.com/D206469
2024-06-26 02:06:39 +00:00
Stanca Serban 7baceb68d7 Backed out 4 changesets (bug 1903037) for causing build bustages. CLOSED TREE
Backed out changeset 0d0174720ea5 (bug 1903037)
Backed out changeset 83b91e964b76 (bug 1903037)
Backed out changeset 2bce31088d18 (bug 1903037)
Backed out changeset cef762ba8c2c (bug 1903037)
2024-06-25 18:33:38 +03:00
Jan de Mooij d3f31e4b5b Bug 1903037 part 1 - Support leak checking in MFBT code when included in SpiderMonkey. r=mccr8,glandium
`mozilla::StringBuffer` uses `RefCountLogger`, but this was a no-op when included in
SpiderMonkey code (`MOZILLA_INTERNAL_API` is not defined in that case). This resulted
in leakcheck failures when string buffers are used directly in SpiderMonkey.

This patch changes the calls to `NS_LogAddRef` and `NS_LogRelease` to go through a
function pointer. This also makes it possible to use a different implementation in
SpiderMonkey shell builds if we ever want to.

Differential Revision: https://phabricator.services.mozilla.com/D213968
2024-06-25 11:37:03 +00:00
Paul Bone 35c668e19e Bug 1903966 - Skip part of TestPoisonArea on Apple Silicon r=glandium
Apple Silicon doesn't support W+X pages so this part of the test can't run.

Differential Revision: https://phabricator.services.mozilla.com/D214497
2024-06-25 04:42:52 +00:00
Jan de Mooij d832c58019 Bug 1899160 part 1 - Add support for allocating JS strings with a refcounted StringBuffer. r=sfink
This adds initial support for JS strings that have a refcounted `mozilla::StringBuffer`
instead of a raw `malloc` buffer.

The `newString` testing function has two new options. This lets us allocate a new JS string
with a new buffer or a new JS string that reuses the underlying string buffer.

After this we can start using this to replace external strings. We can also allocate more JS
strings with `StringBuffer`s instead of raw `malloc` buffers.

Differential Revision: https://phabricator.services.mozilla.com/D212110
2024-06-24 07:41:48 +00:00
serge-sans-paille c7d66816f8 Bug 1896414 - Move MOZ_ASAN checks from old.configure to moz.configure r=glandium,geckoview-reviewers,m_kato
Also improve detection of runtime libraries as a side effect.

Differential Revision: https://phabricator.services.mozilla.com/D210196
2024-06-18 14:44:40 +00:00
Iulian Moraru 5944e49dc4 Backed out 3 changesets (bug 1900540, bug 1896414) for causing Gtest failures.
Backed out changeset b1e69d42bb91 (bug 1896414)
Backed out changeset 2740e0cb1ac8 (bug 1896414)
Backed out changeset 073d686a1233 (bug 1900540)
2024-06-11 22:40:58 +03:00
Otto Länd 4315797173 Bug 1896414, 1900540: apply code formatting via Lando
# ignore-this-changeset
2024-06-11 07:31:53 +00:00
serge-sans-paille b7e36e86e2 Bug 1896414 - Move MOZ_ASAN checks from old.configure to moz.configure r=glandium
Also improve detection of runtime libraries as a side effect.

Differential Revision: https://phabricator.services.mozilla.com/D210196
2024-06-11 06:38:28 +00:00
Emilio Cobos Álvarez 57ebb944de Bug 1897752 - Make EnumeratedArray constructor constexpr.
MANUAL PUSH: Trivial base toolchains fix CLOSED TREE.
2024-05-20 19:08:32 +02:00
serge-sans-paille ae07881baa Bug 1883940 - Replace MOZ_CXX11 autoconf macro by a moz.configure check r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D203781
2024-05-18 07:10:57 +00:00
Emilio Cobos Álvarez d55796be17 Bug 1892257 - Move nsStringBuffer to mfbt. r=nika,xpcom-reviewers,glandium
Inline Create() and Realloc() so that we don't get negative leaks, since
were that code end up in mozglue, it wouldn't have access to the logging
machinery.

Differential Revision: https://phabricator.services.mozilla.com/D209663
2024-05-14 14:24:26 +00:00
Andreas Pehrson 5ec78bee07 Bug 1404972 - To Result add operator==. r=glandium
This is needed for using Result with gtest matchers.

Differential Revision: https://phabricator.services.mozilla.com/D205958
2024-05-06 19:54:00 +00:00
Stanca Serban 614498681a Backed out 35 changesets (bug 1404972) for causing cppunit assertion failures in mozilla/Result.h. CLOSED TREE
Backed out changeset 703bcdb5aed1 (bug 1404972)
Backed out changeset 43134f8cd283 (bug 1404972)
Backed out changeset abcec791bf5f (bug 1404972)
Backed out changeset 02b7f8ee802c (bug 1404972)
Backed out changeset dacf1411a3d9 (bug 1404972)
Backed out changeset 15136efd0662 (bug 1404972)
Backed out changeset f1cd90f5d1b6 (bug 1404972)
Backed out changeset 3143c92d0e2e (bug 1404972)
Backed out changeset 257f310d5c8e (bug 1404972)
Backed out changeset ab73b50399ef (bug 1404972)
Backed out changeset a63110e6bf55 (bug 1404972)
Backed out changeset 346a34408207 (bug 1404972)
Backed out changeset bc211f44281f (bug 1404972)
Backed out changeset 9be7b1767e46 (bug 1404972)
Backed out changeset 48832f645357 (bug 1404972)
Backed out changeset 57e38c2622bf (bug 1404972)
Backed out changeset 20a15e46829b (bug 1404972)
Backed out changeset 4a148ddfc1cd (bug 1404972)
Backed out changeset 9de637c307ad (bug 1404972)
Backed out changeset 6f3aebf42327 (bug 1404972)
Backed out changeset de46ffac7541 (bug 1404972)
Backed out changeset 2e038afae950 (bug 1404972)
Backed out changeset 63765ab9e647 (bug 1404972)
Backed out changeset 152a456a7af1 (bug 1404972)
Backed out changeset 0824e75bd26c (bug 1404972)
Backed out changeset c6462cae6c8b (bug 1404972)
Backed out changeset bd41873e1f03 (bug 1404972)
Backed out changeset 9595c4451fc1 (bug 1404972)
Backed out changeset 23d0f7682a5f (bug 1404972)
Backed out changeset 08c9467086bf (bug 1404972)
Backed out changeset ea7779289030 (bug 1404972)
Backed out changeset 8cf8b6f1a41e (bug 1404972)
Backed out changeset c3538c05fb0c (bug 1404972)
Backed out changeset 0128d95e64ef (bug 1404972)
Backed out changeset ed2fdc7b602d (bug 1404972)
2024-05-06 19:21:08 +03:00
Andreas Pehrson bf1f2dc239 Bug 1404972 - To Result add operator==. r=glandium
This is needed for using Result with gtest matchers.

Differential Revision: https://phabricator.services.mozilla.com/D205958
2024-05-06 13:50:19 +00:00
Chris Peterson 2d846b7c8c Bug 1894147 - Fix C++20 std::memory_order build errors in MPSCQueue.h. r=xpcom-reviewers,emilio
C++20 renamed the `std::memory_order::memory_order_*` enum constants to `std::memory_order::*`.

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

C++17 supports:

`std::memory_order_relaxed`
`std::memory_order::memory_order_relaxed`

But C++20 supports:

`std::memory_order_relaxed`
`std::memory_order::memory_order::relaxed`

Thus, `std::memory_order_relaxed` is the only shared name if we want to support compiling Firefox with -std=c++17 and -std=c++20 as we transition mozilla-central from C++17 to C++20.

Differential Revision: https://phabricator.services.mozilla.com/D208963
2024-04-30 15:37:35 +00:00
Jeff Muizelaar 26ccb2231c Bug 1893567 - Add MOZ_NOMERGE to Window MOZ_REALLY_CRASH implementation. r=gsvelto
This makes it so the work from bug 1814600 also applies to Windows.

Differential Revision: https://phabricator.services.mozilla.com/D208696
2024-04-26 12:40:46 +00:00
Alexandre Lissy 6b04b6b558 Bug 1893432 - Introduce mfbt/MPSCQueue r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D207730
2024-04-25 13:33:32 +00:00
Sylvestre Ledru 21f973ed5c Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,media-playback-reviewers,padenot
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D207867
2024-04-22 16:00:09 +00:00
Chris Peterson d55c7573ed Bug 1891332 - Replace debug MOZ_ASSERT with MOZ_RELEASE_ASSERT in MFBT tests. r=xpcom-reviewers,emilio
MOZ_ASSERT is only checked in debug builds, so release builds' tests are not checking these assertions.

Depends on D207373

Differential Revision: https://phabricator.services.mozilla.com/D207374
2024-04-17 03:26:29 +00:00
Emilio Cobos Álvarez 6d4e823315 Bug 1891497 - Add mozilla::Span constructor for EnumeratedArray. r=glandium
Just like the mozilla::Array/std::array ones.

Differential Revision: https://phabricator.services.mozilla.com/D207389
2024-04-15 21:17:51 +00:00
Greg Stoll fd333e0175 Bug 1875481 - Part 1: move MOZ_CAN_RUN_SCRIPT_BOUNDARY_LAMBDA into a shared header r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D200977
2024-04-10 00:15:46 +00:00
Stanca Serban 9879879814 Backed out 3 changesets (bug 1875481) for basicWindowDotPrintTest related junit failures.
Backed out changeset cd024cb2768e (bug 1875481)
Backed out changeset 6b7be15cd017 (bug 1875481)
Backed out changeset d1da53c0673b (bug 1875481)
2024-04-09 05:56:47 +03:00
Greg Stoll af5a5d87e5 Bug 1875481 - Part 1: move MOZ_CAN_RUN_SCRIPT_BOUNDARY_LAMBDA into a shared header r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D200977
2024-04-08 23:53:58 +00:00
Chris Peterson ece3226100 Bug 1880917 - Remove pragmas disabling -Wc++2a-compat warnings in mfbt and xpcom. r=xpcom-reviewers,glandium
Now that -Wc++2a-compat is no longer enabled (bug 1887580), we don't need these pragmas disabling -Wc++2a-compat warnings about u8"" string literals' type changing from const char[] in C++17 to const char8_t[] in C++20.

Differential Revision: https://phabricator.services.mozilla.com/D206742
2024-04-08 20:03:24 +00:00