Atomic fetch operations are effectful, which means they're attached to a resume
point. And because a resume point counts as a use, the "forEffect" optimisation
was never triggered. This is a regression from bug 1146364.
This optimisation is especially useful for atomic operations on BigInts, because
it allows us to omit the allocation of the result BigInt.
`WarpCacheIRTranspiler::emitAtomicsBinaryOp()` pushes `undefined` on the stack
when the "forEffect" optimisation is used, which should be okay because the
result is directly popped from the stack again.
ARM64:
Add the implementation for `LAtomicTypedArrayElementBinopForEffect` which is now
required to be present.
Depends on D104174
Differential Revision: https://phabricator.services.mozilla.com/D104175
Updates CacheIR for AtomicReadModifyWrite operations to support BigInt results.
Similar to part 3, add a temporary `supportBigInt` flag which will later be
removed again.
Depends on D104170
Differential Revision: https://phabricator.services.mozilla.com/D104171
Similar to the previous parts, CacheIR always calls into the VM and only Warp
performs the operation in inline assembly.
TypePolicy.cpp:
- Add `TruncateToInt32OrToBigIntPolicy` similar to the existing `TruncateToInt32Policy`.
- `TruncateToInt32Policy` will be removed at the end of this patch series.
CodeGenerator.cpp:
Add `createBigIntOutOfLine()` so we can call it from "CodeGenerator-x86.cpp".
x86:
The lack of free registers makes it necessary to use the stack more often to
temporarily save some registers.
Depends on D104167
Differential Revision: https://phabricator.services.mozilla.com/D104170
For CacheIR we're using an ABI call, because each platform has specific register
requirements we don't want to handle in CacheIR.
ARM32 and x86:
Reuse the existing WASM functions for `MacroAssembler::atomicStore64()`.
x86-only:
We're running out of registers, so we have to reuse `edx` as an additional temp
register.
ARM64 and x64:
Call `MacroAssembler::store64()` with an explicit memory barrier.
Differential Revision: https://phabricator.services.mozilla.com/D104167
For CacheIR we're using a VM call, because each platform has specific register
requirements we don't want to handle in CacheIR.
ARM32 and x86:
Reuse the existing WASM functions for `MacroAssembler::atomicLoad64()`.
ARM64 and x64:
Call `MacroAssembler::load64()` with an explicit memory barrier.
Depends on D104165
Differential Revision: https://phabricator.services.mozilla.com/D104166
This flag will be removed again at the end of this patch series. The flag
makes it possible to perform piecewise updates to allow BigInt inputs without
breaking the not yet updated functions.
Depends on D104164
Differential Revision: https://phabricator.services.mozilla.com/D104165
Small helper to abbreviate `ScaleFromElemWidth(Scalar::byteSize(type))` to just
`ScaleFromScalarType(type)`. Later patches will also use this new function.
Differential Revision: https://phabricator.services.mozilla.com/D104164
Move common code for converting operands into `ConvertOperand` and for unboxing
operands into `UnboxOperand`. Part 6 will also use `ConvertOperand`.
Differential Revision: https://phabricator.services.mozilla.com/D104162
Now that ScriptSource has no tracing requirements, we can replace the custom
wrapper time with a more gecko-friendly RefPtr.
Differential Revision: https://phabricator.services.mozilla.com/D104478
Implements the missing handle functions (OrInsertWith, OrUpdateWith), and harmonizes functions
to return a reference to the data.
Adds unit tests.
Differential Revision: https://phabricator.services.mozilla.com/D99764