Open Bug 1442534 Opened 2 years ago Updated 9 months ago

ARM64: Improve code generation for atomics by avoiding fences

Categories

(Core :: JavaScript Engine: JIT, enhancement, P3)

ARM64
All
enhancement

Tracking

()

People

(Reporter: lth, Unassigned)

References

Details

(Whiteboard: [arm64:m3])

Currently we generate an ARM-like fence + op + fence instruction sequence for ARM64 seq_cst atomics; this is safe, but we can do better.  Specifically, the canonical reference [1] has optimized sequences that avoid fences by using only the acquire and release operations, even for seq_cst operation.

[1] http://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html
Priority: -- → P3
Whiteboard: [arm64:m3]

The optimized atomics are now about to become legal following an update to the memory model: https://github.com/tc39/ecma262/pull/1511. The executive summary is that the old memory model disallowed the use of release-acquire atomic ops for seq_cst operation in JS; the new model is slightly weaker and allows them, and the change is motivated by the desire to allow them on ARM64. (Apparently Chrome already uses weaker atomics here.)

You need to log in before you can comment on or make changes to this bug.