Alternative approach to rescuing JIT in Zotero.setTimeout/Zotero.pumpGenerator

This commit is contained in:
Simon Kornblith 2012-07-26 08:55:38 -04:00
parent 344bd1fb74
commit c464321811

View file

@ -1475,8 +1475,11 @@ Components.utils.import("resource://gre/modules/Services.jsm");
var timer = Components.classes["@mozilla.org/timer;1"].
createInstance(Components.interfaces.nsITimer),
yielded;
yielded,
useJIT = Components.utils.methodjit;
var timerCallback = {"notify":function() {
Components.utils.methodjit = useJIT;
var err = false;
_waiting--;
try {
@ -1537,8 +1540,11 @@ Components.utils.import("resource://gre/modules/Services.jsm");
*/
this.setTimeout = function(func, ms, runWhenWaiting) {
var timer = Components.classes["@mozilla.org/timer;1"].
createInstance(Components.interfaces.nsITimer);
createInstance(Components.interfaces.nsITimer),
useJIT = Components.utils.methodjit;
var timerCallback = {"notify":function() {
Components.utils.methodjit = useJIT;
if(_waiting && !runWhenWaiting) {
// if our callback gets called during Zotero.wait(), queue it to be set again
// when Zotero.wait() completes