Closed Bug 1316827 Opened 8 years ago Closed 8 years ago

Wasm baseline: Improve double stack adjustments following calls

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: lth, Assigned: mds, Mentored)

References

Details

Attachments

(1 file)

The code for function calling is poorly abstracted (it is abstracted along the wrong lines / abstracted too much) and so ends up potentially adjusting SP twice, once in endCall to pop arguments actually passed to functions and once after the call to pop the values that were spilled by the sync() before the call.

Probably closely related to bug 1316806, which seeks to avoid the blanket sync() and to pass arguments by parallel assignment.
Mentor: lhansen
Hey :lth, I'm start ramping up with wasm and SpiderMonkey; this looks a relatively easy bug for a total newbie.
Do you have some spare cycle to briefly guide me through the code, please?
Assignee: nobody → mdesimone
Flags: needinfo?(lhansen)
Alright, I hope I haven't screwed things up too much. :)
The JS test harness seems clear.
Flags: needinfo?(lhansen)
Comment on attachment 8817754 [details]
Bug 1316827 - WASM: the stack is now free'd once, even when an adjustment is needed.

https://reviewboard.mozilla.org/r/97968/#review98276

Thank you!

::: js/src/wasm/WasmBaselineCompile.cpp:2200
(Diff revision 1)
>  
>          call.frameAlignAdjustment = ComputeByteAlignment(masm.framePushed() + sizeof(Frame),
>                                                           JitStackAlignment);
>      }
>  
> -    void endCall(FunctionCall& call)
> +    void endCall(FunctionCall& call, size_t stackSpace = 0)

My preference would probably be for this argument not to be optional.
Attachment #8817754 - Flags: review?(lhansen) → review+
(In reply to Lars T Hansen [:lth] (On PTO until 27 Dec) from comment #4)

> > -    void endCall(FunctionCall& call)
> > +    void endCall(FunctionCall& call, size_t stackSpace = 0)
> 
> My preference would probably be for this argument not to be optional.

Done. Thank you for your review!
Pushed by mdesimone@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/da29c78960eb
WASM: the stack is now free'd once, even when an adjustment is needed. r=lth
https://hg.mozilla.org/mozilla-central/rev/da29c78960eb
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: