Can the Firefox JavaScript JIT be disabled from a script? - Stack Overflow

Our web site has a fairly plex JS app that fails with the latest Firefox 10 release. This is due to wha

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
Add a ment  | 

2 Answers 2

Reset to default 6

The answer es from Brian Hackett (:bhackett) at mozilla:

Using with in a script will disable the JIT for that script, e.g. adding a with({}) {} 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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745173108a4615047.html

相关推荐

  • Can the Firefox JavaScript JIT be disabled from a script? - Stack Overflow

    Our web site has a fairly plex JS app that fails with the latest Firefox 10 release. This is due to wha

    2小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信