Support inlining Atomics functions for BigInt64/BigUint64
Categories
(Core :: JavaScript Engine: JIT, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(12 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Atomics
functions aren't inlined for BigInt64/BigUint64 typed arrays.
(I don't plan to work on this feature, I just need to have a bug number for a comment in new code.)
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Move common code for converting operands into ConvertOperand
and for unboxing
operands into UnboxOperand
. Part 6 will also use ConvertOperand
.
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Small helper to abbreviate ScaleFromElemWidth(Scalar::byteSize(type))
to just
ScaleFromScalarType(type)
. Later patches will also use this new function.
Depends on D104162
Assignee | ||
Comment 3•4 years ago
|
||
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
Assignee | ||
Comment 4•4 years ago
|
||
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
Assignee | ||
Comment 5•4 years ago
|
||
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.
Depends on D104166
Assignee | ||
Comment 6•4 years ago
|
||
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 existingTruncateToInt32Policy
. 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
Assignee | ||
Comment 7•4 years ago
|
||
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
Assignee | ||
Comment 8•4 years ago
|
||
Depends on D104171
Assignee | ||
Comment 9•4 years ago
|
||
Depends on D104172
Assignee | ||
Comment 10•4 years ago
|
||
The type policy is no longer used.
Depends on D104173
Assignee | ||
Comment 11•4 years ago
|
||
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
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5a0a182e23a4
https://hg.mozilla.org/mozilla-central/rev/5945dd7a044b
https://hg.mozilla.org/mozilla-central/rev/ec6924fb01b0
https://hg.mozilla.org/mozilla-central/rev/ca1ee10645a8
https://hg.mozilla.org/mozilla-central/rev/383b15c21c8c
https://hg.mozilla.org/mozilla-central/rev/3e2bc51738df
https://hg.mozilla.org/mozilla-central/rev/139d52d305d7
https://hg.mozilla.org/mozilla-central/rev/69c02b1a38bc
https://hg.mozilla.org/mozilla-central/rev/8f83f6869c7c
https://hg.mozilla.org/mozilla-central/rev/687ba6d36005
https://hg.mozilla.org/mozilla-central/rev/c42ecf3fdcfe
Comment 14•4 years ago
|
||
Inline Atomics.load, Atomics.store, Atomics.compareExchange,
Atomics.exchange and Atomics.{add,and,or,sub,xor}.
Comment 15•4 years ago
|
||
Comment 16•4 years ago
|
||
bugherder |
Description
•