In AudioResampler the resampling of a buffer happens on pieces of 128 or 256 frames. Before resampling, the number of available frames is checked for the whole buffer and for the individual smaller pieces. When the whole buffer is checked we need to check for one extra frame in order to compensate the case that one individual resampling has consumed an extra frame, something that is normal and happens periodically.
Differential Revision: https://phabricator.services.mozilla.com/D81321
We want it to returning the actual nsThread if that's where the MessageLoop would dispatch its tasks; otherwise return the MessageLoop's EventTarget
Depends on D80357
Differential Revision: https://phabricator.services.mozilla.com/D80811
Basically generalize almost all the tests to run with both shared and
unshared memory, removing a number of validation failures. Test
run-time failure in the case of wait() on unshared memory, and that
notify() on unshared memory returns 0.
Differential Revision: https://phabricator.services.mozilla.com/D81320
Pretty simple change: remove the validation guards on plain atomic
operations, and distinguish between shared and unshared memory for
wait and notify. Per spec, wait checks for sharedness before checking
for alignment or bounds, and notify returns 0 after checking for
alignment and bounds.
Differential Revision: https://phabricator.services.mozilla.com/D81319
We will shortly be unable to depend on the presence of shared memory
as a gate for the thread operations, so just add proper gating
depending on the shared-memory pref.
Differential Revision: https://phabricator.services.mozilla.com/D81328
The STS dispatched the first event before setting mThread member. It was possible that the STS::Run() task got started before mThread was set and causing one of the nsISerialEventTarget methods to read mThread/mInitialised/mShuttingDown value as null or zero and they would have returned an error.
We rewrite and simplify the access to mThread such that it's a lockless operation.
ApplyPortRemapPreference assert that it's running on the taskqueue; however if called before initialization, it would have been run on whatever thread called ApplyPortRemap.
Differential Revision: https://phabricator.services.mozilla.com/D81334
This works around Android implementations that allow for non-ES contexts
to be created even though they don't work properly.
Differential Revision: https://phabricator.services.mozilla.com/D81666
Until now we always used an Ion IC if there was no Baseline IC stub to transpile.
This isn't great for Baseline ICs that were never hit because we could get stuck
in Ion ICs instead of using the transpiler.
With this patch we bail out and if that happens more than 10 times we invalidate
the Warp code and then warm up and try a second time.
Depends on D81064
Differential Revision: https://phabricator.services.mozilla.com/D81065
This fixes another test failure because we were not getting back into Warp code
quickly enough after a cold-IC bailout. With --ion-eager we want to compile without
waiting and that should probably also apply to recompiles.
Depends on D81063
Differential Revision: https://phabricator.services.mozilla.com/D81064
The clones appear to be so that access for the tree view in preferences is quick. However, they don't need to clone the entire engine object - they just need three fields.
Additionally, this fixes reloading icons which was attempting to use 'uri' but that isn't defined, and so icons would fail to load if preferences was opened when a search engine is added.
Differential Revision: https://phabricator.services.mozilla.com/D80496
This patch additionally makes the search cache responsible for listening to notifications rather than being directly told by the search service to write the cache.
It also makes writes after init/reinit/maybeReloadEngines into delayed writes as they don't need to be immediate - the code already ensures we write any pending cache before reading, and that we write it before shutdown. Therefore, it doesn't matter if we wait a second or so.
Differential Revision: https://phabricator.services.mozilla.com/D80472