admin管理员组文章数量:1415099
Our web site has a fairly plex JS app that fails with the latest Firefox 10 release. This is due to what appears to be a bug in the JS interpretor, making variables return NULL when they clearly aren't. This bug only occurs when the JIT piler is active, not when it's disabled. We will report the bug to Mozilla and try to find a workaround.
Is there a way to disable the JIT in Firefox for a specific script, from inside the script?
Thank you.
Our web site has a fairly plex JS app that fails with the latest Firefox 10 release. This is due to what appears to be a bug in the JS interpretor, making variables return NULL when they clearly aren't. This bug only occurs when the JIT piler is active, not when it's disabled. We will report the bug to Mozilla and try to find a workaround.
Is there a way to disable the JIT in Firefox for a specific script, from inside the script?
Thank you.
Share Improve this question asked Feb 23, 2012 at 9:45 Gabriel R.Gabriel R. 1,2601 gold badge19 silver badges30 bronze badges 5- 1 That sounds counter intuitive, even if it was possible. In order to issue the mand to disable JIT for a specific section of JS, from JS. You will need the piler to parse the JS and that can only be done by JIT. Since the script is already parsed, enabling or disabling JIT on it, does not make sense. – Ali Khalid Commented Feb 23, 2012 at 10:15
- It could be a proprietary attribute on the script tag, or on the html page. – Gabriel R. Commented Feb 23, 2012 at 10:30
- I would remend that you use some sort of browser version sniffing to dynamically replace the offending piece of JS or display a page with reduced feature until Mozilla issues a fix based on your bug report. I would also look into scenario where Mozilla says that this is not a bug, therefore I would I also look at workaround at my end. – Ali Khalid Commented Feb 23, 2012 at 14:27
- It actually is possible to order around the piler, as I understand it the interpreter parses the code first anyway. It appears that the JIT only kicks in for repeated or recurring procedures called more than a certain number of times. But I admit, I didn't research this enough. – Gabriel R. Commented Feb 23, 2012 at 17:42
- The issue is visible on this web page english-attack./game/say-what?content=101477 It's an english learning game built on HTML5-ish features. – Gabriel R. Commented Feb 23, 2012 at 18:57
2 Answers
Reset to default 6The answer es from Brian Hackett (:bhackett) at mozilla:
Using
with
in a script will disable the JIT for that script, e.g. adding awith({}) {}
to the top.
See it here https://bugzilla.mozilla/show_bug.cgi?id=730004#c11
Great news. This does indeed work around the issue.
Thanks everyone! Mozilla rocks!
Gabriel, there is no reliable way to do it. You may be able to disable the JIT for particular functions by using some sort of features that the JIT doesn't support yet, but obviously the JIT folks try to minimize the set of circumstances that can trigger this... There is no official "turn off the JIT" mand.
On the other hand, once you file the bug the JS engine folks may be able to suggest a workaround on your end, depending on what's going on.
Please cc me (":bz") on the bug you file?
本文标签: Can the Firefox JavaScript JIT be disabled from a scriptStack Overflow
版权声明:本文标题:Can the Firefox JavaScript JIT be disabled from a script? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745173108a2646094.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论