This improves GCC/Clang compiler optimizations. For example, when checking if
an object has `JSClass` `A` or `B` with `obj->is<A>() || obj->is<B>()`, the
compiler is now able to fold the redundant `obj->shape->base->clasp` loads.
This has an exception for `MaybeForwardedObjectClass` because that's called from
`ArrayBufferViewObject::trace` during compacting GC.
forwardedshape
Differential Revision: https://phabricator.services.mozilla.com/D160793
Adds detection of FMA in Intel CPUs.
Use vfmadd231ps/d and vfnmadd231ps/d instructions by default if FMA is available. Pref'd on/off with --wasm-relaxed-simd and --avx settings. The latter can be used to test different hardware.
Differential Revision: https://phabricator.services.mozilla.com/D161502
Addresses wrong refactoring/optimization of the
minMaxFloat32x4AVX and minMaxFloat64x2AVX functions.
Testing of this case is covered by spec tests.
(Also to be addressed in bug 1797194)
Differential Revision: https://phabricator.services.mozilla.com/D161335
We no longer load the prototype after bug 1792228, so we don't have to support
`MObjectStaticProto` during scalar replacement. This also means scalar
replacement when loading undefined properties is now trivially supported.
Differential Revision: https://phabricator.services.mozilla.com/D161702
Steps performed:
- Add "microsecond" and "nanosecond" to "intl/icu/data_filter.json".
- Run "icu_sources_data.py" to update the ICU data file.
- Run "update-tzdata.sh" to reapply the tzdata 2022f changes.
- Add "microsecond" and "nanosecond" to "SanctionedSimpleUnitIdentifiers.yaml".
- Run "make_intl_data.py units" to regenerate additional SpiderMonkey files.
Spec PR: https://github.com/tc39/ecma402/pull/708
Differential Revision: https://phabricator.services.mozilla.com/D161676
This fixes a problem where we were hitting simulated OOMs due to a mismatch
between what had been reserved and the actually capacity of the underlying
Vector. It's safe to use up to the capacity of the Vector, but simulated OOMs
are triggered if an attempt is used more space than what has been reserved.
With this change in place, we can use infallible resize operations in the
written method, avoiding problems with simulated OOMs there as well.
Differential Revision: https://phabricator.services.mozilla.com/D161330
JS::RuntimeHeapIsMinorCollecting() gets the JSContext from TLS, but
IsMarkedInternal() can be called from a helper thread where this is null.
Differential Revision: https://phabricator.services.mozilla.com/D161611
Prefer INT32_MAX over UINT32_MAX so we don't have to worry about too large
values when inlining `{Map,Set}.prototype.size` in the JITs.
Differential Revision: https://phabricator.services.mozilla.com/D161576
Add explicit casts to ensure the operations are performed using integer instead
of floating point math. Existing assertions ensure there won't be integer overflows.
Depends on D161591
Differential Revision: https://phabricator.services.mozilla.com/D161592
`emitFunCallGuard()` and `emitFunApplyGuard()` are basically identical, ignoring
assertions and comments. Add a shared helper method to further reduce code duplication.
Differential Revision: https://phabricator.services.mozilla.com/D161469
Now that `emitNativeCalleeGuard()` also needs to handle `js::fun_apply`, it makes
sense to merge `emitNativeCalleeGuard()` and `emitNativeCalleeGuardAndLoadArgsArray()`
to reduce code duplication.
Also reorder the checks, so that the most common case `CallFlags::Standard` is
handled first.
Differential Revision: https://phabricator.services.mozilla.com/D161468
Also support inlinable natives for FunApply when called with less than two
arguments. Similar to FunCall, don't yet support the case when called with
zero arguments.
Differential Revision: https://phabricator.services.mozilla.com/D161467
`js::AtomizeString` is pretty hot and caching the most recent lookups helps avoid
slower hash table lookups in 30-65% of cases (> 60% on Speedometer 2).
Differential Revision: https://phabricator.services.mozilla.com/D161571
Since the caller usually needs to know the zone anyway, this seems simpler
if we query based on the zone rather than the object.
Differential Revision: https://phabricator.services.mozilla.com/D146677
The Atomic class supports operations such as |&=| that perform atomic updates
on shared memory that are correct when performed concurrently with other such
updates. This is unnecessary for the mark bitmap and results in sub-optimal
code generation.
Instead, updates can be done with separate read and write operations.
Differential Revision: https://phabricator.services.mozilla.com/D161473
I was over eager in introducing the strong pointers to WorkerLoadContext. It turns out that
previously when we were cycle collecting our ScriptLoadRequests, we were also cleaning up everything
related to WorkerLoadContext. Also, in an attempt to fix the cancellation for workers, We
accidentally stopped cleaning up the reference to the cache creator. This patch does the following:
1) cleans up the cache creator reference whenever we finish with a cache load handler. This is done
by calling Fail appropriately. This solves both bug 1798667 (we no longer reach NEW_URI if we fail)
and 1781295 (we no longer leak memory because things were not cleaned up properly).
2) Does no remove the back reference to WorkerLoadContext from the LoadRequest. It turns out that
this is sometimes necessary. There is a chance that we will accidently try to access the
WorkerLoadContext after cancellation. This actually causes problems later on in the module code.
Differential Revision: https://phabricator.services.mozilla.com/D161288