Changeset 19534 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Feb 9, 2007, 11:28:02 AM (18 years ago)
Author:
andersca
Message:

JavaScriptCore:

Reviewed by Geoff.

<rdar://problem/4930614>
Safari complains about "Slow Script" if GMail is left open and machine is busy


<rdar://problem/4649516>
Turn off slow script dialog or crank up time that makes it come up


<rdar://problem/4963589>
Slow script warning is displayed after closing of PROMPT or PRINT dialog


Re-do the way script timeouts are handled. No longer use a unix timer that sends signals. Instead, add a
tick count and increment it in loop bodies. If the tick count reaches a threshold, do a timeout check. If the total time executing
is higher than the timeout value, (possibly) interrupt the script. The timeout checker also adjusts the threshold dynamically
to prevent doing the timeout check too often.



  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add winmm.lib.
  • kjs/interpreter.cpp: (KJS::Interpreter::init): (KJS::Interpreter::~Interpreter): (KJS::Interpreter::startTimeoutCheck): (KJS::Interpreter::stopTimeoutCheck): (KJS::Interpreter::resetTimeoutCheck): (KJS::getCurrentTime): (KJS::Interpreter::checkTimeout):
  • kjs/interpreter.h: (KJS::Interpreter::timedOut):
  • kjs/nodes.cpp: (DoWhileNode::execute): (WhileNode::execute): (ForNode::execute):

WebCore:

Reviewed by Geoff.

No need to pause timeout checks anymore.


  • bindings/js/kjs_window.cpp: (KJS::WindowFunc::callAsFunction):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r19364 r19534  
    17331733    exec->context()->popIteration();
    17341734   
    1735     if (exec->dynamicInterpreter()->checkTimeout())
     1735    if (exec->dynamicInterpreter()->timedOut())
    17361736        return Completion(Interrupted);
    17371737
     
    17811781    exec->context()->popIteration();
    17821782
    1783     if (exec->dynamicInterpreter()->checkTimeout())
     1783    if (exec->dynamicInterpreter()->timedOut())
    17841784        return Completion(Interrupted);
    17851785   
     
    18361836    }
    18371837   
    1838     if (exec->dynamicInterpreter()->checkTimeout())
     1838    if (exec->dynamicInterpreter()->timedOut())
    18391839        return Completion(Interrupted);
    18401840   
Note: See TracChangeset for help on using the changeset viewer.