Closed
Bug 1329096
Opened 9 years ago
Closed 9 years ago
Wasm baseline: Use NonAssertingLabel for Block/Loop, get rid of the label pool
Categories
(Core :: JavaScript Engine: JIT, defect, P2)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla53
| Tracking | Status | |
|---|---|---|
| firefox53 | --- | fixed |
People
(Reporter: lth, Assigned: lth)
References
Details
Attachments
(1 file, 1 obsolete file)
|
15.25 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
Currently there is a label pool in the baseline compiler because the labels for Block and Loop don't obey stack discipline (because of nonrecursive traversal of the bytecode). This label pool is dynamic, so risks OOM, so there is OOM handling and error propagation, it's all a little ugly.
Luke suggests (bug 1316819 comment 3) that we can use NonAssertingLabel instead here, and get rid of the label pool and the OOM handling.
This work will interact slightly with bug 1316814 (control stack revamp), be sure to take that into account.
| Assignee | ||
Comment 1•9 years ago
|
||
Something like this? Passes testing locally, seems reasonable. (Sits on top of my current patch for bug 1331900.)
Notes:
(1) Discussion going on in bug 1331900 about whether it's reasonable for the iterator's control stack to reinitialize the control item when it switches to the 'else' branch. In the patch on that bug I hacked around the problem. Here I remove that functionality entirely since it requires the ControlItem to be assignable, and mine aren't. Hence asking for feedback only. If we keep the current reinit functionality for ControlItems then this patch won't work in its current form.
(2) What became a copy before readEnd() in bug 1331900 becomes a Move here to handle the non-copyable Labels.
Comment 2•9 years ago
|
||
Comment on attachment 8827851 [details] [diff] [review]
bug1329096-remove-label-pool.patch
Review of attachment 8827851 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great, pretty mechanical except for interactions with bug 1316814 which I think will be decided in that bug (possibly folding in this patch).
Attachment #8827851 -
Flags: feedback?(luke) → feedback+
| Assignee | ||
Comment 3•9 years ago
|
||
Similar to the patch you just saw but avoids the very dodgy use of the Move() operation and does not make any changes to the iterator, only to the baseline compiler.
Attachment #8827851 -
Attachment is obsolete: true
Attachment #8827982 -
Flags: review?(luke)
Comment 4•9 years ago
|
||
Comment on attachment 8827982 [details] [diff] [review]
bug1329096-remove-label-pool-v2.patch
Review of attachment 8827982 [details] [diff] [review]:
-----------------------------------------------------------------
Great! It'll be interesting to see if this moves the dial on awfy.
::: js/src/wasm/WasmBaselineCompile.cpp
@@ +380,1 @@
> stackSize(0),
Could these be initialized to bogus (UINT32_MAX) values that initControl() asserts are bogus?
@@ +5416,4 @@
> if (!deadCode_)
> sync(); // Simplifies branching out from block
>
> + initControl(controlItem());
Could this now be moved to right after readBlock() (to minimize the created-but-not-initialized range of the Control item)? Also in emitLoop()
@@ +7591,5 @@
> return false;
>
> beginFunction();
>
> + initControl(controlItem());
Similarly, could this be moved right under readFunctionStart()?
Attachment #8827982 -
Flags: review?(luke) → review+
| Assignee | ||
Comment 5•9 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #4)
> Comment on attachment 8827982 [details] [diff] [review]
> bug1329096-remove-label-pool-v2.patch
>
> Review of attachment 8827982 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> @@ +5416,4 @@
> > if (!deadCode_)
> > sync(); // Simplifies branching out from block
> >
> > + initControl(controlItem());
>
> Could this now be moved to right after readBlock() (to minimize the
> created-but-not-initialized range of the Control item)? Also in emitLoop()
I don't think so. initControl() captures masm.framePushed() and that may be updated by sync(): for now, we have an adjustable stack pointer.
> @@ +7591,5 @@
> > return false;
> >
> > beginFunction();
> >
> > + initControl(controlItem());
>
> Similarly, could this be moved right under readFunctionStart()?
Ditto, masm.framePushed() will be updated (for sure) by beginFunction.
| Assignee | ||
Comment 6•9 years ago
|
||
| Assignee | ||
Comment 7•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/082be147ff94724672c59bb62ef47d8c086cd191
Bug 1329096 - Wasm baseline, remove the label pool and use NonAssertingLabel instead. r=luke
Comment 8•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•