Replaces `MOZ_BIG_ENDIAN()` with testing for `std::endian::native == std::endian::big`. In
statement contexts `if constexpr` is used to mark the condition as a compile-time constant.
The only remaining `MOZ_BIG_ENDIAN()` uses are in "modules/fdlibm/src/math_private.h"
and will get updated in parts 4-5.
Adds explicit includes to "mozilla/EndianUtils.h" for files which previously
only transitively included it through "mozilla/HashTable.h".
Differential Revision: https://phabricator.services.mozilla.com/D288177
This reverts commit 5d8e0746eb.
Revert "Bug 2023878 - Part 6: Remove MOZ_LITTLE_ENDIAN and MOZ_BIG_ENDIAN. r=sergesanspaille"
This reverts commit 634b3e1287.
Revert "Bug 2023878 - Part 5: Reimport fdlibm with updated patches. r=sergesanspaille"
This reverts commit 5ed2376e75.
Revert "Bug 2023878 - Part 4: Replace MOZ_LITTLE_ENDIAN and MOZ_BIG_ENDIAN in fdlibm. r=sergesanspaille"
This reverts commit 36dad49d5b.
Revert "Bug 2023878 - Part 3: Replace MOZ_LITTLE_ENDIAN uses with std::endian::little. r=sergesanspaille,media-playback-reviewers,padenot"
This reverts commit e89c61d064.
Revert "Bug 2023878 - Part 2: Replace MOZ_BIG_ENDIAN uses with std::endian::big. r=sergesanspaille,media-playback-reviewers,profiler-reviewers,canaltinova,padenot,necko-reviewers,dom-storage-reviewers,jesup"
This reverts commit be3c506fcf.
Revert "Bug 2023878 - Part 1: Use std::endian for mozilla::detail::Endianness. r=sergesanspaille"
This reverts commit dc96d4abe8.
Replaces `MOZ_BIG_ENDIAN()` with testing for `std::endian::native == std::endian::big`. In
statement contexts `if constexpr` is used to mark the condition as a compile-time constant.
The only remaining `MOZ_BIG_ENDIAN()` uses are in "modules/fdlibm/src/math_private.h"
and will get updated in parts 4-5.
Adds explicit includes to "mozilla/EndianUtils.h" for files which previously
only transitively included it through "mozilla/HashTable.h".
Differential Revision: https://phabricator.services.mozilla.com/D288177
This will make Firefox behavior in our performance CI tests more realistic:
These tests perform a warmup run which is killed before the regular
StartupCache write occurs. We don't really want to increase the time for
the warmup run, and I believe the behavior introduced in this patch makes
sense regardless - if there's no cache, writing out an incomplete cache
is better than waiting for more complete data and failing to write it out.
Differential Revision: https://phabricator.services.mozilla.com/D283122
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
According to the doc of mfbt/Try.h, MOZ_TRY_VAR is obsolete. Yet it was
used a lot across the code base.
Solely relying on MOZ_TRY is both nicer to the eye and more generic, as
it allows setting variable that don't have a default constructor, and
event sometimes more efficient, if the default constructor is
non-trivial.
Differential Revision: https://phabricator.services.mozilla.com/D268466
This avoids the small overhead and potential for bugs from the previous
approach of assuming all `const char*` arguments passed to `nsITimer`
initializers are string literals, by instead requiring the argument to be a
`const nsACString&`. This involves changing all callsites to pass a `""_ns`
string literal down instead of a bare string literal.
It appears that while there were currently no buggy callers which
would've provided a dynamic string, there was at least one piece of code
(nsRepeatService::Start) which did pass down a raw char* which may be
dynamically allocated (all callers pass down `nsLiteralCString` so we're
actually OK here right now, but this was a footgun).
Differential Revision: https://phabricator.services.mozilla.com/D261032
This reverts commit 8c929cc018.
Revert "Bug 1979013 - Part 2: Require nsITimer API callers to provide a nsACString, r=xpcom-reviewers,media-playback-reviewers,webrtc-reviewers,profiler-reviewers,dom-storage-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,mstange,emz,bwc,janv,emilio,padenot"
This reverts commit e01c0a6a32.
Revert "Bug 1979013 - Part 1: Eagerly fetch name for timer callbacks, r=xpcom-reviewers,mccr8"
This reverts commit 9f8e73c163.
This avoids the small overhead and potential for bugs from the previous
approach of assuming all `const char*` arguments passed to `nsITimer`
initializers are string literals, by instead requiring the argument to be a
`const nsACString&`. This involves changing all callsites to pass a `""_ns`
string literal down instead of a bare string literal.
It appears that while there were currently no buggy callers which
would've provided a dynamic string, there was at least one piece of code
(nsRepeatService::Start) which did pass down a raw char* which may be
dynamically allocated (all callers pass down `nsLiteralCString` so we're
actually OK here right now, but this was a footgun).
Differential Revision: https://phabricator.services.mozilla.com/D261032
While much of this is simply converting code (and removing extraneous
`size` parameters), toolkit/xre/GeckoArgs.{h,cpp} has some significant
changes to support sending read-only handles (which is all we need!).
Differential Revision: https://phabricator.services.mozilla.com/D236750
While much of this is simply converting code (and removing extraneous
`size` parameters), toolkit/xre/GeckoArgs.{h,cpp} has some significant
changes to support sending read-only handles (which is all we need!).
Differential Revision: https://phabricator.services.mozilla.com/D236750
This spidermonkey-internal code is already shared betwen processes but we can
extend this also preserve accross restarts. This is particularly helpful on
Android where the parent process cycles more frequently.
The startupcache is available before the JS engine starts so we use that instead
of the script-preloader which requires the JS engine to be initialized already.
Differential Revision: https://phabricator.services.mozilla.com/D238999
In a previous change to this logic, we missed a hidden early return in
the `MMAP_FAULT_HANDLER_CATCH()` macro which can early return on both
Linux and Windows. If this is hit, we could end up blocking at various
points waiting for the StartupCache to be prefetched.
This patch changes the logic to notify to happen in a ScopeExit instead,
ensuring that it'll happen on all return paths.
In addition, there was another potential deadlock due to the
ThreadedPrefetch thread acquiring mTableLock. This was fixed by passing
in the pointers in the runnable instead. This should be OK as we are
making sure to block on ThreadedPrefetch before we clear the startup
data already.
Differential Revision: https://phabricator.services.mozilla.com/D182732
The startup cache essentially leaks memory here for the old startup cache
data. My assumption here is that there can be dangling pointers into this
data so it's not safe to delete these old tables. Live language switching
is a relatively rare event, so this leak should be acceptable compared to
adding locking mechanisms to the underlying data.
Differential Revision: https://phabricator.services.mozilla.com/D140968