Commit Graph

1973 Commits

Author SHA1 Message Date
Nathan Froyd
5416a2fae6 Bug 1635359 - remove bounds checks on trivial span_iterator construction; r=sg
There's no need to provide the compiler a bunch of stuff that it's
trivially going to optimize away anyway, and we'd rather the release
assert not mess with the optimizer's view of the code.

Differential Revision: https://phabricator.services.mozilla.com/D77124
2020-05-28 11:17:42 +00:00
Nathan Froyd
9dcf479947 Bug 1635359 - provide a private constructor for span_iterator to bypass bounds checks; r=sg
The compiler is not always able to remove these (always-successful)
checks, so we might as well help it along.

Depends on D77122

Differential Revision: https://phabricator.services.mozilla.com/D77123
2020-05-28 10:05:38 +00:00
Nathan Froyd
1dc3de3520 Bug 1635359 - rename Span type parameter for span_iterator; r=sg
We're going to introduce some friend declarations in the next patch, and
this change makes doing so easier.  It's also slightly less confusing.

Depends on D77121

Differential Revision: https://phabricator.services.mozilla.com/D77122
2020-05-28 10:03:06 +00:00
Nathan Froyd
f747ca618f Bug 1635359 - remove release asserts for span_iterator {de,in}crement; r=sg
These are redundant with the checks that we already have for dereferencing.

Depends on D77120

Differential Revision: https://phabricator.services.mozilla.com/D77121
2020-05-28 09:56:06 +00:00
Nathan Froyd
9c05dc1217 Bug 1635359 - eliminate release assert in const span_iterator construction; r=sg
Differential Revision: https://phabricator.services.mozilla.com/D77120
2020-05-28 09:54:37 +00:00
Chris Fronk
dfcd4afc6e Bug 1433142 - Add support for hashing enum values. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D70647
2020-05-27 23:44:51 +00:00
Jon Bauman
c3c1e322ad Bug 1639637 - Add Maybe method to move out contents leaving Nothing() behind. r=froydnj
Add take() and extract() methods returning Maybe<T> and T respectively.

Differential Revision: https://phabricator.services.mozilla.com/D76526
2020-05-22 19:46:07 +00:00
Bob Owen
3dc49fb3d2 Bug 1639958 part 2: Add Buffer::AllocForOverwrite to fallibly create a default-initialized Buffer. r=froydnj
This also uses MakeUniqueForOverwrite* in two places where we immediately copy
over the Buffer from a Span.
Adds move assignment operator as well.

Differential Revision: https://phabricator.services.mozilla.com/D75510
2020-05-22 07:48:02 +00:00
Bob Owen
c7b447903d Bug 1639958 part 1: Add MakeUniqueForOverwrite and MakeUniqueForOverwriteFallible helpers. r=froydnj
These are the equivalent of std::make_unique_for_overwrite and std::make_unique_for_overwrite with fallible allocation.

Differential Revision: https://phabricator.services.mozilla.com/D75509
2020-05-22 07:22:28 +00:00
Chris Fronk
2f903c4542 Bug 1624495 - Support move only arguments such as UniquePtr in FunctionRef. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D68707
2020-05-21 01:56:57 +00:00
Simon Giesecke
2547c1a621 Bug 1637605 - Make ToResultInvoke work with stdcall functions on Windows. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D75938
2020-05-19 13:15:58 +00:00
Simon Giesecke
f5342d154a Bug 1637605 - Add support for polymorphic return values to ToResultInvoke. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D75294
2020-05-19 09:07:08 +00:00
Simon Giesecke
24e5290fb8 Bug 1637605 - Provide adapter from functions with R*/R& output parameter and nsresult return type to Result<R, nsresult> return type. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D75091
2020-05-19 08:25:54 +00:00
Simon Giesecke
f29e73f1c3 Bug 1637599 - Rephrase documentation referring to copies of errors. r=froydnj
The phrase "copy the error" is misleading, as the error type might not be
copyable, and it is never copied but moved. "Propagate" the error seems to
be a good term to describe this.

Differential Revision: https://phabricator.services.mozilla.com/D75093
2020-05-13 15:44:31 +00:00
Simon Giesecke
4a309d690e Bug 1637599 - Simplify propagation of error results. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D75090
2020-05-13 15:44:31 +00:00
Simon Giesecke
f07c441f41 Bug 1636114 - Add Span::AsConst method. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D74232
2020-05-11 09:27:40 +00:00
Chris Fronk
af8a02cc9d Bug 1512991 - Add JsonWriteFunc::Write to take string length. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D72560
2020-05-08 16:24:31 +00:00
Greg V
e65e9412b0 Bug 1634205 - Support Gecko Profiler and Base Profiler on FreeBSD r=mstange
- supports amd64 and arm64 (aarch64)
- uses LUL for stack walking

Differential Revision: https://phabricator.services.mozilla.com/D73162
2020-05-06 17:44:19 +00:00
Simon Giesecke
736ed67de5 Bug 1634003 - Add MovingNotNull class template. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D73032
2020-05-05 09:09:13 +00:00
Simon Giesecke
ddfa9fe2d2 Bug 1633719 - Make NotNull move its member pointer where possible. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D72827
2020-05-05 09:09:01 +00:00
Shishir Jaiswal
a285d5eb51 Bug 1629429 - Removing optional second argument in static_assert() r=sylvestre
The seconds argument for diagnostic message is optional from C++17

Differential Revision: https://phabricator.services.mozilla.com/D73556
2020-05-02 21:51:13 +00:00
Simon Giesecke
74b75d282b Bug 1634023 - Add deduction guides for Span. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D73040
2020-04-29 16:04:56 +00:00
Simon Giesecke
8f5212cd79 Bug 1634014 - Allow Span to be created from two Span iterators. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D73039
2020-04-29 15:20:50 +00:00
Simon Giesecke
2e99dc5200 Bug 1633809 - Suppress -Wpointer-bool-conversion in WrapNotNullUnchecked. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D73013
2020-04-29 14:04:09 +00:00
Andrew McCreight
1237ea289b Bug 1631274 - Make SegmentedVector::InfallibleAppend failures into OOM crashes. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D71581
2020-04-28 14:00:21 +00:00
Simon Giesecke
8f84ea1eaa Bug 1631709 - NotNull must not be movable. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71721
2020-04-28 11:23:05 +00:00
Simon Giesecke
46314aa8d2 Bug 1633350 - Add SplitAt method to mozilla::Span. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D72605
2020-04-27 11:16:30 +00:00
Simon Giesecke
e8a20bbe1c Bug 1633350 - Add deduction guide for constructing Span from a plain array. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D72604
2020-04-27 16:46:57 +00:00
Eric Rahm
01f450a03a Bug 1632613 - Part 1: Add a void** version of UniquePtr getter_Transfers. r=KrisWright
This adds a `void**` version fo `getter_Transfers` that is needed by the last remaining nsAutoPtr user in XSLT.

Differential Revision: https://phabricator.services.mozilla.com/D72431
2020-04-27 22:13:52 +00:00
André Bargull
ccbf88b7b0 Bug 1626587 - Part 4: Remove mozilla::IsPod for HashMapEntry. r=jwalden
The `mozilla::IsPod<HashMapEntry` specialisation was only needed for the static
assertions in "js/src/frontend/NameCollections.h". Part 3 removed those, so we
can now also remove `mozilla::IsPod<HashMapEntry`.

Drive-by change:
- Remove no longer needed "mozilla/PodOperations.h" include in mfbt/HashTable.h.
- And then fix up previously transitively included files for RootingAPI.h,
  jsfriendapi.h, and Bench.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D69201
2020-04-27 12:00:48 +00:00
Simon Giesecke
2d8c4390b7 Bug 1628715 - Part 15: Replace MOZ_NONNULL_RETURN by returning NotNull<elem_type*>. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D71300
2020-04-24 13:35:27 +00:00
Simon Giesecke
9a017967d6 Bug 1628715 - Part 14: Add MOZ_NONNULL_RETURN attribute on NotNull::operator->. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71299
2020-04-24 13:33:55 +00:00
Simon Giesecke
e6e6d49af2 Bug 1628715 - Part 13: Add specialization NotNull<T*> with MOZ_NONNULL_RETURN attributes. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71298
2020-04-24 13:33:48 +00:00
Simon Giesecke
1961cd994a Bug 1628715 - Part 12: Add WrapNotNullUnchecked for NotNull<T*>. r=xpcom-reviewers,nika,jwalden
Differential Revision: https://phabricator.services.mozilla.com/D71296
2020-04-24 13:33:35 +00:00
Steve Fink
36169fa9e9 Bug 1626772 - Fixes for gcc 9 warnings r=botond
Differential Revision: https://phabricator.services.mozilla.com/D69275

--HG--
extra : moz-landing-system : lando
2020-04-10 20:40:03 +00:00
Mihai Alexandru Michis
f2e4ef7d2a Backed out 3 changesets (bug 1626772) for causing bustages in DefineEnum.h
CLOSED TREE

Backed out changeset f42150bdee2b (bug 1626772)
Backed out changeset ab5b637f714a (bug 1626772)
Backed out changeset fd4026a9f380 (bug 1626772)
2020-04-10 03:49:33 +03:00
Steve Fink
a0f2e976ce Bug 1626772 - Fixes for gcc 9 warnings r=botond
Differential Revision: https://phabricator.services.mozilla.com/D69275

--HG--
extra : moz-landing-system : lando
2020-04-02 17:59:46 +00:00
Chris Peterson
a6d592bbe2 Bug 1620152 - Part 4: Replace MOZ_DIAGNOSTIC_ALWAYS_TRUE() with MOZ_ALWAYS_TRUE(). r=janv
MOZ_ALWAYS_TRUE() evaluates its expression in both debug and release builds. This bug will change MOZ_ALWAYS_TRUE() to use MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT(), so MOZ_DIAGNOSTIC_ALWAYS_TRUE() will be redundant.

Differential Revision: https://phabricator.services.mozilla.com/D66922

--HG--
extra : moz-landing-system : lando
2020-04-09 02:08:10 +00:00
Chris Peterson
ceb9bb69c5 Bug 1620152 - Part 3: Implement MOZ_ALWAYS_TRUE()/etc using MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT(). r=froydnj
MOZ_ALWAYS_TRUE() evaluates its expression in both debug and release builds. This bug will change MOZ_ALWAYS_TRUE() to use MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT() so it will also assert in Nightly and DevEdition release builds.

Differential Revision: https://phabricator.services.mozilla.com/D66921

--HG--
extra : moz-landing-system : lando
2020-04-09 02:07:00 +00:00
Sebastian Hengst
88bbcf97df Backed out 4 changesets (bug 1620152) because it blocks the backout of bug 1626967. a=backout
Backed out changeset c6fe172dd237 (bug 1620152)
Backed out changeset a13507db74f7 (bug 1620152)
Backed out changeset 005a31ffa4bf (bug 1620152)
Backed out changeset 9c80be97934f (bug 1620152)
2020-04-08 10:06:27 +02:00
Chris Peterson
46bb24451b Bug 1620152 - Part 4: Replace MOZ_DIAGNOSTIC_ALWAYS_TRUE() with MOZ_ALWAYS_TRUE(). r=janv
MOZ_ALWAYS_TRUE() evaluates its expression in both debug and release builds. This bug will change MOZ_ALWAYS_TRUE() to use MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT(), so MOZ_DIAGNOSTIC_ALWAYS_TRUE() will be redundant.

Differential Revision: https://phabricator.services.mozilla.com/D66922

--HG--
extra : moz-landing-system : lando
2020-04-08 04:35:01 +00:00
Chris Peterson
fbe277226d Bug 1620152 - Part 3: Implement MOZ_ALWAYS_TRUE()/etc using MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT(). r=froydnj
MOZ_ALWAYS_TRUE() evaluates its expression in both debug and release builds. This bug will change MOZ_ALWAYS_TRUE() to use MOZ_DIAGNOSTIC_ASSERT() instead of MOZ_ASSERT() so it will also assert in Nightly and DevEdition release builds.

Differential Revision: https://phabricator.services.mozilla.com/D66921

--HG--
extra : moz-landing-system : lando
2020-04-08 06:02:36 +00:00
Timothy Gu
bfaebdfe1e Bug 1627285 - Check for NaN before std::min/max() in DOMQuad and DOMRect. r=emilio,jwalden
Tests were added as a part of bug 1626471. Expectations that the tests fail
have been removed.

Differential Revision: https://phabricator.services.mozilla.com/D69605

--HG--
extra : moz-landing-system : lando
2020-04-07 22:27:36 +00:00
Simon Giesecke
e3d1db10d9 Bug 1626884 - Make RC non-copyable and declare operator= only in debug builds. r=froydnj
RC should be non-copyable. It already is non-copyable in the atomic variant,
but not in the non-atomic variant. This ensures that RefCounted is also
non-copyable, which prevents that classes deriving from RefCounted get
accidentally copied.

Also, RC's operator= should be defined only in debug builds. As already
described in a code comment, it's only used in debug builds (to assign the
dead value), and otherwise no modifications other than incrementing &
decrementing should be possible.

Differential Revision: https://phabricator.services.mozilla.com/D69332

--HG--
extra : moz-landing-system : lando
2020-04-06 09:17:34 +00:00
Sylvestre Ledru
0aa6f03cf3 Bug 1519636 - Reformat recent changes to the Google coding style r=jgilbert
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D67574

--HG--
extra : moz-landing-system : lando
2020-04-05 13:34:58 +00:00
Narcis Beleuzu
f6ebb84618 Backed out 2 changesets (bug 1626884, bug 1627198) for bustages on ElfLoader.h CLOSED TREE
Backed out changeset b545e60f385c (bug 1627198)
Backed out changeset 16ee5dd004d3 (bug 1626884)

--HG--
extra : histedit_source : 21258c723c796773307977dabbd50de5aba6bd34
2020-04-03 21:56:38 +03:00
Simon Giesecke
d522d12fb3 Bug 1626884 - Make RC non-copyable and declare operator= only in debug builds. r=froydnj
RC should be non-copyable. It already is non-copyable in the atomic variant,
but not in the non-atomic variant. This ensures that RefCounted is also
non-copyable, which prevents that classes deriving from RefCounted get
accidentally copied.

Also, RC's operator= should be defined only in debug builds. As already
described in a code comment, it's only used in debug builds (to assign the
dead value), and otherwise no modifications other than incrementing &
decrementing should be possible.

Differential Revision: https://phabricator.services.mozilla.com/D69332

--HG--
extra : moz-landing-system : lando
2020-04-03 14:27:17 +00:00
Gurzau Raul
76614a9f25 Bug 1626267 - fix build bustage r=bustage-fix on a CLOSED TREE 2020-04-01 19:29:19 +03:00
Simon Giesecke
94fa08db9c Bug 1626267 - Added transformation algorithms with error handling. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68994

--HG--
extra : moz-landing-system : lando
2020-04-01 15:53:58 +00:00
Simon Giesecke
84dd9a7ef6 Bug 1626197 - Remove custom copy/move operations on EnumeratedArray. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68972

--HG--
extra : moz-landing-system : lando
2020-03-31 13:17:21 +00:00