Closed
Bug 834785
Opened 11 years ago
Closed 11 years ago
Toplevel script ion compilation fails due to popv opcode if DOM methods/properties used
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(2 files)
197 bytes,
text/html
|
Details | |
6.18 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
A simple testcase is attached. When I run this in a debug build with IONFLAGS=aborts I get: [Abort] Unsupported opcode: popv (line 8) [Abort] aborted @ file:///private/tmp/test.html:8 [Abort] Builder failed to build. [Abort] IM Compilation failed. [Abort] Disabling Ion compilation of script file:///private/tmp/test.html:3 Wrapping the loop in a function makes it compile fine.
Comment 1•11 years ago
|
||
Boris, can we compile global scripts with JSOPTION_NO_SCRIPT_RVAL? That's what the shell uses as well (except for interactive mode of course), and may be the easiest fix...
Assignee | ||
Comment 2•11 years ago
|
||
Hmm. That's a JSContext option not a CompileOptions option? I guess we could do that too, actually, but is there a reason it's on the cx?
Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(jdemooij)
Comment 3•11 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #2) > Hmm. That's a JSContext option not a CompileOptions option? > > I guess we could do that too, actually, but is there a reason it's on the cx? There is a CompileOptions option too (noScriptRval). Its default value comes from the cx JSOPTION_NO_SCRIPT_RVAL flag, but you can override it using CompileOptions::setNoScriptRval.
Flags: needinfo?(jdemooij)
Assignee | ||
Comment 4•11 years ago
|
||
Hmm. So thing is... setting noScriptRval on the options doesn't work because JS::Evaluate happily clobbers it. So it looks like we need to explicitly pass a null rval to JS::Evaluate here...
Assignee | ||
Comment 5•11 years ago
|
||
This is a regression from bug 824864. We used to pass in a null vp before then.
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #707401 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bzbarsky
Comment 7•11 years ago
|
||
Comment on attachment 707401 [details] [diff] [review] Make sure to not ask the JS engine for return values in toplevel scripts, so it'll be able to ion-compile them as needed. Review of attachment 707401 [details] [diff] [review]: ----------------------------------------------------------------- This patch makes me sad, but I can't think of another way. r=bholley ::: dom/base/nsJSEnvironment.cpp @@ +1255,4 @@ > NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED); > + if (aRetValue) { > + *aRetValue = JSVAL_VOID; > + } Can you add a comment here as well explaining why it's necessary to support null here?
Attachment #707401 -
Flags: review?(bobbyholley+bmo) → review+
Assignee | ||
Comment 8•11 years ago
|
||
Added comment and https://hg.mozilla.org/integration/mozilla-inbound/rev/95b168efcfe8
Flags: in-testsuite?
Whiteboard: [need review]
Target Milestone: --- → mozilla21
Comment 9•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/95b168efcfe8
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•