Closed
Bug 1365769
Opened 9 years ago
Closed 9 years ago
[Ion] Fix MToString when it throws due to a Symbol
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla55
| Tracking | Status | |
|---|---|---|
| firefox55 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
If attached example is run with --ion-eager --ion-offthread-compile=off, the TypeError escapes the try block.
| Assignee | ||
Comment 1•9 years ago
|
||
In this case, the MToString is marked setMovable, so LICM hoists it outside of the try-block, causing the exception to think it fired at line 4 and does not get caught.
One fix would be to *not* mark setMovable *if* Symbol (or Object) case.
| Assignee | ||
Comment 2•9 years ago
|
||
After fixing the code motion problem, the next issue we hit is that when the |ConvertToStringPolicy| of |MNewStringObject| gets applied, we introduce an MToString that has no resume point. This causes |x| to have the wrong value in the catch block.
| Assignee | ||
Comment 3•9 years ago
|
||
A further bug occurs when we use JSOP_TOSTRING (via template literals). In this case we are missing the |resumeAfter| in |IonBuilder::jsop_tostring| when |value->mightBeType(MIRType::Symbol)|.
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 5•9 years ago
|
||
Proposed fix is to simply bailout on Symbols and have the exception fire off in Baseline instead. This allows us to keep the MToString as movable. If LICM hoists the node, we simply bail out sooner and perform the details in Baseline instead.
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → tcampbell
Comment 6•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8869095 [details]
Bug 1365769 - MToString should bailout on Symbols
https://reviewboard.mozilla.org/r/140718/#review145110
Good catch, thanks for fixing.
Attachment #8869095 -
Flags: review?(jdemooij) → review+
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8ed5deec4fc3
MToString should bailout on Symbols r=jandem
Comment 8•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•