Closed Bug 1747418 Opened 2 years ago Closed 2 years ago

Use predefined names for stack offsets when they exist

Categories

(Core :: JavaScript: WebAssembly, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: lth, Assigned: lth)

Details

Attachments

(1 file)

Not a functional change: We already have predefined names for frame offsets to the TLS slots that take into account shadow stack space. We should use these names uniformly, not randomly expand their definitions in other places.

The names used in some of this code are a little loopy. FrameWithTls is a Frame + two TLS slots, fine. But offset computations methods on FrameWithTls secretly subtract the size of the Frame, so eg ExtractCalleeTlsFromFrameWithTls has to add back sizeof(Frame) to get to the right point because it takes a Frame* argument.

This observation gives rise to a slightly different fix.

Methods that do semi-magical things (subtracting magic values) should
have names to reflect that. Code that compensates for the magic by
undoing it should instead have access to methods that do the right
thing.

Static functions used only by one file might as well be in that file,
and not in some random other file that provides no specific
information for those functions.

Attachment #9256713 - Attachment description: Bug 1747418 - Clean up some naming. r?rhunt → Bug 1747418 - Clean up FrameWithTls et al. r?rhunt
Pushed by lhansen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cd8f0b107cd4
Clean up FrameWithTls et al. r=rhunt
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: