Closed Bug 1705664 Opened 4 years ago Closed 4 years ago

Centralise save-area-size computation for the bailout-register-save-area

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: jseward, Assigned: jseward)

References

Details

Attachments

(1 file)

MacroAssembler methods PushRegsInMask, storeRegsInMask, PopRegsInMask
and PopRegsInMaskIgnore create code to save/restore arbitrary subsets of the
registers in memory. Unfortunately logic which computes the size of this area
is decoupled from those routines and is not documented as being dependent on
them. This also means the format must be the same for all targets, which
isn't optimal re alignment of SIMD registers.

This patch introduces a new method, MacroAssembler::PushRegsInMaskSizeInBytes,
to calculate that size independently on a per-platform basis. Ad-hoc
computations of the size are replaced by a call to this. On arm64, the
routine is used in an assertion to crosscheck the actual used size in
PushRegsInMask, storeRegsInMask and PopRegsInMaskIgnore.

Blocks bug 1678097 / D100116 - Add vector registers on ARM64.

Severity: -- → N/A
Status: NEW → ASSIGNED
Component: Javascript: WebAssembly → JavaScript Engine: JIT
Priority: -- → P2

MacroAssembler methods PushRegsInMask, storeRegsInMask, PopRegsInMask and
PopRegsInMaskIgnore create code to save/restore arbitrary subsets of the
registers in memory. Unfortunately logic which computes the size of this area
is decoupled from those routines and is not documented as being dependent on
them. This also means the format must be the same for all targets, which may
not be optimal in future when we come to save/restore SIMD registers on more
targets.

This patch introduces a new method, MacroAssembler::PushRegsInMaskSizeInBytes,
to calculate that size independently on a per-platform basis. Ad-hoc
computations of the size are replaced by a call to this method. On
x86_{32,64} and arm{32,64}, the method is used in assertions to crosscheck
the actual used size in PushRegsInMask, storeRegsInMask and
PopRegsInMaskIgnore.

The inferred invariants have been recorded in comments. There is no change to
the generated code.

Attachment #9216719 - Attachment description: Bug 1705664 - Centralise save-area-size computation for the bailout-register-save-area. r=nbp. → Bug 1705664 - Centralise save-area-size computation for the bailout-register-save-area. r=lth.
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2cf5cde0ea50 Centralise save-area-size computation for the bailout-register-save-area. r=lth.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: