Simon Giesecke
8804eb9be3
Bug 1666416 - Allow conversion from Result with convertible error type. r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D90960
2020-09-22 11:24:08 +00:00
Simon Giesecke
ccdc97d011
Bug 1666422 - Add missing include for cstdint. r=sylvestre
...
Differential Revision: https://phabricator.services.mozilla.com/D90963
2020-09-22 08:52:51 +00:00
Simon Giesecke
32f7547296
Bug 1666200 - Support in-place construction of Result success value. r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D90839
2020-09-21 13:15:13 +00:00
Simon Giesecke
2b1eb28b6a
Bug 1665927
- Use free LSB optimization for empty types with mozilla::Result. r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D90699
2020-09-21 13:14:53 +00:00
Simon Giesecke
c8ed33ab9d
Bug 1665850 - Remove specifics for reference error types from mozilla::Result. r=emilio,jandem
...
Also update the documentation on optimizations and representation to
better reflect the current situation.
Differential Revision: https://phabricator.services.mozilla.com/D90662
2020-09-21 13:14:28 +00:00
Simon Giesecke
eaa00050e4
Bug 1665850 - Switch JS to use non-reference errors with mozilla::Result. r=jandem
...
Also switch optimizations for HasFreeLSB and existing tests to no longer
use references.
Differential Revision: https://phabricator.services.mozilla.com/D90661
2020-09-21 13:14:10 +00:00
Simon Giesecke
2e065c64d6
Bug 1665614 - Make mozilla::Result work with non-copyable/non-param error types. r=emilio,jandem
...
Among other things, there were some misuses of std::forward, and
GenericErrorResult was (presumably accidentally) instatiated with
references as the template argument type, e.g. const nsresult&,
which circumvented the check for not calling it with NS_OK in
ResultExtensions.h
Differential Revision: https://phabricator.services.mozilla.com/D90561
2020-09-21 13:12:48 +00:00
Bogdan Tara
395ecea593
Backed out changeset a1e4531f2091 (bug 1666200) for TestResult.cpp related bustage CLOSED TREE
2020-09-21 15:55:42 +03:00
Simon Giesecke
2cf66d3f89
Bug 1666200 - Support in-place construction of Result success value. r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D90839
2020-09-21 11:47:47 +00:00
Butkovits Atila
270e7e2200
Backed out 5 changesets (bug 1665927
, bug 1665614, bug 1665850) for causing bustage on Result.h. CLOSED TREE
...
Backed out changeset 1467e76399e8 (bug 1665927
)
Backed out changeset ebd4dfbc0a88 (bug 1665850)
Backed out changeset 5e23340e3b39 (bug 1665850)
Backed out changeset 5bc547e7a773 (bug 1665850)
Backed out changeset 8d88afb85a78 (bug 1665614)
2020-09-21 15:25:16 +03:00
Simon Giesecke
6b3d1793e7
Bug 1665927
- Use free LSB optimization for empty types with mozilla::Result. r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D90699
2020-09-21 11:09:31 +00:00
Simon Giesecke
f193981fb7
Bug 1665850 - Remove specifics for reference error types from mozilla::Result. r=emilio,jandem
...
Also update the documentation on optimizations and representation to
better reflect the current situation.
Differential Revision: https://phabricator.services.mozilla.com/D90662
2020-09-21 11:09:09 +00:00
Simon Giesecke
70bda1ef61
Bug 1665850 - Switch JS to use non-reference errors with mozilla::Result. r=jandem
...
Also switch optimizations for HasFreeLSB and existing tests to no longer
use references.
Differential Revision: https://phabricator.services.mozilla.com/D90661
2020-09-21 11:11:02 +00:00
Simon Giesecke
3b0420646e
Bug 1665614 - Make mozilla::Result work with non-copyable/non-param error types. r=emilio,jandem
...
Among other things, there were some misuses of std::forward, and
GenericErrorResult was (presumably accidentally) instatiated with
references as the template argument type, e.g. const nsresult&,
which circumvented the check for not calling it with NS_OK in
ResultExtensions.h
Differential Revision: https://phabricator.services.mozilla.com/D90561
2020-09-21 10:38:19 +00:00
Simon Giesecke
0fef58f699
Bug 1664844 - Add DebugOnly::inspect member function. r=jwalden
...
Differential Revision: https://phabricator.services.mozilla.com/D90133
2020-09-18 06:33:12 +00:00
Csoregi Natalia
2306d2079a
Backed out 11 changesets (bug 1663924, bug 1664844) for multiple failures. CLOSED TREE
...
Backed out changeset 2da9fde7a109 (bug 1663924)
Backed out changeset 9353759cc783 (bug 1663924)
Backed out changeset 309354891d60 (bug 1663924)
Backed out changeset 4e51461c369c (bug 1663924)
Backed out changeset e3196b68932c (bug 1663924)
Backed out changeset 25b16cbae152 (bug 1664844)
Backed out changeset e02961ac5ee7 (bug 1663924)
Backed out changeset dde2058c20ef (bug 1663924)
Backed out changeset a80f52551e3a (bug 1663924)
Backed out changeset 0c37ce712c2c (bug 1663924)
Backed out changeset 8cc5dcc86f40 (bug 1663924)
2020-09-18 04:52:32 +03:00
Simon Giesecke
db717b00e5
Bug 1664844 - Add DebugOnly::inspect member function. r=jwalden
...
Differential Revision: https://phabricator.services.mozilla.com/D90133
2020-09-17 08:44:30 +00:00
Simon Giesecke
59cd4601d7
Bug 1663902 - Avoid gcc emitting lots of static constructors for UnusedZero<T&>::defaultValue. r=dmajor
...
Differential Revision: https://phabricator.services.mozilla.com/D90359
2020-09-16 13:58:49 +00:00
Razvan Maries
559e163f24
Backed out 9 changesets (bug 1663924, bug 1664844) for Linux Mochitests leaks. CLOSED TREE
...
Backed out changeset 8d28611ac9b2 (bug 1663924)
Backed out changeset e0b0b3a19544 (bug 1663924)
Backed out changeset 884e286909f9 (bug 1663924)
Backed out changeset ffed28f0b547 (bug 1664844)
Backed out changeset 4c22c3c8aa28 (bug 1663924)
Backed out changeset fcaed021597c (bug 1663924)
Backed out changeset 30394cbcaaf6 (bug 1663924)
Backed out changeset 014bcf5d13b9 (bug 1663924)
Backed out changeset ccf09dfa817a (bug 1663924)
2020-09-16 19:16:21 +03:00
Simon Giesecke
ab0b7510ad
Bug 1665026 - Prevent ToResultInvoke from being instantiated with a raw pointer result type. r=janv
...
Differential Revision: https://phabricator.services.mozilla.com/D90264
2020-09-16 15:11:56 +00:00
Simon Giesecke
7c10b87921
Bug 1664844 - Add DebugOnly::inspect member function. r=jwalden
...
Differential Revision: https://phabricator.services.mozilla.com/D90133
2020-09-16 14:56:02 +00:00
Simon Giesecke
720fbb0265
Bug 1661404 - Add MOZ_TO_RESULT_INVOKE_TYPED macro. r=janv
...
Differential Revision: https://phabricator.services.mozilla.com/D90368
2020-09-16 10:18:19 +00:00
Gerald Squelart
b3972fb3c4
Bug 1657033 - There is no more need for JSONWriteFunc::WriteLiteral - r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D86193
2020-09-14 01:48:39 +00:00
Gerald Squelart
782cf5d3ad
Bug 1657033 - Use Span<const char> in JSONWriter - r=froydnj
...
In most situations, JSONWriter users already know string lengths (either directly, or through `nsCString` and friends), so we should keep this information through JSONWriter and not recompute it again.
This also allows using JSONWriter with sub-strings (e.g., from a bigger buffer), without having to create null-terminated strings.
Public JSONWriter functions have overloads that accept literal strings.
Differential Revision: https://phabricator.services.mozilla.com/D86192
2020-09-14 02:33:20 +00:00
Gerald Squelart
89b62c22de
Bug 1657033 - Make `MakeStringSpan` constexpr - r=froydnj
...
MakeStringSpan("...") will be able to construct spans from string literals at compile time.
Differential Revision: https://phabricator.services.mozilla.com/D86190
2020-09-14 01:44:39 +00:00
Simon Giesecke
250dabd821
Bug 1663628 - Make Maybe::extract work with MOZ_NON_AUTOABLE type T. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D89445
2020-09-08 13:22:16 +00:00
Jan Varga
d4d58eddc9
Bug 1663648 - Fix mozilla::Result::map's return type definition; r=dom-workers-and-storage-reviewers,sg
...
Differential Revision: https://phabricator.services.mozilla.com/D89457
2020-09-08 14:39:41 +00:00
Simon Giesecke
2d21df0e59
Bug 1661428 - Support PackingVariant::NullIsOk also with non-trivially-default-constructible V. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D88444
2020-09-03 14:14:41 +00:00
Simon Giesecke
d85bd68479
Bug 1661457 - Add in-place constructor to CompactPair. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D88418
2020-09-02 17:56:35 +00:00
Simon Giesecke
5cacc3e1dc
Bug 1661502 - Make Result move-only. r=froydnj,jandem
...
Differential Revision: https://phabricator.services.mozilla.com/D88443
2020-09-02 17:56:23 +00:00
Simon Giesecke
bf7bd90871
Bug 1661497 - Make DebugOnly work with move-only value types. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D88442
2020-09-02 17:56:10 +00:00
Simon Giesecke
bd28698eb3
Bug 1661428 - Use CompactPair instead of Variant for trivially default-constructible V and UnusedZero E. r=froydnj
...
It seems that the clang toolchain has trouble optimizing away the tag access in
a `mozilla::Variant`. Use of a `CompactPair` seems to be better when `E` is
small (all cases where `UnusedZero<E>` is true are small right now anyway).
While this doesn't change `sizeof(Result<V, E>)` in most cases, it makes
the generated code simpler/smaller: As of now, this reduce the overall VM size
of libxul.so by ca. 59K.
Without additional effort, this requires and leads to default-construction of
a `V` even in cases where it is never accessed, so this is restricted to
trivially default-constructible `V` for now.
This could be avoided by replacing `CompactPair<V, E>` by
`CompactPair<AlignedStorage2<V>, E>`.
Differential Revision: https://phabricator.services.mozilla.com/D88393
2020-09-02 17:55:55 +00:00
Razvan Maries
eae150a880
Backed out 5 changesets (bug 1661457, bug 1661428, bug 1661497, bug 1661502) for build bustages on Result.h. CLOSED TREE
...
Backed out changeset fbf42b3b51f3 (bug 1661428)
Backed out changeset 83f3f36d540f (bug 1661457)
Backed out changeset 8a9dce0d08ce (bug 1661502)
Backed out changeset 733df139089a (bug 1661497)
Backed out changeset fca770fc0956 (bug 1661428)
2020-09-02 19:44:47 +03:00
Simon Giesecke
261cda7f20
Bug 1661428 - Support PackingVariant::NullIsOk also with non-trivially-default-constructible V. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D88444
2020-09-02 16:31:43 +00:00
Simon Giesecke
156682b3c2
Bug 1661457 - Add in-place constructor to CompactPair. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D88418
2020-09-02 16:23:13 +00:00
Simon Giesecke
d4179392a0
Bug 1661502 - Make Result move-only. r=froydnj,jandem
...
Differential Revision: https://phabricator.services.mozilla.com/D88443
2020-09-02 16:23:01 +00:00
Simon Giesecke
80d380f0ed
Bug 1661497 - Make DebugOnly work with move-only value types. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D88442
2020-09-02 16:22:38 +00:00
Simon Giesecke
d5f6d76c5a
Bug 1661428 - Use CompactPair instead of Variant for trivially default-constructible V and UnusedZero E. r=froydnj
...
It seems that the clang toolchain has trouble optimizing away the tag access in
a `mozilla::Variant`. Use of a `CompactPair` seems to be better when `E` is
small (all cases where `UnusedZero<E>` is true are small right now anyway).
While this doesn't change `sizeof(Result<V, E>)` in most cases, it makes
the generated code simpler/smaller: As of now, this reduce the overall VM size
of libxul.so by ca. 59K.
Without additional effort, this requires and leads to default-construction of
a `V` even in cases where it is never accessed, so this is restricted to
trivially default-constructible `V` for now.
This could be avoided by replacing `CompactPair<V, E>` by
`CompactPair<AlignedStorage2<V>, E>`.
Differential Revision: https://phabricator.services.mozilla.com/D88393
2020-09-02 16:22:25 +00:00
Kartikaya Gupta
49c359630a
Bug 1661798 - Have the LinkedList destructor emit the buggy template specialization. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D88663
2020-08-28 20:07:26 +00:00
Simon Giesecke
1997b4ea0d
Bug 1661083 - Support raw pointers with MOZ_TO_RESULT_INVOKE. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D88168
2020-08-28 15:50:49 +00:00
Simon Giesecke
ff85972891
Bug 1661476 - Prevent Result<const V, E> or Result<V, const E> from being instantiated. r=froydnj
...
Also, remove the existing uses of Result<const nsCString, nsresult> in URLPreloader
and Result<CryptoScheme, const nsCString> in SampleIterator.
Differential Revision: https://phabricator.services.mozilla.com/D88419
2020-08-28 14:16:35 +00:00
Razvan Maries
7a010f17ae
Backed out 11 changesets (bug 1661083, bug 1661085, bug 1661084) for build bustages on ResultExtensions.h. CLOSED TREE
...
Backed out changeset 962967831dd4 (bug 1661085)
Backed out changeset 8e61a7d2daf9 (bug 1661085)
Backed out changeset 1edbc081c9f0 (bug 1661085)
Backed out changeset c640f4126079 (bug 1661085)
Backed out changeset b5fc9ebaac12 (bug 1661085)
Backed out changeset 4e3faaadccb6 (bug 1661085)
Backed out changeset 522cdd011e03 (bug 1661085)
Backed out changeset 896e47fc24e3 (bug 1661085)
Backed out changeset bf4043d4ce8e (bug 1661085)
Backed out changeset d0162bb5012e (bug 1661084)
Backed out changeset f0e7db520938 (bug 1661083)
2020-08-28 16:27:58 +03:00
Simon Giesecke
a7f224accb
Bug 1661083 - Support raw pointers with MOZ_TO_RESULT_INVOKE. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D88168
2020-08-28 10:02:36 +00:00
Jan Varga
ecaff7daea
Bug 1659673 - Add the `mozilla::Result::orElse` method; r=froydnj,dom-workers-and-storage-reviewers,sg
...
Differential Revision: https://phabricator.services.mozilla.com/D87418
2020-08-24 14:44:50 +00:00
Jan Varga
d749be0c59
Bug 1659660 - Improve documentation and testing for mozilla::Result::map and mozilla::Result::mapErr; r=froydnj,dom-workers-and-storage-reviewers,sg
...
Differential Revision: https://phabricator.services.mozilla.com/D87414
2020-08-20 11:04:12 +00:00
Butkovits Atila
850817430e
Backed out 3 changesets (bug 1658874, bug 1658324, bug 1659660) for bustage at ActorsParent.cpp. CLOSED TREE
...
Backed out changeset b69e256013a3 (bug 1659660)
Backed out changeset 4939692a9047 (bug 1658874)
Backed out changeset e27fb7cd29fe (bug 1658324)
2020-08-20 13:57:20 +03:00
Jan Varga
f66e9112b5
Bug 1659660 - Improve documentation and testing for mozilla::Result::map and mozilla::Result::mapErr; r=froydnj,dom-workers-and-storage-reviewers,sg
...
Differential Revision: https://phabricator.services.mozilla.com/D87414
2020-08-20 09:22:09 +00:00
Jeff Gilbert
0d33c47098
Bug 1656545 - Range cannot support nullptr with non-zero length. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D87528
2020-08-20 00:33:52 +00:00
Jan Varga
246bfa7db7
Bug 1659962 - Add additional MOZ_ARG_* macros; r=jwalden
...
Differential Revision: https://phabricator.services.mozilla.com/D87579
2020-08-19 14:31:40 +00:00
Jan Varga
8773058b99
Bug 1659909 - ToResultInvoke should also work with RefPtr/nsCOMPtr on win32; r=dom-workers-and-storage-reviewers,sg
...
Differential Revision: https://phabricator.services.mozilla.com/D87556
2020-08-19 14:34:06 +00:00