Previously, the tests assumed that the alignment of int and long equals
their size. This commit fixes the tests for targets like m68k that have
sizeof(int) == 4 and alignof(int) == 2. A static helper function sizemax
was introduced as the offset of the second element in Pair<int,long>
might be either determined by its alignment requirement or the size of
the preceding int element and we use the helper function to pick the
larger of the two values.
Differential Revision: https://phabricator.services.mozilla.com/D77289
Currently, MOZ_ALIGNED_DECL uses the order (_type, _align) for its
parameters. However, this order makes the code less readable when
_type is a larger object like a struct because the value for _align
would be at the end of the struct definition. By swapping the order
of _type and _align, the alignment value will always be next to
the type name, regardless how far the definition of _type extends.
Differential Revision: https://phabricator.services.mozilla.com/D77288
Previously, the tests assumed that the alignment of int and long equals
their size. This commit fixes the tests for targets like m68k that have
sizeof(int) == 4 and alignof(int) == 2. A static helper function sizemax
was introduced as the offset of the second element in Pair<int,long>
might be either determined by its alignment requirement or the size of
the preceding int element and we use the helper function to pick the
larger of the two values.
Depends on D77288
Differential Revision: https://phabricator.services.mozilla.com/D77289
Currently, MOZ_ALIGNED_DECL uses the order (_type, _align) for its
parameters. However, this order makes the code less readable when
_type is a larger object like a struct because the value for _align
would be at the end of the struct definition. By swapping the order
of _type and _align, the alignment value will always be next to
the type name, regardless how far the definition of _type extends.
Depends on D77287
Differential Revision: https://phabricator.services.mozilla.com/D77288
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
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
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
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
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
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
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
CLOSED TREE
Backed out changeset f42150bdee2b (bug 1626772)
Backed out changeset ab5b637f714a (bug 1626772)
Backed out changeset fd4026a9f380 (bug 1626772)
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
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
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
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