Closed Bug 1772987 Opened 2 years ago Closed 2 years ago

Save caller frame pointer in Wasm JitEntry stub

Categories

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

task

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(3 files)

Before we can add a frame pointer to Warp frames, we need to fix Wasm's JitEntry stub to not clobber the frame pointer. It currently does fp := sp in its prologue to make stack unwinding work.

A later patch will add an offsets argument to save the return offset.

The JitEntry stub is also used for calls from JS Baseline Interpreter/JIT code.

Depends on D148485

The JitEntry stub clobbers the FP register in the prologue (to make stack unwinding work).
We need to change it to restore FP to allow adding frame pointers to Warp frames.

This patch changes the prologue to the standard frame prologue, and the epilogue
now stores the return offset to let the profiler correctly handle the instructions
between popping FP and returning.

ARM64 adds some complexity because the JIT ABI aligns the stack at the return address,
so we need to add a padding word to maintain 16-byte stack alignment. When we add the
callerFP to JitFrameLayout (similar to wasm::Frame) we can hopefully simplify this
a bit.

Depends on D148486

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6d3766652a6a part 1 - Add GenerateJitEntryEpilogue. r=rhunt https://hg.mozilla.org/integration/autoland/rev/fa2fcbc1942c part 2 - Rename unwoundIon* to unwoundJit*. r=rhunt https://hg.mozilla.org/integration/autoland/rev/e32ea06d4f36 part 3 - Save caller FP in JitEntry stub. r=rhunt
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
Regressions: 1774145
Regressions: 1776825
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: