Closed Bug 1077305 Opened 10 years ago Closed 5 years ago

Atomics: Generate better code for accesses to Uint32 arrays

Categories

(Core :: JavaScript Engine: JIT, defect, P5)

defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: lth, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This is followup work to bug 979594. The operations on SharedUint32Array will only be inlined if the predicted result type of the operation is Uint32. That is too pessimistic, because frequently a SharedUint32Array will only contain values that are in the Int32 range and so the predicted (observed) result type may be Int32. We probably can't quite use the same technique as for LoadTypedArrayElement, which will predict the type to be Int32 and bail if the prediction fails, since some of the operations in question - compareExchange, add, sub, and, or, xor - are not idempotent. It's possible that the best solution is to force the return type to Double, in order to get predictable performance and acceptable semantics.
Priority: -- → P5
Assignee: lhansen → nobody
Blocks: 1317626
No longer blocks: shared-array-buffer

Change Atomics for Uint32 TypedArrays to use Double-typed numbers. That way we
get a stable return type (always Double typed instead of Int32 or Double typed),
which ensures we get a deterministic inlining behaviour in Ion and make it
possible to inline Atomics functions for Uint32 in Warp.

Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Pushed by cbrindusan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/701d9a09a5bf Return Double for Atomics on Uint32 TypedArrays. r=jandem
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: