Closed
Bug 1930952
Opened 3 months ago
Closed 3 months ago
Add initial implementation for the Atomics.pause proposal
Categories
(Core :: JavaScript: Standard Library, enhancement)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
134 Branch
Tracking | Status | |
---|---|---|
firefox134 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
No description provided.
Assignee | ||
Comment 1•3 months ago
|
||
Use the following instructions to implement Atomics.pause
:
- Target platform is x86 / x86_64:
- Use the
pause
instruction which is available since Pentium IV.
- Target platform is ARM32:
- Use the
yield
hint instruction which is available since ARMv6.
- Target platform is ARM64:
- Use the
isb
instruction. - ARM64 also provides a
yield
hint instruction, but current CPUs implement it
as a nop instruction, so implementations in other languages have switched to
isb
, because it more closely matches the delay observed in x86'spause
instruction. - See for example
core::hint::spin_loop
in Rust orThread.onSpinWait()
in Java.
Assignee | ||
Comment 2•3 months ago
|
||
Assignee | ||
Comment 3•3 months ago
|
||
The instructions are used in the next part.
Assignee | ||
Comment 4•3 months ago
|
||
Calling Atomics.pause
without having inlining support will just lead to
decreased performance due to the overhead for a JS -> C++ call, so provide at
least inlining support when no arguments are passed. Suppporting the iteration
count argument may require CPU-specific tuning, so this is out-of-scope for
now.
Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/3a80e137f7f2
Part 1: Initial implementation for the Atomics.pause proposal. r=iain
https://hg.mozilla.org/integration/autoland/rev/b64f6933537d
Part 2: Enable test262 tests for Atomics.pause. r=iain
https://hg.mozilla.org/integration/autoland/rev/65f71c78b93b
Part 3: Support encoding "pause" (x86) and "yield" (arm32) instructions. r=iain
https://hg.mozilla.org/integration/autoland/rev/e299ddd84481
Part 4: Inline Atomics.pause when called with no arguments. r=iain
Comment 6•3 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3a80e137f7f2
https://hg.mozilla.org/mozilla-central/rev/b64f6933537d
https://hg.mozilla.org/mozilla-central/rev/65f71c78b93b
https://hg.mozilla.org/mozilla-central/rev/e299ddd84481
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
status-firefox134:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•