Closed Bug 1774546 Opened 2 years ago Closed 2 years ago

Add frame pointer to CommonFrameLayout

Categories

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

task

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(3 files)

All frames now push the caller's frame pointer. It would be better to move this field to the CommonFrameLayout now so that we don't have to add/subtract FramePointerOffset in a number of places.

JitFrameLayout is currently 16-byte aligned on the return address. This makes adding a new field somewhat annoying, but one option is to combine the argc field with the descriptor that now only uses a few bits since bug 1774390. This way we don't have to change the size of JitFrameLayout.

Also simplify BaselineFrame::numActualArgs by forwarding to JitFrameLayout::numActualArgs.

This renames the numActualArgs_ field to unused_ and stores a constant there
for now. The next patch will remove this field and simultaneously add the frame
pointer to CommonFrameLayout, preserving the current JitFrameLayout size.

Depends on D149758

Now that all frames store the caller's frame pointer, we can add it to CommonFrameLayout
and get rid of FramePointerOffset.

This also removes JitFrameLayout::unused_. This has to happen at the same time so that
sizeof(JitFrameLayout) doesn't change (a lot of code depends on that for alignment).

JitFrameLayout is now aligned on the frame pointer instead of the return address.
This lets us simplify some of the Wasm stubs code (especially for ARM64) where we had
to workaround the old aligned-after-return-address invariant.

Depends on D149759

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/57fa270767c8 part 1 - Add MacroAssembler::loadNumActualArgs. r=iain https://hg.mozilla.org/integration/autoland/rev/3b67acc061e9 part 2 - Store number of arguments in the frame descriptor. r=iain https://hg.mozilla.org/integration/autoland/rev/103f879d45ff part 3 - Store caller frame pointer in CommonFrameLayout. r=iain,rhunt
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch

(In reply to Pulsebot from comment #4)

Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/57fa270767c8
part 1 - Add MacroAssembler::loadNumActualArgs. r=iain
https://hg.mozilla.org/integration/autoland/rev/3b67acc061e9
part 2 - Store number of arguments in the frame descriptor. r=iain
https://hg.mozilla.org/integration/autoland/rev/103f879d45ff
part 3 - Store caller frame pointer in CommonFrameLayout. r=iain,rhunt

== Change summary for alert #34685 (as of Thu, 30 Jun 2022 04:54:36 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
4% assorted-dom windows10-64-shippable-qr fission webrender 20.44 -> 19.55

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=34685

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

Attachment

General

Created:
Updated:
Size: