1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 05:46:58 +00:00

50 Commits

Author SHA1 Message Date
Moonchild 8bc63bffbc [MFBT] Reduce size() calls in subspan. 2026-02-27 07:00:21 +08:00
Moonchild 0dbad452e6 Issue #2895 - Implement 32-bit compatible Xoroshiro128++
This puts in a reduced-register version of Xoroshiro128++ which /just/
fits in our x86 7-register space by making use of an extra mState to
temporarily store the result to be passed back.

Resolves #2895
2026-01-27 19:54:38 +08:00
Moonchild d4341ea07a Issue #2895 - Part 1: Replace XorShift128+ with Xoroshiro128++
Surrounding structures remain the same because the bit width remains 128.
The more complicated algorithm requires more temp registers in LRandom
to account for intermediate result placeholders in the JITed version of
this algorithm.
2026-01-13 23:49:11 +08:00
Moonchild 7af71cb345 Issue #1843 - Clean up WindowsVersion.h
This gets rid of all the unnecessary named functions to be replaced with
a straightforward check `IsWindows10BuildOrLater(WinBuild::{build})`
Where `WinBuild` is an enum with common `{build}` names of Win 10+
versions: `Win10v1809`, `Win10v21H2`, `Win11RTM`, `Win11v24H2`, etc.

None of these named functions were actually in use, so no other changes
should be necessary in the platform.
2025-08-14 08:35:44 +08:00
trav90 497b6d5854 Issue #2749 - Part 8 - Put mfbt/casting.h pragmas behind GCC conditional. 2025-05-27 23:21:47 +08:00
trav90 fc9643a1a7 Issue #2749 - Part 6 - Teach mfbt/casting.h to deal with floating point values
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.
2025-05-27 23:21:26 +08:00
Moonchild f1c456c625 Issue #2713 - Check for NaN before std::min/max() in DOMQuad and DOMRect.
If there is a NaN involved we should not return 0 here.
2025-03-23 12:52:03 +08:00
Moonchild 1f4152a5ac Issue #2472 - Part 2: Add FunctionRef callable type
Prerequisite for top layer refactor.

FunctionRef is a generic callable type that can be initialized from any
compatible callable, suitable for use as a function argument for the duration of
the function call (and no longer).
2024-05-08 09:53:29 +08:00
Moonchild e6e8224040 [MFBT] Make move assignment of RefPtr have the same behavior as nsCOMPtr 2024-03-21 15:24:10 +08:00
Brian Smith d42d5ce138 Issue #1240 - Part 3b - Implement WrappingOperations.h for wraparound math operations & conversions. https://bugzilla.mozilla.org/show_bug.cgi?id=1441657 Implement mozilla::WrappingMultiply. Prerequisite for our V8 fast forward. 2023-07-25 09:08:56 +08:00
Brian Smith ddd49121a6 Issue #1240 - Part 3a - Adjust mozilla::FloatingPoint<T>'s definition. So only the barest details are specified for floating-point encodings, with every other number, bit mask, &c. mathematically derived. Also add a bunch of documentation comments. https://bugzilla.mozilla.org/show_bug.cgi?id=1508725 Prerequisite for our V8 fast forward. 2023-07-25 09:08:39 +08:00
Brian Smith 323007ec3d Issue #2255 - Fix build bustage on Linux. Need #include <utility> to ensure std::forward is available. 2023-07-14 10:20:10 +08:00
Brian Smith efde4d468e Issue #2255 - Add support for Maybe<T&> https://bugzilla.mozilla.org/show_bug.cgi?id=1620568 Make Maybe<T>::emplace() work when T is const https://bugzilla.mozilla.org/show_bug.cgi?id=1335780 2023-07-14 10:16:53 +08:00
Brian Smith 2c0384c4a2 Issue #2255 & #1240 - Simplify and enhance Maybe and Some(). https://bugzilla.mozilla.org/show_bug.cgi?id=1325351 This is a prerequisite for our BigInt V8 fast forward and potential #2255 fix. 2023-07-06 10:24:34 +08:00
Moonchild f9c39acaa6 Issue #1656 - Follow-up: Re-nuke the vim lines introduced in #2265 2023-07-03 15:12:01 +08:00
Martok 4c2e378613 Issue #2259 - Add mozilla::Result<V, E> and JS::Result<> for fallible return values
Based-on: m-c 1283562, 1277368/1, 1324828
2023-07-03 15:03:29 +08:00
Martok 9914c06168 Issue #2259 - Add mozilla::Vector -> mozilla::Span implicit conversion
Based-on: part of m-c 1578339
2023-07-03 15:03:08 +08:00
Martok 7716602a20 Issue #2259 - Add missing IsAscii* helper functions in mozilla/TextUtils.h 2023-07-03 15:02:50 +08:00
Job Bautista 621868a340 Issue #2241 - Part 2: Add SameValueZero implementation to mfbt/FloatingPoint.h
Backported from Mozilla bug 1560658.

This is to prevent duplication of code while implementing DOMMatrix operations.
2023-05-15 09:09:58 +08:00
FranklinDM 481069044d Issue #2148 - Shrink Vector from (usually) four pointers in size to three when no inline storage is used.
See Bug 1338374
2023-03-15 22:50:56 +08:00
FranklinDM 0365f940fe Issue #2148 - Make Vector not use AlignedStorage for its inline element storage
See Bug 1338374 1/2
2023-03-15 22:50:40 +08:00
roytam1 cba4f41ffa mfbt: fixup after rev 13fcc4a0 2022-05-04 11:43:38 +08:00
Brian Smith 13fcc4a046 Issue #1829 - Revert "Issue #1751" 2022-05-04 09:40:24 +08:00
Moonchild d4eac725fd Issue #1877 - Resolve RELEASE_OR_BETA conditionals. 2022-04-21 21:46:47 +08:00
Moonchild daa57bddf7 [MFBT] Convert debug asserts to early returns for situations that should
never occur.
2021-08-12 23:48:11 +08:00
Moonchild 6c30b33915 [no issue] Replace PurpleBlock with SegmentedVector to reduce indirect memory
accesses when calling suspect

Improves overall memory performance.
Also prerequisite for further work on #1677.
2021-07-28 10:10:07 +08:00
Moonchild 63637d3f81 [MFBT] Update lz4 to 1.9.3 2021-02-25 09:26:54 +08:00
Matt A. Tobin 86402bf7e9 Bug 1466909 - Use AddLvalueReference for UniquePtr's operator*().
This is required for UniquePtr to accept <void>,
which is required for PseudoHandle = mozilla::UniquePtr<T, JS::FreePolicy>;
in turn for mozilla::SegmentedVector<PseudoHandle<void>> uniquePtrArena_;

Tag #1679
2020-11-13 09:15:18 +08:00
Moonchild d5919942ff Issue #1656 - Part 8: Devtools and misc. 2020-09-25 22:06:55 +08:00
Moonchild 0cd673d720 Issue #1656 - Part 6: Clean up the build files 2020-09-25 22:04:23 +08:00
Moonchild 538b420319 Issue #1656 - Part 4: Manual cleanup 2020-09-25 22:04:20 +08:00
Moonchild ed7e49eda6 Issue #1656 - Part 2: Unmangle some unfortunate UTF-8 victims.
The poor fellows got lost in an ASCII-interpretation of the world.
2020-09-25 22:04:14 +08:00
Moonchild 8c395520d9 Issue #1656 - Part 1: Nuke most vim config lines in the tree.
Since these are just interpreted comments, there's 0 impact on actual code.
This removes all lines that match /* vim: set(.*)tw=80: */ with S&R -- there are
a few others scattered around which will be removed manually in a second part.
2020-09-25 22:04:12 +08:00
Matt A. Tobin bf056898b5 Issue #1053 - Remove android support from mfbt 2020-02-27 07:31:22 +08:00
wolfbeast da2e08390c Issue #1288 - Part 2: Add a partial LZ4 decompression routine.
This function never writes beyond `aDest` + `aMaxOutputSize`, and is
therefore protexted against malicious datapackets.
It also ignores unconsumed input upon reaching `aMaxOutputSize` and can
therefore be used for parial decompression of LZ4 input up to a desired
resulting size of decompressed data.
2019-11-15 14:23:57 +08:00
athenian200 b652dd59ae MoonchildProductions#1251 - Part 7: All the posix_m* memory-related stuff, gathered together.
https://bugzilla.mozilla.org/show_bug.cgi?id=1158445
https://bugzilla.mozilla.org/show_bug.cgi?id=963983
https://bugzilla.mozilla.org/show_bug.cgi?id=1542758

Solaris madvise and malign don't perfectly map to their POSIX counterparts, and some Linux versions (especially Android) don't define the POSIX counterparts at all, so options are limited. Ideally posix_madvise and posix_malign should be the safer and more portable options for all platforms.
2019-11-04 11:52:22 +08:00
wolfbeast a4dd5cc088 Use ptrdiff_t in RangedPtr. 2019-03-23 06:45:34 +08:00
trav90 48b18a815d Fix Span.h constexprs for VS2017 2019-02-16 00:15:22 +08:00
trav90 037afae5e6 Add mozilla::Span 2019-02-16 00:15:21 +08:00
trav90 c8cdcbc5a7 Fix a warning with GCC 8: unnecessary parentheses in declaration of 'type name' 2019-02-16 00:11:02 +08:00
trav90 d8a8aafc2c Initialize mVersion to silence a warning with GCC 8 2019-02-16 00:10:57 +08:00
Alex Gaynor 57b3983e17 Bug 1462912 - Fixed BufferList::Extract to handle the case where the call consumes the entirety of the BufferList. r=froydnj, a=RyanVM 2019-02-16 00:06:52 +08:00
Alex Gaynor 921ff8f640 Bug 1456189 - Simplify BufferList::Extract to make the lifetimes clearer. r=froydnj, a=RyanVM 2019-02-16 00:06:50 +08:00
Jeff Walden 48ffdb584c Bug 1452619 - Implement mozilla::IsAsciiAlpha. r=froydnj, a=lizzard 2019-02-15 23:53:19 +08:00
Ryan VanderMeulen 23c2b750e3 Bug 1398021 - Update lz4 to version 1.8.0. r=froydnj, a=RyanVM
--HG--
extra : source : 9a4077eda5d80e2f7c7fe271035bee2e2d034cec
extra : histedit_source : 64eb1f6e9b2b08981644d7edccd22997d6463b4b%2C5619daf512a89b3a6bf84eca781190b56e8dea31
2019-02-15 23:37:09 +08:00
trav90 4a350f434e Add MOZ_FALLTHROUGH macro definition for gcc 7 to suppress -Wimplicit-fallthrough warnings
The generic fallback MOZ_FALLTHROUGH definition is insufficient for GCC 7 and above, resulting in build warning spam and --enable-warnings-as-errors builds failing. The check for clang support is changed to use the __has_cpp_attribute macro, which is more robust than checking the __cplusplus version. Also, MOZ_FALLTHROUGH is now only defined in C++ code, since GCC errors out if it encounters a scoped attribute being used with __has_cpp_attribute in C code. No C code uses MOZ_FALLTHROUGH or derivatives at the moment.
2019-02-15 23:35:47 +08:00
wolfbeast 2a9f2dadee Fix off-by-one in Vector::insert. 2019-02-15 23:29:37 +08:00
trav90 7d96c33414 Remove checks for GCC < 4.9 2019-02-15 23:28:59 +08:00
trav90 1eecf39f2b Require at least GCC 4.9 to build 2019-02-15 23:28:57 +08:00
roytam1 dcd9973243 import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo 2018-01-19 03:59:58 +08:00